-
Notifications
You must be signed in to change notification settings - Fork 12
Building libcxx & libcxxabi
Karol Szuster edited this page Jun 12, 2018
·
13 revisions
Only follow these steps if you're willing to compile SPMod on Linux using Clang.
- Git
- CMake 3.4.3+
- Ninja
- Clang 5+
- LLVM Linker (optional)
- Clone libc++ and libc++abi repositiories
git clone -b release_60 https://github.com/llvm-mirror/libcxx.git
git clone -b release_60 https://github.com/llvm-mirror/libcxxabi.git
- Create folders outside cloned repositories, f.e. build_libcxx and build_libcxxabi
- Change compiler to Clang
export CC=clang CXX=clang++
Notice
Some Linux distributions may have named clang differently by adding version as suffix, f.e.
For Clang 5.0
export CC=clang-5.0 CXX=clang++-5.0
For Clang 6.0
export CC=clang-6.0 CXX=clang++-6.0
-
(Optional) Overwrite default linker
ln -sf /path/to/ld.lld /usr/bin/ld
Notice
Some Linux distributions may have named linker differently by adding version as suffix, f.e.
For Clang 5.0
ln -sf /path/to/ld.lld-5.0 /usr/bin/ld
For Clang 6.0
ln -sf /path/to/ld.lld-6.0 /usr/bin/ld
- Enter to build_libcxxabi
cd /path/to/build_libcxxabi
- Generate build files
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-m32 -DLIBCXXABI_LIBCXX_INCLUDES=../libcxx/include ../libcxxabi/
- Build
ninja
- Enter to build_libcxx
cd /path/to/build_libcxx
- Generate build files
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DLIBCXX_CXX_ABI=libcxxabi -DLIBCXX_CXX_ABI_INCLUDE_PATHS=../libcxxabi/include -DLIBCXX_BUILD_32_BITS=ON -DCMAKE_SHARED_LINKER_FLAGS="-L../build_libcxxabi/lib" ../libcxx/
- Build
ninja
If you have successfully completed all the steps above, you can follow here, otherwise please follow those steps more carefully or open an issue if you have any questions.