Sign in Join

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

Mailing lists / fpc-pascal / 2011-01

Building FPC on LFS system

7 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

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

Geoffray Levasseur

Hi everybody...

My problem is simple. As far as I know there's no way to build FPC without FPC. So can anybody can tell me how to bootstrap FPC to build it on a LFS system without FPC installed?

I suppose I'll have to download a precompiled version for my system (x86_64) but I want do do this in a clean way.

Another question: is there any usefull optimization flags (just like CFLAGS)?

Thanks.

Geoffray « fatalerrors » Levasseur http://jeff.levasseur.tuxfamily.org GNU-PG public key: B0EC11B62617B11A582A7C4226573BFD878E334D Sic luceat lux et pax.
Marco van de Voort
to Geoffray Levasseur

In our previous episode, Geoffray Levasseur said:

My problem is simple. As far as I know there's no way to build FPC without FPC. So can anybody can tell me how to bootstrap FPC to build it on a LFS system without FPC installed?

Crosscompile. Either by entirely linking on host, or to assembler and assembling/linking on target. Note that the core FPC binaries are static by default, which eases this a bit.

I suppose I'll have to download a precompiled version for my system (x86_64) but I want do do this in a clean way. Another question: is there any usefull optimization flags (just like CFLAGS)?

See -O and friends in fpc -h

ik
to Geoffray Levasseur: Hi everybody... My problem is simple. As far as I know there's no way to build FPC without
Geoffray Levasseur wrote 6 lines
Hi everybody... My problem is simple. As far as I know there's no way to build FPC without FPC. So can anybody can tell me how to bootstrap FPC to build it on a LFS system without FPC installed?

LFS is usually installed from an existed linux distro, so you should install it on the hosting linux, and then compile it to your own distro (LFS is to build your own base at least).

Show quoted text 18 lines
I suppose I'll have to download a precompiled version for my system (x86_64) but I want do do this in a clean way. Another question: is there any usefull optimization flags (just like CFLAGS)? Thanks. -- Geoffray « fatalerrors » Levasseur http://jeff.levasseur.tuxfamily.org GNU-PG public key: B0EC11B62617B11A582A7C4226573BFD878E334D Sic luceat lux et pax. _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Ido
LINESIP - Opening the source for communication
http://www.linesip.com
http://www.linesip.co.il

Jonas Maebe
to Geoffray Levasseur: Hi everybody... My problem is simple. As far as I know there's no way to build FPC without
Geoffray Levasseur wrote
I suppose I'll have to download a precompiled version for my system (x86_64) but I want do do this in a clean way.

Assuming "LFS" in your mail meant "Linux From Scratch", you can a download bootstrap binary from ftp://ftp.freepascal.org/fpc/dist/2.4.0/bootstrap/ppcx64-x86_64-linux.bz2 (it seems no bootstrap compiler for Linux/x86_64 was uploaded for 2.4.2, but the 2.4.0 binary can be used to bootstrap 2.4.2).

Another question: is there any usefull optimization flags (just like CFLAGS)?

Not really. The default -O2 will be pretty much optimal. Only if you have an SSE3 capable cpu, you can add OPT="-Cfsse3" at the end of make command line. It won't make much of a difference though, as it only affects certain float to int conversions.

Jonas

Geoffray Levasseur
to Jonas Maebe
Jonas Maebe wrote 10 lines
On 30 Jan 2011, at 14:35, Geoffray Levasseur wrote: > I suppose I'll have to download a precompiled version for my system > (x86_64) but I want do do this in a clean way. Assuming "LFS" in your mail meant "Linux From Scratch", you can a download bootstrap binary from ftp://ftp.freepascal.org/fpc/dist/2.4.0/bootstrap/ppcx64-x86_64-linux.bz2 (it seems no bootstrap compiler for Linux/x86_64 was uploaded for 2.4.2, but the 2.4.0 binary can be used to bootstrap 2.4.2).

Perfect this is exactly what I was looking for.

Show quoted text 8 lines
> Another question: is there any usefull optimization flags (just like > CFLAGS)? Not really. The default -O2 will be pretty much optimal. Only if you have an SSE3 capable cpu, you can add OPT="-Cfsse3" at the end of make command line. It won't make much of a difference though, as it only affects certain float to int conversions.

OK right just basic things so... Mayby any 64 bits optimizations (I'm thinking about a -m64 equivalent to gcc)?

Jonas_______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Thanks

Geoffray « fatalerrors » Levasseur http://jeff.levasseur.tuxfamily.org GNU-PG public key: B0EC11B62617B11A582A7C4226573BFD878E334D Sic luceat lux et pax.
Geoffray Levasseur
to ik: LFS is usually installed from an existed linux distro, so you should install it on the…
ik wrote
LFS is usually installed from an existed linux distro, so you should install it on the hosting linux, and then compile it to your own distro (LFS is to build your own base at least).

Yes that's a possibility but bootstraping is cleaner so I prefer the third possibility (the one from Jonas). Nevertheless I keep this option in mind.

Thanks

Geoffray « fatalerrors » Levasseur http://jeff.levasseur.tuxfamily.org GNU-PG public key: B0EC11B62617B11A582A7C4226573BFD878E334D Sic luceat lux et pax.
Jonas Maebe
to Geoffray Levasseur: Perfect this is exactly what I was looking for. OK right just basic things so... Mayby…
Geoffray Levasseur wrote 8 lines
On Sunday 30 January 2011 14:49:29 Jonas Maebe wrote: > Not really. The default -O2 will be pretty much optimal. Only if you have > an SSE3 capable cpu, you can add OPT="-Cfsse3" at the end of make command > line. It won't make much of a difference though, as it only affects > certain float to int conversions. > OK right just basic things so... Mayby any 64 bits optimizations (I'm thinking about a -m64 equivalent to gcc)?

ppcx64 will always generate code that is the equivalent of gcc -m64. For gcc -m32 code, you have to compile a ppc386 instead (bootstrap compiler is also available in the same directory). The generic compiler driver (similar to the "gcc" program for GCC) is called "fpc", and selecting the target processor happens using its -P option (-Pi386, -Px86_64). That one will call through to ppcx64, ppc386, ...

Jonas