Building gcc 4.2 failed

Hi there.

Building gcc 4.2 on Solaris 10 on x86 failed:

=> ./configure --prefix=/rwthfs/rz/SW/UTIL.common/gcc/4.2/i86pc-pc-solaris2.10 --with-gmp=/rwthfs/rz/SW/UTIL.common/gcc/gmp/i86pc-pc-solaris2.10 --with-mpfr=/rwthfs/rz/SW/UTIL.common/gcc/mpfr/i86pc-pc-solaris2.10 --enable-language

s=c,c++,fortran

=> gmake

[...]

/rwthfs/rz/cluster/work/ct747764/gcc-4.2.0/host-i386-pc-solaris2.10/gcc/xgcc -B/rwthfs/rz/cluster/work/ct747764/gcc-4.2.0/host-i386-pc-solaris2.10/gcc/ -B/rwthfs/rz/SW/UTIL.common/gcc/4.2/i86pc-pc-solaris2.10/i386-pc-solaris2.10/bi n/ -B/rwthfs/rz/SW/UTIL.common/gcc/4.2/i86pc-pc-solaris2.10/i386-pc-solaris2.10/li b/ -isystem /rwthfs/rz/SW/UTIL.common/gcc/4.2/i86pc-pc-solaris2.10/i386-pc-solaris2.10/incl ude -isystem /rwthfs/rz/SW/UTIL.common/gcc/4.2/i86pc-pc-solaris2.10/i386-pc-solaris2.10/sys- include -O2 -O2 -g -DIN_GCC-W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -I. -I. -I../.././gcc -I../.././gcc/. -I../.././gcc/../include -I./../intl -I../.././gcc/../libcpp/include -I/rwthfs/rz/SW/UTIL.common/gcc/gmp/i86pc-pc-solaris2.10/include -I/rwthfs/rz/SW/UTIL.common/gcc/mpfr/i86pc-pc-solaris2.10/include -I../.././gcc/../libdecnumber -I../libdecnumber -m64 -fexceptions -c ../.././gcc/unwind-dw2.c -o libgcc/amd64/unwind-dw2.o

In file included from ./gthr-default.h:1,

from ../.././gcc/gthr.h:114,

from ../.././gcc/unwind-dw2.c:42:

../.././gcc/gthr-posix.h: In function '__gthread_active_p':

../.././gcc/gthr-posix.h:167: warning: missing braces around initializer

../.././gcc/gthr-posix.h:167: warning: (near initialization for '__gthread_active_once.__pthread_once_pad')

../.././gcc/unwind-dw2.c: In function 'uw_init_context_1':

../.././gcc/unwind-dw2.c:1417: warning: missing braces around initializer

../.././gcc/unwind-dw2.c:1417: warning: (near initialization for 'once_regsizes.__pthread_once_pad')

Assembler: unwind-dw2.c

"/tmp/ct747764/28859@sunoc63/cccuzz5d.s", line 396 : Warning: Illegal subtraction - symbols from different sections: ".L63", ".L73"

[...]

"/tmp/ct747764/28859@sunoc63/cccuzz5d.s", line 6366 : Warning: Illegal subtraction - symbols from different sections: ".LFB69", ".DOT-65"

"/tmp/ct747764/28859@sunoc63/cccuzz5d.s", line 391 : Illegal subtraction - symbols from different sections: ".L72", ".L73"

gmake[4]: *** [libgcc/amd64/unwind-dw2.o] Error 1

gmake[4]: Leaving directory `/rwthfs/rz/cluster/work/ct747764/gcc-4.2.0/host-i386-pc-solaris2.10/gcc'

gmake[3]: *** [stmp-multilib] Error 2

gmake[3]: Leaving directory `/rwthfs/rz/cluster/work/ct747764/gcc-4.2.0/host-i386-pc-solaris2.10/gcc'

gmake[2]: *** [all-stage1-gcc] Error 2

gmake[2]: Leaving directory `/rwthfs/rz/cluster/work/ct747764/gcc-4.2.0'

gmake[1]: *** [stage1-bubble] Error 2

gmake[1]: Leaving directory `/rwthfs/rz/cluster/work/ct747764/gcc-4.2.0'

gmake: *** [all] Error 2

=> uname -a

SunOS sunoc63.rz.RWTH-Aachen.DE 5.10 Generic_118855-36 i86pc i386 i86pc

Has anybody been successfull building gcc 4.2 on Solaris 10 x86 and a solution for this issue?

Thank you in advance,

Christian

[3366 byte] By [cterbovena] at [2007-11-27 7:39:40]
# 1

I found the solution myself and will shortly summarize it here to complete the thread.

(1) Use GNU as and non-GNU ld, so add "--with-gnu-as --with-as=/usr/sfw/bin/gas --without-gnu-ld --with-ld=/usr/ccs/bin/ld" to the configure command line. After I worked this out I found it noted on the build instruction website, RTFM proved to be useful again. :-)

(2) At some point the compilation aborted because directory stage3-gcc could not be found, so I had to do "ln -s stage3-i386-pc-solaris2.10 stage3-gcc". Maybe this can be avoided with some other configure options, but this workaround was fine for me.

(3) In order to use my own versions of gmp and mpfr, I had to add their library directory to the LD_LIBRARY_PATH environment variable (--with-gmp= and --with-mpfr= are not sufficient).

Kind regards,

Christian

cterbovena at 2007-7-12 19:20:22 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...