| OLD | NEW |
| (Empty) |
| 1 #!/bin/bash | |
| 2 # Copyright 2015 The Chromium Authors. All rights reserved. | |
| 3 # Use of this source code is governed by a BSD-style license that can be | |
| 4 # found in the LICENSE file. | |
| 5 | |
| 6 set -eux | |
| 7 | |
| 8 REV=245965 | |
| 9 DIR=$(mktemp -d -t libcpp) | |
| 10 | |
| 11 THIS_DIR="${PWD}/$(dirname "${0}")" | |
| 12 | |
| 13 # TODO(thakis): Figure out why our clang complains about visibility and | |
| 14 # redeclarations. | |
| 15 #CXX="$THIS_DIR/../llvm-build/Release+Asserts/bin/clang++" | |
| 16 CXX=c++ | |
| 17 | |
| 18 | |
| 19 FLAGS="-nostdinc++ -O3 -std=c++11 -fstrict-aliasing -fvisibility=hidden -fvisibi
lity-inlines-hidden -mmacosx-version-min=10.6 -arch i386 -arch x86_64 -isysroot
$(xcrun -show-sdk-path)" | |
| 20 | |
| 21 pushd "${DIR}" | |
| 22 | |
| 23 svn co --force https://llvm.org/svn/llvm-project/libcxx/trunk@$REV libcxx | |
| 24 svn co --force https://llvm.org/svn/llvm-project/libcxxabi/trunk@$REV libcxxabi | |
| 25 | |
| 26 mkdir libcxxbuild | |
| 27 cd libcxxbuild | |
| 28 | |
| 29 mkdir libcxx | |
| 30 pushd libcxx | |
| 31 sed -i '' 's/"default"/"hidden"/g' ../../libcxx/include/__config | |
| 32 "$CXX" -c -I../../libcxx/include/ ../../libcxx/src/*.cpp $FLAGS | |
| 33 popd | |
| 34 | |
| 35 mkdir libcxxabi | |
| 36 pushd libcxxabi | |
| 37 sed -i '' 's/"default"/"hidden"/g' ../../libcxxabi/src/* | |
| 38 sed -i '' 's/push(default)/push(hidden)/g' ../../libcxxabi/src/* | |
| 39 | |
| 40 # Let the default handler not depend on __cxa_demangle, this saves 0.5MB binary | |
| 41 # size in each binary linking against libc++.a | |
| 42 patch -d ../../libcxxabi -p0 < "${THIS_DIR}/libcxxabi.patch" | |
| 43 | |
| 44 "$CXX" -c -I../../libcxx/include/ -I../../libcxxabi/include ../../libcxxabi/src/
*.cpp $FLAGS | |
| 45 popd | |
| 46 | |
| 47 libtool -static -o libc++.a libcxx*/*.o | |
| 48 | |
| 49 cp libc++.a "${THIS_DIR}/libc++.a" | |
| 50 upload_to_google_storage.py -b chromium-libcpp "${THIS_DIR}/libc++.a" | |
| 51 | |
| 52 popd | |
| 53 rm -rf "${DIR}" | |
| OLD | NEW |