Building 64 bit compiler on Solaris AMD64
Scott L. Burson
Scott@ergy.com
Wed Dec 17 20:15:00 GMT 2008
Hi,
(This message started out as a question, but I managed to figure it
out. Still, I think people might want to know.)
I have figured out how to build a 64-bit GCC 4.3.2 on Solaris AMD64.
I wanted to build a 64 bit compiler (I mean, one where the compiler
executables are 64 bit) for performance.
I found this:
http://gcc.gnu.org/ml/gcc-help/2008-12/msg00103.html
which explained why supplying CC='gcc -m64' to configure didn't work.
So then I tried this:
../gcc-4.3.2/configure --prefix=/usr/local/gcc-4.3.2 --with-gnu-as
--with-as=/usr/local/gnu/bin/as --without-gnu-ld
--with-ld=/usr/ccs/bin/ld --enable-languages=c,c++ CFLAGS='-m64 -g
-O2' BOOT_CFLAGS='-m64 -g -O2' LDFLAGS='-L/usr/local/lib/64'
BOOT_LDFLAGS='-L/usr/local/lib/64'
only to find that the BOOT_CFLAGS and BOOT_LDFLAGS don't actually get
edited into the top-level Makefile. Okay fine, I edited the Makefile
by hand and kicked off the build. But the '-m64' still doesn't
propagate to all the right places; gcc/build/genmodes.o comes out as
32 bit, and the build dies because it can't link with the built
libiberty.
Supplying CC='gcc -m64' in addition to CFLAGS fixed that problem, but
I found out I also needed to set CXXFLAGS.
So here's the configure line that worked:
../gcc-4.3.2/configure --prefix=/usr/local/gcc-4.3.2 --with-gnu-as
--with-as=/usr/local/gnu/bin/as --without-gnu-ld
--with-ld=/usr/ccs/bin/ld --enable-languages=c,c++ CC='gcc -m64'
CFLAGS='-m64 -g -O2' CXXFLAGS='-m64 -g -O2'
LDFLAGS='-L/usr/local/lib/64'
The steps are:
() Run configure as above
() Hand-edit the top-level Makefile, setting BOOT_CFLAGS and
BOOT_LDFLAGS like CFLAGS and LDFLAGS
() Start the make
Seems like there's a general problem here of building a 64-bit
compiler in an environment where the default is 32 bits. I think it
should be easier. Maybe it deserves a specific configure option?
-- Scott
More information about the Gcc-help
mailing list