Sign in Join

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

Mailing lists / fpc-pascal / 2018-08

Rebuilding RTL

6 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Ryan Joseph

If I cd to the rtl directory in the fpc sources and run make they are compiled into the /rtl/units/x86_64-darwin directory.

1) How do I compile the ppc386 units? the readme says there’s a FPC variable for on the makefile configs but I can’t find it.

2) After I make the units what switch can I use for fpc so it uses those units instead of the default location? I tried -Fo and -Fu but it still used the default rtl location.

Thanks.

Regards,
Ryan Joseph

Reply by email

Sven Barth
to Ryan Joseph

Ryan Joseph schrieb am Mi., 8. Aug. 2018,
00:02:

Show quoted text 6 lines
If I cd to the rtl directory in the fpc sources and run make they are compiled into the /rtl/units/x86_64-darwin directory. 1) How do I compile the ppc386 units? the readme says there’s a FPC variable for on the makefile configs but I can’t find it.

Pass CPU_TARGET=i386 to the call to make. Though you need to use a ppc386 that. Best do a "make cycle CPU_TARGET=i386" inside the "compiler" directory. This will build both the RTL and the compiler.

2) After I make the units what switch can I use for fpc so it uses those units instead of the default location? I tried -Fo and -Fu but it still used the default rtl location.

Are you sure that you used the correct compiler? Try to pass -n to tell it to ignore the fpc.cfg and see whether it picks up the correct ones when you pass them with - Fu (-Fo is not required). You can also use -vut to see which locations the compiler tries to find units in and which it uses in the end.

Regards,
Sven

Regards,
Sven

Reply by email

Ryan Joseph
to Sven Barth
On Aug 7, 2018, at 4:17 PM, Sven Barth via fpc-pascal wrote: Are you sure that you used the correct compiler? Try to pass -n to tell it to ignore the fpc.cfg and see whether it picks up the correct ones when you pass them with - Fu (-Fo is not required). You can also use -vut to see which locations the compiler tries to find units in and which it uses in the end.

Maybe I’m doing this all wrong. I’m building with the compiler using lazbuild /fpc/compiler/pp.lpi then using the compiler at /fpc/compiler/i386/pp.

Does that make any difference to your instructions?

Regards,
Ryan Joseph

Reply by email

Sven Barth
to Ryan Joseph
Ryan Joseph wrote 7 lines
> On Aug 7, 2018, at 4:17 PM, Sven Barth via fpc-pascal wrote: > > Are you sure that you used the correct compiler? Try to pass -n to tell it to ignore the fpc.cfg and see whether it picks up the correct ones when you pass them with - Fu (-Fo is not required). You can also use -vut to see which locations the compiler tries to find units in and which it uses in the end. Maybe I’m doing this all wrong. I’m building with the compiler using lazbuild /fpc/compiler/pp.lpi then using the compiler at /fpc/compiler/i386/pp. Does that make any difference to your instructions?

The main difference is that the compiler will not be build using the new RTL. This is in most cases no problem at least if you don't want to use new features that you added to the RTL *inside* the compiler.

I do that myself as well when testing bugs or developing new features (though I don't use Lazbuild, but build inside the IDE, but that shouldn't make a difference). I then build the RTL like this:

make clean all FPC=/path/to/src/compiler/<cpu>/pp

And then I can use the new RTL like this (assuming my current directory is the trunk checkout):

./compiler/<cpu>/pp -n -Furtl/units/<cpu>-<os> [other options] mytest.pp

Please keep in mind that probably you can't use units outside of the RTL directory in that case (due to different checksums), for that you'd need to do a "make clean all" inside the top level directory which will also rebuild the compiler, the RTL and all packages. Also you *must not* use "fpc" as that will use your installed compiler, but you must use the one you compiled directly.

Regards,
Sven

Reply by email

Ryan Joseph
to Sven Barth
Show quoted text 13 lines
On Aug 7, 2018, at 11:34 PM, Sven Barth via fpc-pascal wrote: The main difference is that the compiler will not be build using the new RTL. This is in most cases no problem at least if you don't want to use new features that you added to the RTL *inside* the compiler. I do that myself as well when testing bugs or developing new features (though I don't use Lazbuild, but build inside the IDE, but that shouldn't make a difference). I then build the RTL like this: make clean all FPC=/path/to/src/compiler/<cpu>/pp And then I can use the new RTL like this (assuming my current directory is the trunk checkout): ./compiler/<cpu>/pp -n -Furtl/units/<cpu>-<os> [other options] mytest.pp Please keep in mind that probably you can't use units outside of the RTL directory in that case (due to different checksums), for that you'd need to do a "make clean all" inside the top level directory which will also rebuild the compiler, the RTL and all packages. Also you *must not* use "fpc" as that will use your installed compiler, but you must use the one you compiled directly.

Thanks Sven, that works.

Btw, what are all these messages I get when building the compiler? I don’t know if they should be ignored or I caused them myself.

objc1.inc(360,3) Note: tgobj: (FreeTemp) freeing of temp at pos -2147483648 requested

Regards,
Ryan Joseph

Reply by email

Sven Barth
to Ryan Joseph

Ryan Joseph schrieb am Mi., 8. Aug. 2018,
18:48:

Show quoted text 6 lines
Btw, what are all these messages I get when building the compiler? I don’t know if they should be ignored or I caused them myself. objc1.inc(360,3) Note: tgobj: (FreeTemp) freeing of temp at pos -2147483648 requested

They are due to the EXTDEBUG define that is set in the pp.lpi. Someone had added that to the project file cause they wanted to hunt bugs with temps. If it annoys you, you can remove it in your project options.

Regards,
Sven

Reply by email