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

Chris Bieneman via llvm-dev llvm-dev at lists.llvm.org
Tue Sep 29 09:55:38 PDT 2015


Building the BlocksRuntime isn’t supported via CMake at the moment. It should be pretty straightforward to make it work, but it currently isn’t supported.

-Chris

> On Sep 29, 2015, at 9:45 AM, Alex Wang via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> As far as I know the makefile in there isn't the makefile that gets executed during the cmake build -- cmake generates its own build files from CMakeLists.txt and runs those instead. Having the compiler-rt source in projects/compiler-rt should be enough to have its functionality built into clang when building with cmake.
> 
> -Alex
> 
>> On Sep 29, 2015, at 11:43 AM, David Lobron via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>> 
>> 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
>> 
>> _______________________________________________
>> LLVM Developers mailing list
>> llvm-dev at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> 
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev



More information about the llvm-dev mailing list