Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2011-12

compiling the compiler from within the Lazarus IDE

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bernd

Hi,

I have never ever tried to hack on the compiler itself before so this is probably a stupid question (and probably not the last one) but I assume there is a simple answer:

My Platform is Linux/i386. I have looked around a bit and found inside the compiler directory are a few .lpi files lying around, I have opened pp.lpi with lazarus and it will build an executable pp and output it into the i386 folder and this seems to be a working compiler that can compile a simple hello world program on i386 which will run on i386. But it did not seem to use any of the source files inside the i386 folder! I intentionally placed some some writeln() and even introduced some syntax errors and it would still compile and the resulting pp binary would be an i386 compiler. How is this possible?

when I build the compiler with make from within the compiler directory then it will use all these units and produce a ppc386. What is the difference?

confused,
Bernd

Florian Klämpfl
to Bernd
Bernd wrote 12 lines
Hi, I have never ever tried to hack on the compiler itself before so this is probably a stupid question (and probably not the last one) but I assume there is a simple answer: My Platform is Linux/i386. I have looked around a bit and found inside the compiler directory are a few .lpi files lying around, I have opened pp.lpi with lazarus and it will build an executable pp and output it into the i386 folder and this seems to be a working compiler that can compile a simple hello world program on i386 which will run on i386.

Yes, so far correct.

Show quoted text 10 lines
But it did not seem to use any of the source files inside the i386 folder! I intentionally placed some some writeln() and even introduced some syntax errors and it would still compile and the resulting pp binary would be an i386 compiler. How is this possible? when I build the compiler with make from within the compiler directory then it will use all these units and produce a ppc386. What is the difference? confused,

Me too ;) Can you point out which units you changed?

Bernd
to Florian Klämpfl

2011/12/31 Florian Klämpfl :

> confused, Me too ;) Can you point out which units you changed?

It got even more confusing after I cleaned the lazbuild directory because I figured out that there were compiled units from *before* I made the changes (I made changes to aopt386 and also csopt386) and then it wouldn't even compile at all anymore.

It seems I somehow managed to mess up something in the lpi file or it was Lazarus' fault, it suddenly started complaining about globals could not find cpuinfo. After I did a make clean and also svn revert pp.lpi (because it seemed to be messed up too) and tried again now it seems to work as expected.

Bernd