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
Chris Bieneman via llvm-dev
2015-Sep-29 17:14 UTC
[llvm-dev] Building clang in llvm-3.7 on Linux with RT support enabled
I dug a little deeper into the history here. It looks like the blocks runtime hasn’t built in the CMake build system in a long time, and I don’t think it has ever been supported in the autoconf system. Support for building it with CMake was removed in April 2012 along with the old CMake build system (r154059) because it was broken. The old CMake support could probably be used as a base for bringing it back, but I would caution that you’re wading into seriously uncharted territory. -Chris> On Sep 29, 2015, at 9:55 AM, Chris Bieneman via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > 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 > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
David Lobron via llvm-dev
2015-Sep-29 18:24 UTC
[llvm-dev] Building clang in llvm-3.7 on Linux with RT support enabled
Hi Chris and Alex, Many thanks for these replies.> I dug a little deeper into the history here. It looks like the blocks runtime hasn’t built in the CMake build system in a long time, and I don’t think it has ever been supported in the autoconf system. > > Support for building it with CMake was removed in April 2012 along with the old CMake build system (r154059) because it was broken. The old CMake support could probably be used as a base for bringing it back, but I would caution that you’re wading into seriously uncharted territory.Is there an alternative build method I could use in order to create the blocks runtime on Linux? The docs seemed to recommend cmake ('cmake -G "Unix Makefiles" ../llvm'), but I'd be more than glad to try another way. I think blocks are required for GNUstep, since it's an Objective-C runtime. Thanks, 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/5d1a3294/attachment.bin>
Maybe Matching Threads
- Building clang in llvm-3.7 on Linux with RT support enabled
- Building clang in llvm-3.7 on Linux with RT support enabled
- Building clang in llvm-3.7 on Linux with RT support enabled
- Building llvm so it can be installed by other users
- Building llvm so it can be installed by other users