<div dir="ltr"><div>Hi,</div><div>I am trying to compile clang on sunos 5.10 with gcc 4.5.1<br>I configure with </div><p>CC=gcc CXX=g++ LDFLAGS=" -lrt" ../configure --prefix=/project/scratch/packages2 --enable-optimized</p>
<p>the configuration runs fine and then I start make which stops with the error:</p><p>make[2]: Entering directory `/project/scratch/tmp/llvm-3.2.src/build/tools/opt'<br>llvm[2]: Linking Release+Asserts executable opt (without symbols)<br>
g++ -I/project/scratch/tmp/llvm-3.2.src/build/include -I/project/scratch/tmp/llvm-3.2.src/build/tools/opt -I/project/scratch/tmp/llvm-3.2.src/include -I/project/scratch/tmp/llvm-3.2.src/tools/opt  -D_DEBUG -include llvm/Support/Solaris.h -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -O3 -fomit-frame-pointer -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -fPIC -Woverloaded-virtual -Wcast-qual  -O3 -Wl,-R -Wl,'$ORIGIN/../lib' -Wl,-R -Wl,/project/scratch/tmp/llvm-3.2.src/build/Release+Asserts/bin  -L/project/scratch/tmp/llvm-3.2.src/build/Release+Asserts/lib -L/project/scratch/tmp/llvm-3.2.src/build/Release+Asserts/lib -lrt   -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings    -o /project/scratch/tmp/llvm-3.2.src/build/Release+Asserts/bin/opt  /project/scratch/tmp/llvm-3.2.src/build/tools/opt/Release+Asserts/AnalysisWrappers.o /project/scratch/tmp/llvm-3.2.src/build/tools/opt/Release+Asserts/GraphPrinters.o /project/scratch/tmp/llvm-3.2.src/build/tools/opt/Release+Asserts/PrintSCC.o /project/scratch/tmp/llvm-3.2.src/build/tools/opt/Release+Asserts/opt.o  \<br>
-lLLVMHexagonCodeGen -lLLVMHexagonDesc -lLLVMHexagonAsmPrinter -lLLVMHexagonInfo -lLLVMNVPTXCodeGen -lLLVMNVPTXDesc -lLLVMNVPTXInfo -lLLVMNVPTXAsmPrinter -lLLVMMBlazeCodeGen -lLLVMMBlazeAsmParser -lLLVMMBlazeDisassembler -lLLVMMBlazeDesc -lLLVMMBlazeAsmPrinter -lLLVMMBlazeInfo -lLLVMCppBackendCodeGen -lLLVMCppBackendInfo -lLLVMMSP430CodeGen -lLLVMMSP430Desc -lLLVMMSP430AsmPrinter -lLLVMMSP430Info -lLLVMXCoreCodeGen -lLLVMXCoreDesc -lLLVMXCoreInfo -lLLVMCellSPUCodeGen -lLLVMCellSPUDesc -lLLVMCellSPUInfo -lLLVMMipsAsmParser -lLLVMMipsDisassembler -lLLVMMipsCodeGen -lLLVMMipsDesc -lLLVMMipsAsmPrinter -lLLVMMipsInfo -lLLVMARMAsmParser -lLLVMARMDisassembler -lLLVMARMCodeGen -lLLVMARMDesc -lLLVMARMInfo -lLLVMARMAsmPrinter -lLLVMPowerPCCodeGen -lLLVMPowerPCDesc -lLLVMPowerPCInfo -lLLVMPowerPCAsmPrinter -lLLVMSparcCodeGen -lLLVMSparcDesc -lLLVMSparcInfo -lLLVMX86AsmParser -lLLVMX86Disassembler -lLLVMX86CodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMMCParser -lLLVMCodeGen -lLLVMX86Desc -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMipo -lLLVMVectorize -lLLVMScalarOpts -lLLVMInstCombine -lLLVMInstrumentation -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMMC -lLLVMObject -lLLVMAsmParser -lLLVMBitWriter -lLLVMBitReader -lLLVMCore -lLLVMSupport   -lpthread -lmalloc -lm<br>
ld: elf error: file /project/scratch/tmp/llvm-3.2.src/build/Release+Asserts/lib/libLLVMNVPTXAsmPrinter.a: elf_getarsym<br>ld: elf error: file /project/scratch/tmp/llvm-3.2.src/build/Release+Asserts/lib/libLLVMNVPTXAsmPrinter.a: elf_getarsym<br>
ld: fatal: File processing errors. No output written to /project/scratch/tmp/llvm-3.2.src/build/Release+Asserts/bin/opt<br>collect2: ld returned 1 exit status<br>make[2]: *** [/project/scratch/tmp/llvm-3.2.src/build/Release+Asserts/bin/opt] Error 1<br>
make[2]: Leaving directory `/project/scratch/tmp/llvm-3.2.src/build/tools/opt'<br>make[1]: *** [opt/.makeall] Error 2<br>make[1]: Leaving directory `/project/scratch/tmp/llvm-3.2.src/build/tools'<br>make: *** [all] Error 1</p>
<p>then I created a dummy.c file:</p><p>int dummy(void)<br>{<br>  return 0;<br>}</p><p>and used gcc -c dummy.c. After that I used the command</p><p>ar cr /project/scratch/tmp/llvm-3.2.src/build/Release+Asserts/lib/libLLVMNVPTXAsmPrinter.a NVPTXInstPrinter.o dummy.o</p>
<p>then I can finish the compilation but when trying to install I get the error:</p><p>if test -d "/project/scratch/tmp/llvm-3.2.src/tools/clang/include/clang-c" ; then \<br>  cd /project/scratch/tmp/llvm-3.2.src/tools/clang/include/clang-c/.. && \<br>
  for  hdr in `find clang-c -type f '!' '(' -name '*~' \<br>      -o -name '.#*' -o -name '*.in' -o -name '*.txt' \<br>      -o -name 'Makefile' -o -name '*.td' ')' -print \<br>
              | grep -v CVS | grep -v .svn | grep -v .dir` ; do \<br>    instdir=`dirname "/project/scratch/packages2/include/$hdr"` ; \<br>    if test \! -d "$instdir" ; then \<br>      echo llvm[4]: Making install directory $instdir ; \<br>
      /project/scratch/tmp/llvm-3.2.src/autoconf/mkinstalldirs $instdir ;\<br>    fi ; \<br>    /project/aircrews/packages/sun/5.10/x86/gnu/bin/install -c -m 0644 $hdr /project/scratch/packages2/include/$hdr ; \<br>  done ; \<br>
