compiling gcc for multiple targets?

Ian Lance Taylor
Wed Mar 31 11:40:00 GMT 2004

"Carl B. Constantine" <> writes:

> Is there any way to compile gcc and related utils (binutils, gdb) for
> multiple targets in one binary? So I want to compile it to support both
> Solaris intel and m68hc11 in one gcc instead of having separate binaries
> for each?

For gcc, no.  For gas and gdb, sometimes.  For the binutils and ld,
yes (use --enable-targets).

> If I cannot do this, but have to compile separate versions
> (--program-prefix=m6811-elf) are there any issues wrt to libraries if
> they are installed to the same place? for example? is target independent, so it is safe to install the for multiple targets in the same place.  The target
libraries, such as libstdc++-v3, will by default be installed in
directories whose names depend upon the target, so they should not
ordinarily cause any conflicts.  You should avoid building a shared, as it will be target-dependent; that is, do not configure
the GNU binutils with --enable-shared.


More information about the Gcc-help mailing list