clang is surprisingly fast if built with LLVM link-time optimisation - even 
faster than GCC, from my experience. So I am setting up a new server with this 
LTO’d clang. But then I get a SIGSEGV when testing libobjc2 built with this 
augment clang. Can anyone test and tell me the reason why?

Build method, starting from a vanilla Ubuntu 13.04 Server:

$ apt-get install build-essential bunutils-gold binutils-dev libffi-dev 
libedit-dev swig libpython-dev libxml2-dev libxslt1-dev libxml2-utils # Install 
libraries for LLVM/clang
$ clang co ... # Check out LLVM, clang, LLDB, Compiler-RT, clang-tools-extra 
and livcxx, version 3.3 Release
$ mkdir -p {llvm,libcxx}-3.3/build
$ cd llvm-3.3/build
$ CC=gcc CXX=g++ ccmake .. # Build clang for the first pass, using GCC, with 
LLVMgold building but without LLDB.
$ make -j8 -k
$ sudo make install
$ cd ../../libcxx-3.3/build
$ CC=clang CXX=clang++ ccmake .. # Build libc++ using this intermediate clang 
Bootstrapping clang requires libc++
$ make -j8 -k
$ sudo make install
$ cd ../../llvm-3.3/build
$ rm -r ./* # Clean the build directory to yield for the second pass.
$ CC=clang CXX=clang++ ccmake .. # Build clang again, with optimisation "-Ofast 
-flto” (I am turning speed optimisation to the nines),
$ # CXXFLAGS=“-std=gnu++11 -stdlib=libc++” LDFLAGS="-stdlib=libc++”, enabling 
all modules including LLDB.
$ # From my experiences, this optimisation yields a binary runs even faster 
than GCC.
$ make -j8 -k # On linux, it may complain for missing symbols in archives, 
since Linux ld (even gold) does not recognise LLVM bit code.
$ ranlib —plugin LLVMgold lib/*.a # This will make it build a little bit more.
$ make -j8 -k
$ # ... It will repeat for a couple times.
$ sudo make install # It will overwrite the preliminary clang.
$ export CC=clang CXX=clang++
$ cd ../../gnustep/core/make
$ ./configure ...
$ make
$ sudo make install # Seems okay.
$ cd ../../dev-libs/libobjc2
$ mkdir build
$ cd build
$ ccmake .. # I need libobjc works with my C++ runtime. And just to be sure, 
both libobjc and libc++ links to a same libsupc++. (Maybe I should convert it 
into a .so?)
$ make -j8 -k
$ make test # oops, I get SIGSEGVs.
_______________________________________________
Gnustep-dev mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/gnustep-dev

Reply via email to