How do you build GCC 4.0.1 statically?

Zachary Zuwodny zz@beeb.net
Sun Aug 28 11:09:00 GMT 2005


Hi,

I would like to build a bootstrapped GCC which is not dynamically linked
to any shared libraries (as a temporary measure since I am building
Linux from scratch).

Most programs can be built statically by "make LDFLAGS=-static", and for
GCC 3 I believe the right command was "make BOOT_LDFLAGS=-static bootstrap",
but how is it done for GCC 4.0.1?

I found the variables LDFLAGS, LDFLAGS_FOR_BUILD and LDFLAGS_FOR_TARGET
in the Makefile, so I tried setting them all to "-static", but I still
got a dynamic executable.

Any ideas?

Thanks very much for your help,
Zac.




More information about the Gcc-help mailing list