fi<br>if test -d "/project/scratch/tmp/llvm-3.2.src/build/tools/clang/include/clang-c" ; then \<br>  cd /project/scratch/tmp/llvm-3.2.src/build/tools/clang/include && \<br>  for hdr in `find clang-c -type f '!' '(' -name 'Makefile' ')' -print \<br>
            | grep -v CVS | grep -v .tmp | grep -v .dir` ; do \<br>    instdir=`dirname "/project/scratch/packages2/include/$hdr"` ; \<br>    if test \! -d "$instdir" ; then \<br>      echo llvm[4]: Making install directory $instdir ; \<br>
      /project/scratch/tmp/llvm-3.2.src/autoconf/mkinstalldirs $instdir ;\<br>    fi ; \<br>    /project/aircrews/packages/sun/5.10/x86/gnu/bin/install -c -m 0644 $hdr /project/scratch/packages2/include/$hdr ; \<br>  done ; \<br>
fi<br>make[4]: *** [install-local] Error 1<br>make[4]: Leaving directory `/project/scratch/tmp/llvm-3.2.src/build/tools/clang/include/clang-c'<br>make[3]: *** [install] Error 1<br>make[3]: Leaving directory `/project/scratch/tmp/llvm-3.2.src/build/tools/clang/include'<br>
make[2]: *** [install] Error 1<br>make[2]: Leaving directory `/project/scratch/tmp/llvm-3.2.src/build/tools/clang'<br>make[1]: *** [clang/.makeinstall] Error 2<br>make[1]: Leaving directory `/project/scratch/tmp/llvm-3.2.src/build/tools'<br>
make: *** [install] Error 1</p><p>the binaries get copied to the install location but trying to run clang on simple hello world x.c gives:<br> clang x.c<br>/project/scratch/packages2/bin/ld: unrecognized option '-C'<br>
/project/scratch/packages2/bin/ld: use the --help option for usage information<br>clang: error: linker command failed with exit code 1 (use -v to see invocation)</p><p>with -v gives</p><p>clang -v x.c<br>clang version 3.2 (tags/RELEASE_32/final)<br>
Target: i386-pc-solaris2.10<br>Thread model: posix<br> "/project/scratch/packages2/bin/clang" -cc1 -triple i386-pc-solaris2.10 -emit-obj -mrelax-all -disable-free -main-file-name x.c -mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -target-cpu pentium4 -target-linker-version 2.22 -momit-leaf-frame-pointer -v -resource-dir /project/scratch/packages2/bin/../lib/clang/3.2 -fmodule-cache-path /var/tmp/clang-module-cache -fdebug-compilation-dir /project/scratch/tmp/llvm-3.2.src/build -ferror-limit 19 -fmessage-length 141 -mstackrealign -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/x-DFaGiy.o -x c x.c<br>
clang -cc1 version 3.2 based upon LLVM 3.2svn default target i386-pc-solaris2.10<br>ignoring nonexistent directory "/usr/local/include"<br>#include "..." search starts here:<br>#include <...> search starts here:<br>
 /project/scratch/packages2/bin/../lib/clang/3.2/include<br> /usr/include<br>End of search list.<br> "/project/scratch/packages2/bin/ld" -C -e _start -Bdynamic --dynamic-linker /usr/lib/ld.so.1 -o a.out /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/values-Xa.o /usr/gcc/4.5/lib/gcc/i386-pc-solaris2.10/4.5.2/crtbegin.o -L/usr/gcc/4.5/lib/gcc/i386-pc-solaris2.10/4.5.2/ /tmp/x-DFaGiy.o -lgcc_s -lgcc -lc -lm /usr/gcc/4.5/lib/gcc/i386-pc-solaris2.10/4.5.2/crtend.o /usr/lib/crtn.o<br>
/project/scratch/packages2/bin/ld: unrecognized option '-C'<br>/project/scratch/packages2/bin/ld: use the --help option for usage information<br>clang: error: linker command failed with exit code 1 (use -v to see invocation)</p>
<div>Initially the system had ld 2.22 and I even compiled ld 2.23</div><font><p>ld --version</p><p>GNU ld (GNU Binutils) 2.23</p><div>
but it still complains about the -C option not being recognized.</div><div> </div><div></div></font><div><br>Any idea what I can do to make it work?</div><p>Thanks!<br></p></div>