[LLVMdev] LLVM on Solaris/Intel?

Jeffrey Yasskin jyasskin at google.com
Sun Mar 21 22:48:55 PDT 2010


On Sun, Mar 21, 2010 at 5:38 AM, Skip Montanaro <skip at pobox.com> wrote:
>> I don't know anything about Solaris, but your paste doesn't actually
>> contain any errors, just warnings (unless I'm reading "ld: warning:
>> relocation error:" wrong). It might help to run make without -j until
>> it fails, and then use `make VERBOSE=1` to print the exact commands
>> it's running.
>
> Sorry.  There was so much output I wasn't sure how much to paste and
> didn't know about VERBOSE=1.  I captured the verbose output in a
> typescript file:
>
>    http://www.smontanaro.net/typescript
>
> Lots of undefined symbols.

Yeah. Your link line for opt is:

g++ -I/home/udesktop116/skipm/src/llvm-2.7/include
-I/home/udesktop116/skipm/src/llvm-2.7/tools/opt  -DNDEBUG -include
llvm/System/Solaris.h -D_GNU_SOURCE -D__STDC_LIMIT_MACROS
-D__STDC_CONSTANT_MACROS -O2 -fomit-frame-pointer -g -fno-exceptions
-fno-rtti -fPIC -Woverloaded-virtual -fno-rtti    -pedantic
-Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings  -O2 -g
-Wl,-R -Wl,'$ORIGIN/../lib' -Wl,-R
-Wl,/home/udesktop116/skipm/src/llvm-2.7/Release+Debug-Asserts/bin
-L/home/udesktop116/skipm/src/llvm-2.7/Release+Debug-Asserts/lib
-L/home/udesktop116/skipm/src/llvm-2.7/Release+Debug-Asserts/lib  -o
/home/udesktop116/skipm/src/llvm-2.7/Release+Debug-Asserts/bin/opt
/home/udesktop116/skipm/src/llvm-2.7/tools/opt/Release+Debug-Asserts/AnalysisWrappers.o
/home/udesktop116/skipm/src/llvm-2.7/tools/opt/Release+Debug-Asserts/GraphPrinters.o
/home/udesktop116/skipm/src/llvm-2.7/tools/opt/Release+Debug-Asserts/PrintSCC.o
/home/udesktop116/skipm/src/llvm-2.7/tools/opt/Release+Debug-Asserts/opt.o
 \
-lLLVMipo -lLLVMScalarOpts -lLLVMInstrumentation -lLLVMAsmParser
-lLLVMBitWriter -lLLVMBitReader   -lpthread -lmalloc -lm


While on my system it's


g++ -I/Users/jyasskin/src/llvm/trunk/obj/include
-I/Users/jyasskin/src/llvm/trunk/obj/tools/opt
-I/Users/jyasskin/src/llvm/trunk/src/include
-I/Users/jyasskin/src/llvm/trunk/src/tools/opt  -D_DEBUG -D_GNU_SOURCE
-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -g -fno-exceptions
-fno-rtti -fno-common -Woverloaded-virtual -fno-rtti  -m32  -pedantic
-Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings  -g
-L/Users/jyasskin/src/llvm/trunk/obj/Debug/lib
-L/Users/jyasskin/src/llvm/trunk/obj/Debug/lib  -o
/Users/jyasskin/src/llvm/trunk/obj/Debug/bin/opt
/Users/jyasskin/src/llvm/trunk/obj/tools/opt/Debug/AnalysisWrappers.o
/Users/jyasskin/src/llvm/trunk/obj/tools/opt/Debug/GraphPrinters.o
/Users/jyasskin/src/llvm/trunk/obj/tools/opt/Debug/PrintSCC.o
/Users/jyasskin/src/llvm/trunk/obj/tools/opt/Debug/opt.o  \
	-lLLVMipo -lLLVMScalarOpts -lLLVMInstCombine -lLLVMInstrumentation
-lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMMC
-lLLVMAsmParser -lLLVMBitWriter -lLLVMBitReader -lLLVMCore
-lLLVMSupport -lLLVMSystem   -lpthread -lm


Note that you're missing things like -lLLVMCore, -lLLVMSupport, etc.
That's probably happening because llvm-config is confused, which makes
some sense on a new OS because llvm-config's build process uses `nm`
to figure out dependencies, and it'd be very easy to mis-parse nm's
output on an untested system.

To confirm that, you can run:

  $ Release+Debug-Asserts/bin/llvm-config --libs bitreader bitwriter
asmparser instrumentation scalaropts ipo

which on my system returns:

  -lLLVMipo -lLLVMScalarOpts -lLLVMInstCombine -lLLVMInstrumentation
-lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMMC
-lLLVMAsmParser -lLLVMBitWriter -lLLVMBitReader -lLLVMCore
-lLLVMSupport -lLLVMSystem

If you want to dig into this, the relevant nm command is in
utils/GenLibDeps.pl under $nmPath (yeah, ew, perl). If not, I'm hoping
to get time to make the dependencies explicit before llvm-2.8, and
only use nm to check them for correctness.

Jeffrey




More information about the llvm-dev mailing list