Here's an update: When building with gmp/mpc/mpfr sources inside gcc sources, I get this error message: libtool: compile: /opt/csw/gcc3/bin/gcc -DHAVE_CONFIG_H -I. -I../../../gcc-4.6.1/mpc/src -I.. -I/home/maciej/src/gcc-objdir/./gmp -I/home/maciej/src/gcc-4.6.1/mpfr -g -fkeep-inline-functions -MT get_prec.lo -MD -MP -MF .deps/get_prec.Tpo -c ../../../gcc-4.6.1/mpc/src/get_prec.c -o get_prec.o ../../../gcc-4.6.1/mpc/src/get.c: In function `mpc_get_dc': ../../../gcc-4.6.1/mpc/src/get.c:33: error: `_Imaginary_I' undeclared (first use in this function) ../../../gcc-4.6.1/mpc/src/get.c:33: error: (Each undeclared identifier is reported only once ../../../gcc-4.6.1/mpc/src/get.c:33: error: for each function it appears in.) ../../../gcc-4.6.1/mpc/src/get.c: In function `mpc_get_ldc': ../../../gcc-4.6.1/mpc/src/get.c:39: error: `_Imaginary_I' undeclared (first use in this function) gmake[5]: *** [get.lo] Error 1 As a separate effort, I have built gcc again, using the OpenCSW build system, with less options and simplified environment. There's a new problem I ran into. Here's the error message I'm getting from checkpkg: * libgcc_s.so.1 could not be resolved for opt/csw/lib/libstdc++.so.6.0.16, with rpath ('/usr/lib/$ISALIST', '/usr/lib', '/lib/$ISALIST', '/lib'), expanded to ['/usr/lib', '/usr/lib/sparcv8plus+vis', '/usr/lib/sparcv8', '/usr/lib/sparcv8plus', '/usr/lib/sparcv9', '/usr/lib/sparcv8plus+vis2', '/usr/lib/sparcv7', '/usr/lib/sparcv8-fsmuld', '/usr/lib/sparc', '/usr/lib/sparcv9+vis2', '/usr/lib/sparcv9+vis', '/usr/lib', '/lib', '/lib/sparcv8plus+vis', '/lib/sparcv8', '/lib/sparcv8plus', '/lib/sparcv9', '/lib/sparcv8plus+vis2', '/lib/sparcv7', '/lib/sparcv8-fsmuld', '/lib/sparc', '/lib/sparcv9+vis2', '/lib/sparcv9+vis', '/lib'], while the file was available at the following paths: [u'/opt/csw/gcc3/lib', '/opt/csw/lib/sparcv9', '/opt/csw/lib', u'/opt/csw/share/Adobe/Reader8/Reader/sparcsolaris/lib', u'/opt/csw/gcc3/lib/sparcv9']. Looking at the binary: maciej@unstable9s :~/src/opencsw/pkg/gcc4/branches/opt-csw-prefix > /usr/ccs/bin/dump -Lv work/solaris9-sparc/pkgroot/opt/csw/lib/libstdc++.so.6 work/solaris9-sparc/pkgroot/opt/csw/lib/libstdc++.so.6: **** DYNAMIC SECTION INFORMATION **** .dynamic: [INDEX] Tag Value [1] NEEDED libm.so.1 [2] NEEDED libgcc_s.so.1 [3] NEEDED libc.so.1 [4] INIT 0x57b50 [5] FINI 0x57b6c [6] SONAME libstdc++.so.6 [7] HASH 0x94 [8] STRTAB 0x15c54 [9] STRSZ 0x25ad5 [10] SYMTAB 0x7484 [11] SYMENT 0x10 [12] CHECKSUM 0xb012 [13] VERDEF 0x3b79c [14] VERDEFNUM 0x18 [15] VERNEED 0x3b72c [16] VERNEEDNUM 0x3 [17] PLTSZ 0x1fb0 [18] PLTREL 0x7 [19] JMPREL 0x4dee4 [20] RELA 0x3d7e0 [21] RELASZ 0x126b4 [22] RELAENT 0xc [23] FEATURE_1 PARINIT [24] FLAGS 0 [25] FLAGS_1 DISPRELDONE [26] PLTGOT 0xdde20 The library has in fact libgcc_s.so.1 in NEEDED, but does not have RPATH set. What's missing in the linker invocation, is "-R/opt/csw/lib". I've found this text in the configuration docs[1]: --with-boot-ldflags=flags This option may be used to set linker flags to be used when linking stage 2 and later when bootstrapping GCC. If neither –with-boot-libs nor –with-host-libstdcxx is set to a value, then the default is `-static-libstdc++ -static-libgcc'. I've tried setting: --with-boot-ldflags="-R/opt/csw/lib", and recompiling gcc from scratch, but it didn't help. I'll try exporting LDFLAGS with -R/opt/csw/lib. Maciej [1] http://gcc.gnu.org/install/configure.html