David Lobron via llvm-dev
2015-Sep-29 15:43 UTC
[llvm-dev] Building clang in llvm-3.7 on Linux with RT support enabled
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>
Alex Wang via llvm-dev
2015-Sep-29 16:45 UTC
[llvm-dev] Building clang in llvm-3.7 on Linux with RT support enabled
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
Chris Bieneman via llvm-dev
2015-Sep-29 16:55 UTC
[llvm-dev] Building clang in llvm-3.7 on Linux with RT support enabled
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
Apparently Analagous Threads
- Building clang in llvm-3.7 on Linux with RT support enabled
- Building llvm so it can be installed by other users
- Building clang in llvm-3.7 on Linux with RT support enabled
- Building clang in llvm-3.7 on Linux with RT support enabled
- objc object file generated for gnustep runtime for ELF target is too big