How to build stand-alone (statically linked) gcc?

Tim Prince n8tm@aol.com
Fri Jul 31 20:01:00 GMT 2015



On 7/31/2015 3:17 PM, David Kang wrote:
>  I am building gcc as a cross compiler.
> I'm building it on Ubuntu 14.04, but I want to use the gcc binaries on older CentOS machines.
> So, far gcc complains that it cannot find proper glibc on the older CentOS machines.
>
> gcc: /lib64/libc.so.6: version `GLIBC_2.8' not found (required by /tmp/gcc)
> gcc: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /tmp/gcc)
> gcc: /lib64/libc.so.6: version `GLIBC_2.11' not found (required by /tmp/gcc)
>
>  Is there a way to build gcc itself such that gcc doesn't need dynamic library for maximum portability?
>
You may widen the range of supported dynamic glibc by building against
the oldest one you wish to support (within reason).
I wouldn't like to try supporting both CentOS and Ubuntu with the same
binary, given that the latter uses varying non-LSB schemes for managing
32- and 64-bit applications.

-- 
Tim Prince



More information about the Gcc-help mailing list