What is the canonical way to build on Solaris 10?

Hi,

I am trying to get r114797 to build on Solaris 10u6 (5.10 Generic_142901-03).

gcc 4.2 is installed and configured with:

-bash-3.00$ /opt/gcc4/bin/gcc -v
Using built-in specs.
Target: i386-pc-solaris2.10
Configured with: ./configure --prefix=/opt/gcc4 --with-gnu-as --with-as=/usr/sfw/bin/gas --without-gnu-ld --with-ld=/usr/ccs/bin/ld --enable-shared --enable-languages=c,c++
Thread model: posix
gcc version 4.2.2

llvm/clang is configured with:

CC=/opt/gcc4/bin/gcc CXX=/opt/gcc4/bin/g++ INSTALL=/usr/ucb/install NM=/usr/sfw/bin/gnm ./configure --enable-targets=host

But it ran into the follow compilation error:

gmake -C lto all
gmake[2]: Entering directory /app/user/work-area-leafy/llvm/tools/lto' llvm[2]: Linking Release Shared Library libLTO.so /opt/gcc4/bin/g++ -I/app/user/work-area-leafy/llvm/include -I/app/user/work-area-leafy/llvm/tools/lto -DNDEBUG -include llvm/System/Solaris.h -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O3 -fomit-frame-pointer -fno-exceptions -fno-rtti -fPIC -Woverloaded-virtual -Wcast-qual -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -O3 -Wl,-R -Wl,'$ORIGIN' -L/app/user/work-area-leafy/llvm/Release/lib -L/app/user/work-area-leafy/llvm/Release/lib -shared -o /app/user/work-area-leafy/llvm/Release/lib/libLTO.so /app/user/work-area-leafy/llvm/tools/lto/Release/LTOCodeGenerator.o /app/user/work-area-leafy/llvm/tools/lto/Release/LTOModule.o /app/user/work-area-leafy/llvm/tools/lto/Release/lto.o \ -lLLVMBitWriter -lLLVMLinker -lLLVMArchive -lLLVMBitReader -lLLVMipo -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMMCParser -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMCore -lLLVMX86AsmPrinter -lLLVMMC -lLLVMX86Info -lLLVMSupport -lLLVMSystem -lpthread -lmalloc -lm ld: fatal: relocation error: R_386_GOTOFF: file /app/user/work-area-leafy/llvm/Release/lib/libLLVMX86CodeGen.a(X86AsmPrinter.o): symbol llvm::RegisterAsmPrinter<llvm::X86AsmPrinter>::Allocator(llvm::TargetMachine&, llvm::MCStreamer&): relocation must bind locally collect2: ld returned 1 exit status gmake[2]: *** [/app/user/work-area-leafy/llvm/Release/lib/libLTO.so] Error 1 gmake[2]: Leaving directory /app/user/work-area-leafy/llvm/tools/lto’
gmake[1]: *** [lto/.makeall] Error 2
gmake[1]: Leaving directory `/app/user/work-area-leafy/llvm/tools’
gmake: *** [all] Error 1

Am I missing something here?

-CW