How to build a full compiler on Solaris 9

E. Stuart Hicks ehicks@binarymagi.com
Tue Apr 6 21:12:00 GMT 2004


I wasn't sure where to send something like this so I'll just fire it off
into wherever this email address goes.  After a lot of hair pulling I
finally have a working version of 3.3.3 for Solaris 9 with all available
compilers available.  (Including GNAT)  I kept a record of everything I had
to do and I figured it might be useful to others.  It's attached to this
email.

Stu
-------------- next part --------------
# Build directory is /root/build/gcc-3.3.3/gcc-build
# A working gnat compiler exists from a binary package in /root/build/gnatgcc
# /usr/ccs/bin/make should be renamed until the 1st build is over so GNU make in /usr/local/bin is used
# /root/build/gcc-3.3.3/libjava/java/net/natInetAddress.cc needs: #define MAXHOSTNAMELEN  256

# Environmental requirements
export ORIGPATH=$PATH
export PATH=/root/build/gnatgcc/bin:/usr/ccs/bin:$PATH
export CONFIG_SHELL=/bin/ksh

# Build and install a 32-bit compiler
cd ../gcc/ada
touch treeprs.ads [es]info.h nmake.ad[bs]
cd ../../gcc-build
../configure \
--prefix=/root/build/gnatgcc3-32bit \
--disable-nls \
--enable-languages=c,c++,ada
make bootstrap
cd gcc
make gnatlib_and_tools
cd ada/rts
../../xgcc -B../../ -c -DIN_GCC `echo -g -O2 -fPIC -fexceptions -DIN_RTS |sed -e 's/-pedantic//g' -e 's/-Wtraditional//g'` -I. -I.. -I../.. -I/root/build/gcc-3.3.3/gcc/ada -I/root/build/gcc-3.3.3/gcc/ada/.. -I/root/build/gcc-3.3.3/gcc/ada/../config -I/root/build/gcc-3.3.3/gcc/ada/../../include -I./../.. adaint.c
../../xgcc -B../../ -c -DIN_GCC `echo -g -O2 -fPIC -fexceptions -DIN_RTS |sed -e 's/-pedantic//g' -e 's/-Wtraditional//g'` -I. -I.. -I../.. -I/root/build/gcc-3.3.3/gcc/ada -I/root/build/gcc-3.3.3/gcc/ada/.. -I/root/build/gcc-3.3.3/gcc/ada/../config -I/root/build/gcc-3.3.3/gcc/ada/../../include -I./../.. argv.c
../../xgcc -B../../ -c -DIN_GCC `echo -g -O2 -fPIC -fexceptions -DIN_RTS |sed -e 's/-pedantic//g' -e 's/-Wtraditional//g'` -I. -I.. -I../.. -I/root/build/gcc-3.3.3/gcc/ada -I/root/build/gcc-3.3.3/gcc/ada/.. -I/root/build/gcc-3.3.3/gcc/ada/../config -I/root/build/gcc-3.3.3/gcc/ada/../../include -I./../.. cio.c
../../xgcc -B../../ -c -DIN_GCC `echo -g -O2 -fPIC -fexceptions -DIN_RTS |sed -e 's/-pedantic//g' -e 's/-Wtraditional//g'` -I. -I.. -I../.. -I/root/build/gcc-3.3.3/gcc/ada -I/root/build/gcc-3.3.3/gcc/ada/.. -I/root/build/gcc-3.3.3/gcc/ada/../config -I/root/build/gcc-3.3.3/gcc/ada/../../include -I./../.. cstreams.c
../../xgcc -B../../ -c -DIN_GCC `echo -g -O2 -fPIC -fexceptions -DIN_RTS |sed -e 's/-pedantic//g' -e 's/-Wtraditional//g'` -I. -I.. -I../.. -I/root/build/gcc-3.3.3/gcc/ada -I/root/build/gcc-3.3.3/gcc/ada/.. -I/root/build/gcc-3.3.3/gcc/ada/../config -I/root/build/gcc-3.3.3/gcc/ada/../../include -I./../.. exit.c
../../xgcc -B../../ -c -DIN_GCC `echo -g -O2 -fPIC -fexceptions -DIN_RTS |sed -e 's/-pedantic//g' -e 's/-Wtraditional//g'` -I. -I.. -I../.. -I/root/build/gcc-3.3.3/gcc/ada -I/root/build/gcc-3.3.3/gcc/ada/.. -I/root/build/gcc-3.3.3/gcc/ada/../config -I/root/build/gcc-3.3.3/gcc/ada/../../include -I./../.. raise.c
../../xgcc -B../../ -c -DIN_GCC `echo -g -O2 -fPIC -fexceptions -DIN_RTS |sed -e 's/-pedantic//g' -e 's/-Wtraditional//g'` -I. -I.. -I../.. -I/root/build/gcc-3.3.3/gcc/ada -I/root/build/gcc-3.3.3/gcc/ada/.. -I/root/build/gcc-3.3.3/gcc/ada/../config -I/root/build/gcc-3.3.3/gcc/ada/../../include -I./../.. init.c
../../xgcc -B../../ -c -DIN_GCC `echo -g -O2 -fPIC -fexceptions -DIN_RTS |sed -e 's/-pedantic//g' -e 's/-Wtraditional//g'` -I. -I.. -I../.. -I/root/build/gcc-3.3.3/gcc/ada -I/root/build/gcc-3.3.3/gcc/ada/.. -I/root/build/gcc-3.3.3/gcc/ada/../config -I/root/build/gcc-3.3.3/gcc/ada/../../include -I./../.. adafinal.c
../../xgcc -B../../ -c -DIN_GCC `echo -g -O2 -fPIC -fexceptions -DIN_RTS |sed -e 's/-pedantic//g' -e 's/-Wtraditional//g'` -I. -I.. -I../.. -I/root/build/gcc-3.3.3/gcc/ada -I/root/build/gcc-3.3.3/gcc/ada/.. -I/root/build/gcc-3.3.3/gcc/ada/../config -I/root/build/gcc-3.3.3/gcc/ada/../../include -I./../.. tracebak.c
cd ../..
make gnatlib_and_tools
cd ..
make install

