[llvm-dev] Building clang in llvm-3.7 on Linux with RT support enabled

David Lobron via llvm-dev llvm-dev at lists.llvm.org
Tue Sep 29 08:43:08 PDT 2015


Hi All,

I need to build clang/llvm from source on an Ubuntu Linux system, in order to build the gnustep Objective-C environment.  I was able to build clang using cmake without a problem (following the instructions at clang.llvm.org/get_started.html), but when I tried to build gnustep, I found that clang failed to compile an autoconf-generated program.  The compile error in the configure log was:

configure:14781: checking for _Block_copy
configure:14837: clang -o conftest -m64 -march=opteron -mno-3dnow -ggdb -O2 -Wall  -I/home/dlobron/build/clangport/akamai/common/GNUstep/Local/Library/Headers -I/home/dlobron/build/clangport/akamai/common/GNUstep/Local/Library/Headers -I/home/dlobron/build/clangport/akamai/common/GNUstep/System/Library/Headers  -fgnu-runtime -x objective-c -m64  -L/home/dlobron/build/clangport/akamai/common/GNUstep/Local/Library/Libraries -L/home/dlobron/build/clangport/akamai/common/GNUstep/Local/Library/Libraries -L/home/dlobron/build/clangport/akamai/common/GNUstep/System/Library/Libraries conftest.c -lrt -ldl  -lpthread -rdynamic -m64 -fgnu-runtime -L/home/dlobron/GNUstep/Library/Libraries -L/home/dlobron/build/clangport/akamai/common/GNUstep/Local/Library/Libraries -L/home/dlobron/build/clangport/akamai/common/GNUstep/System/Library/Libraries -lobjc -lm     >&5
/tmp/conftest-a47ae0.o: In function `main':
/home/dlobron/build/clangport/akamai/gnustep-base/gnustep-base-1.24.8/conftest.c:140: undefined reference to `_Block_copy'

The line in the auto-generated conftest.c that caused the failure is:

 return _Block_copy ();

I repeated the above command from the command line, and verified that I get the same error.  

I did some searching of docs and comments, and I it sounds like I need the realtime project to be built.  I did download the llvm/projects/compiler-rt source, but the Makefile in llvm/projects filters it out:

# Don't build compiler-rt, it isn't designed to be built directly.
DIRS := $(filter-out compiler-rt,$(DIRS))

The main source dir of llvm has an LLVM_BUILD_EXTERNAL_COMPILER_RT option, but I wasn't sure if I that would put RT support into clang (which I'd like) or rather, irf it would build a separate RT compiler.

Can you guys advise me how to build clang on Linux so that _Block_copy will be useable?

Thank you,

David

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


More information about the llvm-dev mailing list