tags:

views:

100

answers:

1

How can I compile the GCC Compiler so that I can pull the entire thing over to another system and use the program? I don't mind pulling in other files as well, but is there a way to gather all the required system libs as well? The OS and Arch will remain constant across the different systems, but one may contain Slackware where the other contains Debian.

A: 

Don't try to build it as a static binary. That's hopeless.

Instead, look into how cross compilers are built. Then do the same for your GCC except you will be building for the same CPU architecture. Build your binutils into /opt/mygcc, build your GCC into /opt/mygcc, build your own system libraries into there if you want also.

A major problem with ignoring the default system libraries will be that programs you build against some other library may not run on the system.

Even if you build static binaries you may end up with a binary that won't run on an older OS kernel. For example, pthreads built on a NPTL Linux kernel will not run on a 2.2 or 2.4 kernel.

Zan Lynx
So you're suggesting something like this? http://wiki.osdev.org/GCC_Cross-Compiler
CaCl