[LLVMdev] LLVM Build Difficulties

Curtis Jones curtis.jones at gmail.com
Tue Sep 22 08:53:41 PDT 2009


On Sep 22, 2009, at 05.11.48, Duncan Sands wrote:

> Hi Curtis,
>
>> I hope this is the right list for such questions.... I've been  
>> trying to get LLVM compiled under Linux (Ubuntu 9.04, 64 bit) for  
>> the last couple of days.
>
> I can't reproduce this with ubuntu 9.10, 64 bit x86, gcc 4.4.1, using
> your configure options.  What version of gcc are you using?
>
>>    CXXFLAGS="-fPIC" ./configure --enable-optimized --enable- 
>> assertions --disable-multilib
>
> Not sure why you are passing -fPIC like this?  Anyway, on my system it
> didn't hurt: everything built fine anyway.


Duncan,

Thanks for the reply. As is usually the case, I managed to figure out  
that problem shortly after sending the email. I finally stumbled  
across directions that used "cmake" instead of the usual configure/ 
make, and it worked perfectly. However, I'm stuck again.

I've got llvm/clang built as well as llvm-gcc, and PATH is set up such  
that they're both "visible"; and I can only imagine that I've done  
something really bad. llvm is in the path that contains "Build/llvm- 
objcts" while llvm-gcc is in "Install/llvm-gcc-4.4.2". Maybe there's  
some "-L" that I need to specify?

I've written a very small main.c that uses blocks, and when I try to  
compile/link it, I get:

$ clang -fblocks -v -o a.out main.c
clang version 1.1 (http://llvm.org/svn/llvm-project/cfe/trunk )
Target: x86_64-unknown-linux-gnu
Thread model: posix
  "/home/cjones/Desktop/Build/llvm-objects/bin/clang-cc" -triple  
x86_64-unknown-linux-gnu -S -disable-free -main-file-name main.c -- 
relocation-model static --disable-fp-elim --unwind-tables=1 -- 
mcpu=x86-64 --fmath-errno=1 -v -fblocks -fdiagnostics-show-option -o / 
tmp/cc.s -x c main.c
clang-cc version 1.1 based upon llvm 2.7svn hosted on x86_64-unknown- 
linux-gnu
ignoring nonexistent directory "/System/Library/Frameworks"
ignoring nonexistent directory "/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
  /home/cjones/Desktop/Build/llvm-objects/lib/clang/1.1/include
  /usr/local/include
  /usr/include
End of search list.
  "/home/cjones/Desktop/Install/llvm-gcc-4.2/bin/gcc" -fblocks -v -c - 
m64 -o /tmp/cc.o -x assembler /tmp/cc.s
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../llvm-gcc-4.2/configure --prefix=/home/cjones/ 
Desktop/Install/llvm-gcc-4.2 --with-gmp=/home/cjones/Desktop/Install -- 
with-mpfr=/home/cjones/Desktop/Install --enable-languages=c,c++ -- 
disable-multilib --disable-bootstrap
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5653)
  as --traditional-format -V -Qy --64 -o /tmp/cc.o /tmp/cc.s
GNU assembler version 2.19.1 (x86_64-linux-gnu) using BFD version (GNU  
Binutils for Ubuntu) 2.19.1
  "/home/cjones/Desktop/Install/llvm-gcc-4.2/bin/gcc" -fblocks -v -m64  
-o a.out /tmp/cc.o
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../llvm-gcc-4.2/configure --prefix=/home/cjones/ 
Desktop/Install/llvm-gcc-4.2 --with-gmp=/home/cjones/Desktop/Install -- 
with-mpfr=/home/cjones/Desktop/Install --enable-languages=c,c++ -- 
disable-multilib --disable-bootstrap
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5653)
  /home/cjones/Desktop/Install/llvm-gcc-4.2/libexec/gcc/x86_64-unknown- 
linux-gnu/4.2.1/collect2 --eh-frame-hdr -m elf_x86_64 -dynamic-linker / 
lib64/ld-linux-x86-64.so.2 -o a.out /usr/lib/../lib64/crt1.o /usr/ 
lib/../lib64/crti.o /home/cjones/Desktop/Install/llvm-gcc-4.2/lib/gcc/ 
x86_64-unknown-linux-gnu/4.2.1/crtbegin.o -L/home/cjones/Desktop/ 
Install/llvm-gcc-4.2/lib/gcc/x86_64-unknown-linux-gnu/4.2.1 -L/home/ 
cjones/Desktop/Install/llvm-gcc-4.2/lib/gcc/x86_64-unknown-linux-gnu/ 
4.2.1/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/home/ 
cjones/Desktop/Install/llvm-gcc-4.2/lib/gcc/x86_64-unknown-linux-gnu/ 
4.2.1/../../.. /tmp/cc.o -lgcc --as-needed -lgcc_s --no-as-needed -lc - 
lgcc --as-needed -lgcc_s --no-as-needed /home/cjones/Desktop/Install/ 
llvm-gcc-4.2/lib/gcc/x86_64-unknown-linux-gnu/4.2.1/crtend.o /usr/ 
lib/../lib64/crtn.o
/tmp/cc.o:(.rodata+0x0): undefined reference to `_NSConcreteGlobalBlock'
collect2: ld returned 1 exit status
clang: error: linker command failed with exit code 1 (use -v to see  
invocation)

Again, any help would be appreciated.

Thanks.

--
Curtis Jones
curtisjones.us
404.723.3728



-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2427 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090922/77a2feb5/attachment.bin>


More information about the llvm-dev mailing list