LLVM on Solaris/Intel?

Is LLVM supported on Solaris 10/Intel? I tried building the 2.7 pre-release
today but it failed to build (tried gcc 4.2 and 4.4). It fails trying to
link in one of the directories. Here's a small part of the make output (it's
huge):

    http://pastebin.com/ZeZQgKqz

I didn't see Solaris/Intel listed as a supported platform and I haven't ever
tried to debug LLVM build problems before, so I thought I would first post a
quick query before getting in over my head. If you expect LLVM to build in
this environment let me know how my might approach the problem.

Skip Montanaro

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.

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.

Skip

I am using 2.7 (back through 2.5) on Solaris10/x64. There is an autoconf bug in gcc prior to 4.4.0 (iirc) that will cause linking to fail, 4.4.2 or 4.4.3 have both worked fine though.

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

Hi Skip,

Is LLVM supported on Solaris 10/Intel?

I think Evo Callaghan may have gotten it working - try searching the archives.

Ciao,

Duncan.

Hi Skip,

   You currently need to configure with NM=/usr/sfw/bin/gnm, ie
       ./configure --enable-optimized NM=/usr/sfw/bin/gnm
   as GenLibDeps.pl doesn't parse Sun nm output in llvm 2.6 and later.

Cheers,
Nathan

Nathan Keynes <Nathan.Keynes <at> Sun.COM> writes:

   You currently need to configure with NM=/usr/sfw/bin/gnm...

Thanks, giving that a try now. I wonder if configure should check
for compatible nm output?

Skip