|
From: | Andreas Fink |
Subject: | Re: building GNUstep from scratch |
Date: | Wed, 22 Aug 2018 10:07:01 +0000 |
I had good success with libojbc/clang under debian9 (stretch). I wouldn't want to go back to gcc due to non support of certain stuff I use every day (the stuff which apple introduced in what they called objc2.0). Part is working in recent gcc's though but I like clangs error reporting and better support for objc. For clang, the debian shipped clang 3.8 was long my standard compiler. With newer versions of clang and latest libobjc2 I've run into an incompatibility with very weird side effects. I had cases where something like this: -(void)somemethod { _intProperty = 123; NSLog(@"%d", _intProperty); was printing out a value of 0 instead of 123, and of course this makes very strange things much later in your code. According to David Chisnall this is fixed in clang after r339128 and was due to how the compiler aligns structs/object properties in memory (compilers tend to optimize this in some way and all compilers used for individual parts have to use the same optimisation to come to the same order which wasn't the case if I understood correctly). this is how I build the latest clang8 from source git clone https://git.llvm.org/git/llvm.git/ cd llvm/tools git clone https://git.llvm.org/git/clang.git/ cd ../projects git clone https://git.llvm.org/git/openmp.git/ git clone https://git.llvm.org/git/libcxx.git/ git clone https://git.llvm.org/git/libcxxabi.git/ git clone https://git.llvm.org/git/test-suite.git/ cmake .. -DCMAKE_BUILD_TYPE=Release make -j8 install This takes quite some time and lots of memory. If you forget -DCMAKE_BUILD_TYPE=Release you end up with 32 gigabytes of RAM not being sufficient (constantly swapping) and compile times of hours to days. On 32bit machines its even worse due to the 4GB memory limit. Then I install gnustep like this: Setting some defaults ------------------------------------------------ export CC=clang export CXX=clang++ export PATH=/usr/local/bin:$PATH export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ Download the sourcecode of gnustep and dependencies --------------------------------------------------- mkdir gnustep cd gnustep git clone https://github.com/gnustep/scripts git clone https://github.com/gnustep/make git clone https://github.com/gnustep/libobjc2 git clone https://github.com/gnustep/base git clone https://github.com/gnustep/corebase git clone https://github.com/gnustep/gui git clone https://github.com/gnustep/back ./scripts/install-dependencies Build dependencies --------------------------------------------------- tar -xvzf libiconv-1.15.tar.gz cd libiconv-1.15 ./configure make CFLAGS=-g make CFLAGS=-g install cd .. cd swift-corelibs-libdispatch mkdir build cd build cmake .. -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS=-g -DCMAKE_C_FLAGS=-g make make install Install gnustep-make --------------------------------------------------- cd make export CC=/usr/bin/clang export CXX=/usr/bin/clang++ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ export OBJCFLAGS="-DEXPOSE_classname_IVARS=1" ./configure --with-layout=fhs \ --disable-importing-config-file \ --enable-native-objc-exceptions \ --enable-objc-arc \ --enable-install-ld-so-conf \ --with-library-combo=ng-gnu-gnu make install source /usr/local/etc/GNUstep/GNUstep.conf cd .. Install libobjc2 runtime --------------------------------------------------- cd libobjc2 mkdir Build cd Build cmake .. -DBUILD_STATIC_LIBOBJC=1 -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS=-g -DCMAKE_C_FLAGS=-g make make install cd .. ldconfig install gnustep-base --------------------------------------------------- cd base ./configure CFLAGS="-DEXPOSE_classname_IVARS=1 -g " --with-config-file=/usr/local/etc/GNUstep/GNUstep.conf --disable-libdispatch make -j8 make install cd ../.. ldconfig (for debug version use "make debug=yes" instead of "make") and then the other gnustep libraries with simple ./configure; make;make install
|
[Prev in Thread] | Current Thread | [Next in Thread] |