This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Building 64 bit compiler on Solaris AMD64
- From: "Scott L. Burson" <Scott at ergy dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Wed, 17 Dec 2008 11:58:38 -0800
- Subject: Building 64 bit compiler on Solaris AMD64
- References: <310c21410812171118t1d3500b1w622f154cc8411fba@mail.gmail.com>
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