Building LLVM 2.7 on OpenSolaris

The build process fails to link the LLVM tools. Specifically, the first tool to build is 'opt' which results in 700+ undefined symbols.

I looked into the Makefiles and found that the "LINK_COMPONENTS" make variable does not get the correct set of libraries. In fact, at the top level Makefile.rules, the variable is set to "support system", however, these do not seem to make it to the 'opt' make context.

The list of libraries for 'opt' is (from the g++ link command):

... -lLLVMipo -lLLVMScalarOpts -lLLVMInstrumentation -lLLVMAsmParser -lLLVMBitWriter -lLLVMBitReader ...

It is missing at a minimum LLVMCore, which when added reduces the unresolved externals to 400+.

Guidance about how to deal with the link process would be great.

[Background]

$ uname -a
SunOS A64009 5.11 snv_111b i86pc i386 i86pc

  GCC-4.4.4, GMP-4.3.2, MPFR-2.4.2
$ gcc -v
Using built-in specs.
Target: i386-pc-solaris2.11
Configured with: ../gcc-4.4.4/configure --prefix=/opt/common/app/gcc/current --with-mpfr=/opt/common/app/gcc/current --with-gmp=/opt/common/app/gcc/current --enable-languages=c,c++ --enable-shared --enable-threads
Thread model: posix
gcc version 4.4.4 (GCC)

LLVM 2.7 [Release]:
../llvm-2.7/configure --with-built-clang --prefix=/opt/common/app/gcc/current --enable-targets=host,x86_64

It should work, however, none of us that I know of have access to solaris.

At minimum you should file a bug (llvm.org/bugs) with your configure and
make output.

I'm also curious why you chose those configure options (not --prefix, the
others).

-eric

I'm interested in using LLVM for compiling to x86_64 native code (ELF64), so I selected 'x86_64' as the architecture. I added 'host' just-in-case...

The '--with-built-clang' selection is for building the Clang LLVM C compiler instead of using a gcc front end. I placed the Clang distribution in './tools/clang'.

I'm interested in using LLVM for compiling to x86_64 native code (ELF64), so I selected 'x86_64' as the architecture. I added 'host' just-in-case...

You shouldn't need to do either of them.

The '--with-built-clang' selection is for building the Clang LLVM C compiler instead of using a gcc front end. I placed the Clang distribution in './tools/clang'.

You checked out clang into that directory or did something else?

-eric

I obtained the release as 'clang-2.7.tgz' from the official download site. I think the README says to move the compiler to the './tools/clang' directory.

I'll remove '--enable-targets=host,x86_64' from configure and attempt a fresh build.

OK. If something fails please file a PR with the information I asked for.

-eric

I've sent a bug report with the relevant info (maybe a bit more than that).

Note that altering the configure invocation to the bare minimum (--prefix only) led to the same link failure.

Number?

-eric

Bug 7762.