# Clean out the build directory and update the environment
rm -rf *
export PATH=/root/build/gnatgcc3-32bit/bin:/usr/ccs/bin:$ORIGPATH

# Build and install a 64-bit capable cross compiler
cd ../gcc/ada
touch treeprs.ads [es]info.h nmake.ad[bs]
cd ../../gcc-build
../configure \
--enable-languages=all \
--disable-nls \
--with-ld=/usr/ccs/bin/ld --with-as=/usr/ccs/bin/as \
sparcv9-sun-solaris2
make
cd gcc
make cross-gnattools
make gnatlib
cd ada/rts
../../xgcc -B../../ -c -DIN_GCC `echo -g -O2 -fPIC -fexceptions -DIN_RTS |sed -e 's/-pedantic//g' -e 's/-Wtraditional//g'` -I. -I.. -I../.. -I/root/build/gcc-3.3.3/gcc/ada -I/root/build/gcc-3.3.3/gcc/ada/.. -I/root/build/gcc-3.3.3/gcc/ada/../config -I/root/build/gcc-3.3.3/gcc/ada/../../include -I./../.. adaint.c
../../xgcc -B../../ -c -DIN_GCC `echo -g -O2 -fPIC -fexceptions -DIN_RTS |sed -e 's/-pedantic//g' -e 's/-Wtraditional//g'` -I. -I.. -I../.. -I/root/build/gcc-3.3.3/gcc/ada -I/root/build/gcc-3.3.3/gcc/ada/.. -I/root/build/gcc-3.3.3/gcc/ada/../config -I/root/build/gcc-3.3.3/gcc/ada/../../include -I./../.. argv.c
../../xgcc -B../../ -c -DIN_GCC `echo -g -O2 -fPIC -fexceptions -DIN_RTS |sed -e 's/-pedantic//g' -e 's/-Wtraditional//g'` -I. -I.. -I../.. -I/root/build/gcc-3.3.3/gcc/ada -I/root/build/gcc-3.3.3/gcc/ada/.. -I/root/build/gcc-3.3.3/gcc/ada/../config -I/root/build/gcc-3.3.3/gcc/ada/../../include -I./../.. cio.c
../../xgcc -B../../ -c -DIN_GCC `echo -g -O2 -fPIC -fexceptions -DIN_RTS |sed -e 's/-pedantic//g' -e 's/-Wtraditional//g'` -I. -I.. -I../.. -I/root/build/gcc-3.3.3/gcc/ada -I/root/build/gcc-3.3.3/gcc/ada/.. -I/root/build/gcc-3.3.3/gcc/ada/../config -I/root/build/gcc-3.3.3/gcc/ada/../../include -I./../.. cstreams.c
../../xgcc -B../../ -c -DIN_GCC `echo -g -O2 -fPIC -fexceptions -DIN_RTS |sed -e 's/-pedantic//g' -e 's/-Wtraditional//g'` -I. -I.. -I../.. -I/root/build/gcc-3.3.3/gcc/ada -I/root/build/gcc-3.3.3/gcc/ada/.. -I/root/build/gcc-3.3.3/gcc/ada/../config -I/root/build/gcc-3.3.3/gcc/ada/../../include -I./../.. exit.c
../../xgcc -B../../ -c -DIN_GCC `echo -g -O2 -fPIC -fexceptions -DIN_RTS |sed -e 's/-pedantic//g' -e 's/-Wtraditional//g'` -I. -I.. -I../.. -I/root/build/gcc-3.3.3/gcc/ada -I/root/build/gcc-3.3.3/gcc/ada/.. -I/root/build/gcc-3.3.3/gcc/ada/../config -I/root/build/gcc-3.3.3/gcc/ada/../../include -I./../.. raise.c
../../xgcc -B../../ -c -DIN_GCC `echo -g -O2 -fPIC -fexceptions -DIN_RTS |sed -e 's/-pedantic//g' -e 's/-Wtraditional//g'` -I. -I.. -I../.. -I/root/build/gcc-3.3.3/gcc/ada -I/root/build/gcc-3.3.3/gcc/ada/.. -I/root/build/gcc-3.3.3/gcc/ada/../config -I/root/build/gcc-3.3.3/gcc/ada/../../include -I./../.. init.c
../../xgcc -B../../ -c -DIN_GCC `echo -g -O2 -fPIC -fexceptions -DIN_RTS |sed -e 's/-pedantic//g' -e 's/-Wtraditional//g'` -I. -I.. -I../.. -I/root/build/gcc-3.3.3/gcc/ada -I/root/build/gcc-3.3.3/gcc/ada/.. -I/root/build/gcc-3.3.3/gcc/ada/../config -I/root/build/gcc-3.3.3/gcc/ada/../../include -I./../.. adafinal.c
../../xgcc -B../../ -c -DIN_GCC `echo -g -O2 -fPIC -fexceptions -DIN_RTS |sed -e 's/-pedantic//g' -e 's/-Wtraditional//g'` -I. -I.. -I../.. -I/root/build/gcc-3.3.3/gcc/ada -I/root/build/gcc-3.3.3/gcc/ada/.. -I/root/build/gcc-3.3.3/gcc/ada/../config -I/root/build/gcc-3.3.3/gcc/ada/../../include -I./../.. tracebak.c
cd ../..
make gnatlib
cd ..
make check

# Install the compiler (Run weird 'make install' bug stuff 1st)
mkdir libf2c
ln -s ../install-sh
make install

# Clean up
rm -rf * /root/build/gnatgcc3-32bit 
export PATH=$ORIGPATH
unset ORIGPATH
unset CONFIG_SHELL


More information about the Gcc-bugs mailing list