Updates vendored mason to v0.4 for LLVM 3.9.1
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
### llvm v3.8.1
|
||||
|
||||
This is a package of all llvm tools. Multiple packages are based on repackaging the binaries from this one including:
|
||||
|
||||
- clang++ 3.8.1
|
||||
- clang-tidy 3.8.1
|
||||
- clang-format 3.8.1
|
||||
-124
@@ -1,124 +0,0 @@
|
||||
### llvm v3.9.0
|
||||
|
||||
This is a package of all llvm tools. Multiple packages are based on repackaging the binaries from this one including:
|
||||
|
||||
- clang++ 3.9.0
|
||||
- clang-tidy 3.9.0
|
||||
- clang-format 3.9.0
|
||||
|
||||
### Details of package
|
||||
|
||||
This package inherits from `scripts/llvm/base/common.sh`, which is a base configuration and not an actual package itself.
|
||||
|
||||
Therefore to see the intricacies of how this package is built look in `scripts/llvm/base/common.sh`.
|
||||
|
||||
The `scripts/llvm/base/common.sh` is used by both llvm 3.8.1 and llvm 3.9.0 packages (and future ones). It reduces duplication of package code and makes it easier to update the builds in one place to benefit all versions.
|
||||
|
||||
The `scripts/llvm/3.9.0/script.sh` therefore sources `scripts/llvm/base/common.sh` and then overrides just the functions that need to be customized. At the time of writing this is only the `setup_release` function. It is customized in order to provide version specific md5 values which can ensure that upstream packages do not change without us noticing.
|
||||
|
||||
### Details of builds
|
||||
|
||||
- Done on Sept 22, 2016 by @springmeyer
|
||||
- OS X build done on OS X 10.11
|
||||
- Linux build done on ubuntu precise
|
||||
|
||||
The order and method of building was generally:
|
||||
|
||||
```sh
|
||||
VERSION=3.9.0
|
||||
./mason build llvm ${VERSION}
|
||||
./mason publish llvm ${VERSION}
|
||||
./mason build clang++ ${VERSION}
|
||||
./mason publish clang++ ${VERSION}
|
||||
./mason build clang-tidy ${VERSION}
|
||||
./mason publish clang-tidy ${VERSION}
|
||||
./mason build clang-format ${VERSION}
|
||||
./mason publish clang-format ${VERSION}
|
||||
./mason build lldb ${VERSION}
|
||||
./mason publish lldb ${VERSION}
|
||||
./mason build llvm-cov ${VERSION}
|
||||
./mason publish llvm-cov ${VERSION}
|
||||
```
|
||||
|
||||
#### OSX details
|
||||
|
||||
On macOS we use the apple system clang++ to compile and link against the apple system libc++.
|
||||
|
||||
```sh
|
||||
$ clang++ -v
|
||||
Apple LLVM version 7.3.0 (clang-703.0.31)
|
||||
Target: x86_64-apple-darwin15.6.0
|
||||
Thread model: posix
|
||||
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
|
||||
```
|
||||
|
||||
Therefore the llvm package was built like:
|
||||
|
||||
```sh
|
||||
./mason build llvm 3.9.0
|
||||
```
|
||||
|
||||
#### Linux details
|
||||
|
||||
On linux we use precise in order to ensure that binaries can be run on ubuntu precise and newer platforms.
|
||||
|
||||
We still want to compile clang++ in c++11 mode so we compile clang++ using a mason provided clang++.
|
||||
|
||||
To support c++11 we'd normally need to upgrade libstdc++ which would make it problematic for the resulting binary to be portable to linux systems without that upgraded libstdc++. So we avoid this issue by instead linking clang++ to libc++, which itself will travel inside the clang++ package.
|
||||
|
||||
To accomplish this (c++11 build of clang++ and linking to libc++ instead of an upgraded libstdc++) we did:
|
||||
|
||||
```sh
|
||||
./mason install clang++ 3.9.0
|
||||
CLANG_39_PREFIX=$(./mason prefix clang++ 3.9.0)
|
||||
export CXX=${CLANG_39_PREFIX}/bin/clang++-3.9
|
||||
export CC=${CLANG_39_PREFIX}/bin/clang-3.9
|
||||
./mason build llvm 3.9.0
|
||||
```
|
||||
|
||||
The reason `LD_LIBRARY_PATH` is set before the build is so that libc++.so can be found during linking. Once linked clang++ automatically uses the right @rpath on macOS and linux to find its own libc++.so at runtime.
|
||||
|
||||
TODO:
|
||||
|
||||
- Modify the llvm 3.9.0 build scripts to build libc++ and libc++abi first.
|
||||
- Then we should be able to point LD_LIBRARY_PATH at llvm 3.9.0's libc++.so to avoid potential ABI mismatch with the version provided by 3.8.0
|
||||
- LD_LIBRARY_PATH would be pointed at the theoretical location of llvm 3.9.0's libc++, and that location would exist and become valid before llvm 3.9.0's clang++ is linked.
|
||||
|
||||
|
||||
### Testing of these new tools
|
||||
|
||||
Once these packages were built I needed to test that they could be used to build and publish other mason packages. And I needed to be able to test that these packages worked for downstream users.
|
||||
|
||||
To accomplish this I branched mason and changed the `MASON_PLATFORM_ID` to enable publishing new binaries with llvm 3.9.0 tools without overwriting existing binaries.
|
||||
|
||||
```
|
||||
diff --git a/mason.sh b/mason.sh
|
||||
index 800216d..ccc1fcb 100644
|
||||
--- a/mason.sh
|
||||
+++ b/mason.sh
|
||||
@@ -259,7 +259,7 @@ MASON_SLUG=${MASON_NAME}-${MASON_VERSION}
|
||||
if [[ ${MASON_HEADER_ONLY} == true ]]; then
|
||||
MASON_PLATFORM_ID=headers
|
||||
else
|
||||
- MASON_PLATFORM_ID=${MASON_PLATFORM}-${MASON_PLATFORM_VERSION}
|
||||
+ MASON_PLATFORM_ID=${MASON_PLATFORM}-${MASON_PLATFORM_VERSION}-llvm390
|
||||
fi
|
||||
MASON_PREFIX=${MASON_ROOT}/${MASON_PLATFORM_ID}/${MASON_NAME}/${MASON_VERSION}
|
||||
MASON_BINARIES=${MASON_PLATFORM_ID}/${MASON_NAME}/${MASON_VERSION}.tar.gz
|
||||
```
|
||||
|
||||
But changing the `MASON_PLATFORM_ID` also means that you loose access to all existing binaries for building packages. To ensure I could still bootstrap the builds I seeded this new `MASON_PLATFORM_ID` with key build tools, including the previously built llvm tools being discussed here.
|
||||
|
||||
```
|
||||
CUSTOM_PATH="llvm390"
|
||||
aws s3 sync --acl public-read s3://mason-binaries/linux-x86_64/llvm/ s3://mason-binaries/linux-x86_64-{CUSTOM_PATH}/llvm/
|
||||
aws s3 sync --acl public-read s3://mason-binaries/linux-x86_64/clang++/ s3://mason-binaries/linux-x86_64-{CUSTOM_PATH}/clang++/
|
||||
aws s3 sync --acl public-read s3://mason-binaries/linux-x86_64/cmake/ s3://mason-binaries/linux-x86_64-{CUSTOM_PATH}/cmake/
|
||||
aws s3 sync --acl public-read s3://mason-binaries/linux-x86_64/ccache/ s3://mason-binaries/linux-x86_64-{CUSTOM_PATH}/ccache/
|
||||
aws s3 sync --acl public-read s3://mason-binaries/linux-x86_64/ninja/ s3://mason-binaries/linux-x86_64-{CUSTOM_PATH}/ninja/
|
||||
aws s3 sync --acl public-read s3://mason-binaries/osx-x86_64/llvm/ s3://mason-binaries/osx-x86_64-{CUSTOM_PATH}/llvm/
|
||||
aws s3 sync --acl public-read s3://mason-binaries/osx-x86_64/clang++/ s3://mason-binaries/osx-x86_64-{CUSTOM_PATH}/clang++/
|
||||
aws s3 sync --acl public-read s3://mason-binaries/osx-x86_64/cmake/ s3://mason-binaries/osx-x86_64-{CUSTOM_PATH}/cmake/
|
||||
aws s3 sync --acl public-read s3://mason-binaries/osx-x86_64/ccache/ s3://mason-binaries/osx-x86_64-{CUSTOM_PATH}/ccache/
|
||||
aws s3 sync --acl public-read s3://mason-binaries/osx-x86_64/ninja/ s3://mason-binaries/osx-x86_64-{CUSTOM_PATH}/ninja/
|
||||
```
|
||||
Vendored
Vendored
+9
-9
@@ -10,17 +10,17 @@ MASON_VERSION=$(basename $HERE)
|
||||
source ${HERE}/../../${MASON_NAME}/base/common.sh
|
||||
|
||||
function setup_release() {
|
||||
get_llvm_project "http://llvm.org/releases/${MASON_VERSION}/llvm-${MASON_VERSION}.src.tar.xz" ${MASON_BUILD_PATH}/ 00f5268479117c9c7f90d0f9e2f06485875f5444
|
||||
get_llvm_project "http://llvm.org/releases/${MASON_VERSION}/cfe-${MASON_VERSION}.src.tar.xz" ${MASON_BUILD_PATH}/tools/clang 465e70cfb1d8b3fb5d1f6577933f7b5014aca3bd
|
||||
get_llvm_project "http://llvm.org/releases/${MASON_VERSION}/compiler-rt-${MASON_VERSION}.src.tar.xz" ${MASON_BUILD_PATH}/projects/compiler-rt 7a2ea8a7257a739330d8f7cfe2bcb70939476f31
|
||||
get_llvm_project "http://llvm.org/releases/${MASON_VERSION}/llvm-${MASON_VERSION}.src.tar.xz" ${MASON_BUILD_PATH}/ 282e47884738e362ff4dc70910d2e08c242f161a
|
||||
get_llvm_project "http://llvm.org/releases/${MASON_VERSION}/cfe-${MASON_VERSION}.src.tar.xz" ${MASON_BUILD_PATH}/tools/clang 211b70f3cc75ef318dfa4efd57a2e9c547375f94
|
||||
get_llvm_project "http://llvm.org/releases/${MASON_VERSION}/compiler-rt-${MASON_VERSION}.src.tar.xz" ${MASON_BUILD_PATH}/projects/compiler-rt 19981bad5a444b36b2834d5bfd3edd5c66c7ca22
|
||||
if [[ ${BUILD_AND_LINK_LIBCXX} == true ]]; then
|
||||
get_llvm_project "http://llvm.org/releases/${MASON_VERSION}/libcxx-${MASON_VERSION}.src.tar.xz" ${MASON_BUILD_PATH}/projects/libcxx 248635c4821b9f2e4b620364c21a2596eed514cd
|
||||
get_llvm_project "http://llvm.org/releases/${MASON_VERSION}/libcxxabi-${MASON_VERSION}.src.tar.xz" ${MASON_BUILD_PATH}/projects/libcxxabi 04ffa28577ec3d935dcd69d137a2e478e71f2704
|
||||
get_llvm_project "http://llvm.org/releases/${MASON_VERSION}/libunwind-${MASON_VERSION}.src.tar.xz" ${MASON_BUILD_PATH}/projects/libunwind 32e17eaf6a5b769c244480bd32ab3c9cbdf6c97d
|
||||
get_llvm_project "http://llvm.org/releases/${MASON_VERSION}/libcxx-${MASON_VERSION}.src.tar.xz" ${MASON_BUILD_PATH}/projects/libcxx 2fdaf6017fe742974eb06f9529321a915e84a034
|
||||
get_llvm_project "http://llvm.org/releases/${MASON_VERSION}/libcxxabi-${MASON_VERSION}.src.tar.xz" ${MASON_BUILD_PATH}/projects/libcxxabi 277446b2957d2a82ef10d173b3882b64d68ca5d0
|
||||
get_llvm_project "http://llvm.org/releases/${MASON_VERSION}/libunwind-${MASON_VERSION}.src.tar.xz" ${MASON_BUILD_PATH}/projects/libunwind 0df57c982fda5ba8b97698525ed6fea09f87ea15
|
||||
fi
|
||||
get_llvm_project "http://llvm.org/releases/${MASON_VERSION}/lld-${MASON_VERSION}.src.tar.xz" ${MASON_BUILD_PATH}/tools/lld e1829cd47a5c44ad6c68957056afe63879ad9610
|
||||
get_llvm_project "http://llvm.org/releases/${MASON_VERSION}/clang-tools-extra-${MASON_VERSION}.src.tar.xz" ${MASON_BUILD_PATH}/tools/clang/tools/extra 8e7e118a769c76e70d5fb2ede66c8f5a2952f8d9
|
||||
get_llvm_project "http://llvm.org/releases/${MASON_VERSION}/lldb-${MASON_VERSION}.src.tar.xz" ${MASON_BUILD_PATH}/tools/lldb 988766cbb3d4a295b33dd11f51f7f20811bfa8f2
|
||||
get_llvm_project "http://llvm.org/releases/${MASON_VERSION}/lld-${MASON_VERSION}.src.tar.xz" ${MASON_BUILD_PATH}/tools/lld 6c8018e5caf82f1f771d24b532af11c67228f333
|
||||
get_llvm_project "http://llvm.org/releases/${MASON_VERSION}/clang-tools-extra-${MASON_VERSION}.src.tar.xz" ${MASON_BUILD_PATH}/tools/clang/tools/extra a3f5d99cd3d4ccdfc6d4dba15db616d53a654c3f
|
||||
get_llvm_project "http://llvm.org/releases/${MASON_VERSION}/lldb-${MASON_VERSION}.src.tar.xz" ${MASON_BUILD_PATH}/tools/lldb c8e35a599bd366d1fc122526d3b7a1902890d1ed
|
||||
get_llvm_project "https://github.com/include-what-you-use/include-what-you-use/archive/clang_${MAJOR_MINOR}.tar.gz" ${MASON_BUILD_PATH}/tools/clang/tools/include-what-you-use 7e5c73ce1a2fdd1ffd29fad1ae2628d0134368c6
|
||||
}
|
||||
|
||||
+68
-42
@@ -9,8 +9,8 @@ export MAJOR_MINOR=$(echo ${MASON_VERSION} | cut -d '.' -f1-2)
|
||||
|
||||
if [[ $(uname -s) == 'Darwin' ]]; then
|
||||
export BUILD_AND_LINK_LIBCXX=false
|
||||
# TODO: could also use LIBCXX_INSTALL_SUPPORT_HEADERS, LIBCXX_INSTALL_LIBRARY, LIBCXX_INSTALL_HEADERS
|
||||
# avoids this kind of problem with include-what-you-use:
|
||||
# avoids this kind of problem with include-what-you-use
|
||||
# because iwyu hardcodes at https://github.com/include-what-you-use/include-what-you-use/blob/da5c9b17fec571e6b2bbca29145463d7eaa3582e/iwyu_driver.cc#L219
|
||||
: '
|
||||
/Library/Developer/CommandLineTools/usr/include/c++/v1/cstdlib:167:44: error: declaration conflicts with target of using declaration already in scope
|
||||
inline _LIBCPP_INLINE_VISIBILITY long abs( long __x) _NOEXCEPT {return labs(__x);}
|
||||
@@ -123,6 +123,11 @@ function mason_compile {
|
||||
# knock out lldb doc building, to remove doxygen dependency
|
||||
perl -i -p -e "s/add_subdirectory\(docs\)//g;" tools/lldb/CMakeLists.txt
|
||||
|
||||
# remove /usr/local/include from default paths (targeting linux)
|
||||
# because we want users to have to explictly link things in /usr/local to avoid conflicts
|
||||
# between mason and homebrew or source installs
|
||||
perl -i -p -e "s/AddPath\(\"\/usr\/local\/include\"\, System\, false\)\;//g;" tools/clang/lib/Frontend/InitHeaderSearch.cpp
|
||||
|
||||
if [[ ${MAJOR_MINOR} == "3.8" ]]; then
|
||||
# workaround https://llvm.org/bugs/show_bug.cgi?id=25565
|
||||
perl -i -p -e "s/set\(codegen_deps intrinsics_gen\)/set\(codegen_deps intrinsics_gen attributes_inc\)/g;" lib/CodeGen/CMakeLists.txt
|
||||
@@ -139,18 +144,35 @@ function mason_compile {
|
||||
cd ./build
|
||||
CMAKE_EXTRA_ARGS=""
|
||||
if [[ $(uname -s) == 'Darwin' ]]; then
|
||||
# This is a stable location for libc++ headers from the system
|
||||
SYSTEM_LIBCXX_HEADERS="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/"
|
||||
# This is the location of C headers on 10.11
|
||||
OSX_10_11_SDK_C_HEADERS="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/"
|
||||
# This is the location of C headers on >= 10.12 which is a symlink to the versioned SDK
|
||||
OSX_10_12_AND_GREATER_SDK_HEADERS="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/"
|
||||
# This allows this version of clang to find the headers from only a command line tools install (no xcode installed)
|
||||
# It is debatable whether this should be supported
|
||||
COMMAND_LINE_TOOLS_C_HEADERS="/usr/include"
|
||||
CMAKE_EXTRA_ARGS="${CMAKE_EXTRA_ARGS} -DC_INCLUDE_DIRS=:${SYSTEM_LIBCXX_HEADERS}:${OSX_10_12_AND_GREATER_SDK_HEADERS}:${OSX_10_11_SDK_C_HEADERS}:${COMMAND_LINE_TOOLS_C_HEADERS}"
|
||||
: '
|
||||
Note: C_INCLUDE_DIRS and DEFAULT_SYSROOT are critical options to understand to ensure C and C++ headers are predictably found.
|
||||
|
||||
The way things work in clang++ on OS X (inside http://clang.llvm.org/doxygen/InitHeaderSearch_8cpp.html) is:
|
||||
|
||||
- The `:` separated `C_INCLUDE_DIRS` are added to the include paths
|
||||
- If `C_INCLUDE_DIRS` is present `InitHeaderSearch::AddDefaultCIncludePaths` returns early
|
||||
- Without that early return `/usr/include` would be added by default on OS X
|
||||
- If `-isysroot` is passed then absolute `C_INCLUDE_DIRS` are appended to the sysroot
|
||||
- So if sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/ and
|
||||
C_INCLUDE_DIRS=/usr/include the actual path searched would be:
|
||||
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
|
||||
- Relative `C_INCLUDE_DIRS` seem pointless because they are not appended to the sysroot and so will not be portable
|
||||
- clang++ finds C++ headers relative to itself at https://github.com/llvm-mirror/clang/blob/master/lib/Frontend/InitHeaderSearch.cpp#L469-L470
|
||||
- So, given on OS X we want to use the XCode/Apple provided libc++ and c++ headers we symlink the relative location to /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++
|
||||
- The alternative would be to symlink to the command line tools location (/Library/Developer/CommandLineTools/usr/include/c++/v1/)
|
||||
|
||||
Another viable sysroot would be the command line tools at /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
|
||||
|
||||
Generally each SDK/Platform version has its own C headers inside SDK_PATH/usr/include while all platforms share the C++ headers which
|
||||
are at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/
|
||||
|
||||
NOTE: show search paths with: `clang -x c -v -E /dev/null` || `cpp -v` && `clang -Xlinker -v`
|
||||
'
|
||||
CMAKE_EXTRA_ARGS="${CMAKE_EXTRA_ARGS} -DC_INCLUDE_DIRS=/usr/include"
|
||||
# setting the default sysroot to an explicit SDK avoids clang++ adding `/usr/local/include` to the paths by default at https://github.com/llvm-mirror/clang/blob/91d69c3c9c62946245a0fe6526d5ec226dfe7408/lib/Frontend/InitHeaderSearch.cpp#L226
|
||||
# because that value will be appended to the sysroot, not exist, and then get thrown out. If the sysroot were / then it would be added
|
||||
CMAKE_EXTRA_ARGS="${CMAKE_EXTRA_ARGS} -DDEFAULT_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk"
|
||||
CMAKE_EXTRA_ARGS="${CMAKE_EXTRA_ARGS} -DCLANG_DEFAULT_CXX_STDLIB=libc++"
|
||||
CMAKE_EXTRA_ARGS="${CMAKE_EXTRA_ARGS} -DDEFAULT_SYSROOT=/"
|
||||
CMAKE_EXTRA_ARGS="${CMAKE_EXTRA_ARGS} -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11"
|
||||
CMAKE_EXTRA_ARGS="${CMAKE_EXTRA_ARGS} -DLLVM_CREATE_XCODE_TOOLCHAIN=ON -DLLVM_EXTERNALIZE_DEBUGINFO=ON"
|
||||
fi
|
||||
@@ -182,16 +204,25 @@ function mason_compile {
|
||||
fi
|
||||
fi
|
||||
|
||||
# on linux the default is to link programs compiled by clang++ to libstdc++ and below we make that explicit.
|
||||
if [[ $(uname -s) == 'Linux' ]]; then
|
||||
export CMAKE_EXTRA_ARGS="${CMAKE_EXTRA_ARGS} -DCLANG_DEFAULT_CXX_STDLIB=libstdc++"
|
||||
fi
|
||||
|
||||
# TODO: test this
|
||||
#-DLLVM_ENABLE_LTO=ON \
|
||||
|
||||
# TODO: try rtlib=compiler-rt on linux
|
||||
# https://blogs.gentoo.org/gsoc2016-native-clang/2016/05/31/build-gnu-free-executables-with-clang/
|
||||
|
||||
if [[ ${BUILD_AND_LINK_LIBCXX} == true ]]; then
|
||||
CMAKE_EXTRA_ARGS="${CMAKE_EXTRA_ARGS} -DLIBCXX_ENABLE_ASSERTIONS=OFF -DLIBCXX_ENABLE_SHARED=OFF -DLIBCXXABI_ENABLE_SHARED=OFF -DLIBCXXABI_USE_LLVM_UNWINDER=ON -DLIBUNWIND_ENABLE_SHARED=OFF"
|
||||
fi
|
||||
|
||||
${MASON_CMAKE}/bin/cmake ../ -G Ninja -DCMAKE_INSTALL_PREFIX=${MASON_PREFIX} \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DLLVM_TARGETS_TO_BUILD="ARM;X86;AArch64" \
|
||||
-DLLVM_INCLUDE_DOCS=OFF \
|
||||
-DLLVM_TARGETS_TO_BUILD="X86" \
|
||||
-DCMAKE_CXX_COMPILER_LAUNCHER="${MASON_CCACHE}/bin/ccache" \
|
||||
-DCMAKE_CXX_COMPILER="$CXX" \
|
||||
-DCMAKE_C_COMPILER="$CC" \
|
||||
@@ -205,50 +236,45 @@ function mason_compile {
|
||||
-DCMAKE_MAKE_PROGRAM=${MASON_NINJA}/bin/ninja \
|
||||
${CMAKE_EXTRA_ARGS}
|
||||
|
||||
if [[ ${BUILD_AND_LINK_LIBCXX} == true ]]; then
|
||||
${MASON_NINJA}/bin/ninja unwind -j${MASON_CONCURRENCY}
|
||||
|
||||
# make libc++ and libc++abi first
|
||||
${MASON_NINJA}/bin/ninja cxx -j${MASON_CONCURRENCY}
|
||||
|
||||
${MASON_NINJA}/bin/ninja lldb -j${MASON_CONCURRENCY}
|
||||
fi
|
||||
|
||||
# then make everything else
|
||||
${MASON_NINJA}/bin/ninja -j${MASON_CONCURRENCY}
|
||||
|
||||
# install it all
|
||||
${MASON_NINJA}/bin/ninja install
|
||||
|
||||
if [[ $(uname -s) == 'Darwin' ]]; then
|
||||
# https://reviews.llvm.org/D13605
|
||||
${MASON_NINJA}/bin/ninja install-xcode-toolchain -j${MASON_CONCURRENCY}
|
||||
fi
|
||||
|
||||
if [[ ${BUILD_AND_LINK_LIBCXX} == true ]]; then
|
||||
${MASON_NINJA}/bin/ninja unwind -j${MASON_CONCURRENCY}
|
||||
|
||||
# make libc++ and libc++abi first
|
||||
# this ensures that the LD_LIBRARY_PATH above will be valid
|
||||
# and that clang++ on linux will be able to link itself to
|
||||
# this same instance of libc++
|
||||
${MASON_NINJA}/bin/ninja cxx -j${MASON_CONCURRENCY}
|
||||
|
||||
${MASON_NINJA}/bin/ninja lldb -j${MASON_CONCURRENCY}
|
||||
# no move the host compilers libc++ and libc++abi shared libs out of the way
|
||||
if [[ ${CXX_BOOTSTRAP:-false} != false ]]; then
|
||||
mkdir -p /tmp/backup_shlibs
|
||||
mv $(dirname $(dirname $CXX))/lib/*c++*so /tmp/backup_shlibs/
|
||||
fi
|
||||
fi
|
||||
|
||||
# then make everything else
|
||||
${MASON_NINJA}/bin/ninja -j${MASON_CONCURRENCY}
|
||||
# install it all
|
||||
${MASON_NINJA}/bin/ninja install
|
||||
|
||||
# install the asan_symbolizer.py tool
|
||||
cp -a ../projects/compiler-rt/lib/asan/scripts/asan_symbolize.py ${MASON_PREFIX}/bin/
|
||||
|
||||
# set up symlinks for to match what llvm.org binaries provide
|
||||
# set up symlinks to match what llvm.org binaries provide
|
||||
cd ${MASON_PREFIX}/bin/
|
||||
ln -s "clang++" "clang++-${MAJOR_MINOR}"
|
||||
ln -s "asan_symbolize.py" "asan_symbolize"
|
||||
|
||||
# restore host compilers sharedlibs
|
||||
if [[ ${BUILD_AND_LINK_LIBCXX} == true ]]; then
|
||||
if [[ ${CXX_BOOTSTRAP:-false} != false ]]; then
|
||||
cp -r /tmp/backup_shlibs/* $(dirname $(dirname $CXX))/lib/
|
||||
fi
|
||||
# symlink so that we use the system libc++ headers on osx
|
||||
if [[ $(uname -s) == 'Darwin' ]]; then
|
||||
mkdir -p ${MASON_PREFIX}/include
|
||||
cd ${MASON_PREFIX}/include
|
||||
# note: passing -nostdinc++ will result in this local path being ignored
|
||||
ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++ c++
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
|
||||
function mason_cflags {
|
||||
:
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user