This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Statically compiling gcc
- From: Ian Lance Taylor <iant at google dot com>
- To: "Andy Gibbs" <andyg1001 at hotmail dot co dot uk>
- Cc: <gcc-help at gcc dot gnu dot org>
- Date: Wed, 28 Jul 2010 06:42:07 -0700
- Subject: Re: Statically compiling gcc
- References: <BLU0-SMTP6837623445DE7600371240E7A80@phx.gbl>
"Andy Gibbs" <andyg1001@hotmail.co.uk> writes:
> Is it possible to compile gcc itself statically, i.e. without any
> library dependencies? I have compiled gcc on my local machine, but it
> is linked against eglibc 2.11, but the build server we use has eglibc
> 2.3.6 instead so when copying gcc across, it doesn't run. At this
> time, we don't want to upgrade libc on an otherwise working server.
>
> I know it is possible to do Canadian cross-compiles, but I haven't
> managed to get this to work. Therefore I was wondering if I can
> simply statically compile gcc instead? Searching google and the gcc
> documentation just brings up a lot of stuff about using gcc to
> staticially compile other applications, not statically compiling gcc
> itself!
It would probably work if you build gcc with
make BOOT_LDFLAGS=-static
I haven't tried it, though.
Ian