Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 #!/bin/bash | |
| 2 | |
| 3 set -eux | |
| 4 | |
| 5 REV=245965 | |
| 6 DIR=$(mktemp -d -t libcpp) | |
| 7 | |
| 8 THIS_DIR="${PWD}/$(dirname "${0}")" | |
| 9 | |
| 10 # TODO(thakis): Figure out why our clang complains about visibility and | |
| 11 # redeclarations. | |
| 12 #CXX="$THIS_DIR/../llvm-build/Release+Asserts/bin/clang++" | |
| 13 CXX=c++ | |
| 14 | |
| 15 | |
| 16 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)" | |
| 17 | |
| 18 pushd "${DIR}" | |
| 19 | |
| 20 svn co --force https://llvm.org/svn/llvm-project/libcxx/trunk@$REV libcxx | |
| 21 svn co --force https://llvm.org/svn/llvm-project/libcxxabi/trunk@$REV libcxxabi | |
| 22 | |
| 23 mkdir libcxxbuild | |
| 24 cd libcxxbuild | |
| 25 | |
| 26 mkdir libcxx | |
| 27 pushd libcxx | |
| 28 sed -i '' 's/"default"/"hidden"/g' ../../libcxx/include/__config | |
| 29 "$CXX" -c -I../../libcxx/include/ ../../libcxx/src/*.cpp $FLAGS | |
| 30 popd | |
| 31 | |
| 32 mkdir libcxxabi | |
| 33 pushd libcxxabi | |
| 34 sed -i '' 's/"default"/"hidden"/g' ../../libcxxabi/src/* | |
| 35 sed -i '' 's/push(default)/push(hidden)/g' ../../libcxxabi/src/* | |
| 36 | |
| 37 # Let the default handler not depend on __cxa_demangle, this saves 0.5MB binary | |
| 38 # size in each binary linking against libc++-static.a | |
| 39 cat << 'EOF' | | |
|
Mark Mentovai
2015/10/22 23:26:46
Instead of an inline here-doc, put a .patch in the
Nico
2015/10/22 23:39:59
Done.
| |
| 40 --- src/cxa_default_handlers.cpp (revision 245965) | |
| 41 +++ src/cxa_default_handlers.cpp (working copy) | |
| 42 @@ -46,13 +46,7 @@ | |
| 43 exception_header + 1; | |
| 44 const __shim_type_info* thrown_type = | |
| 45 static_cast<const __shim_type_info*>(exception_header->exce ptionType); | |
| 46 - // Try to get demangled name of thrown_type | |
| 47 - int status; | |
| 48 - char buf[1024]; | |
| 49 - size_t len = sizeof(buf); | |
| 50 - const char* name = __cxa_demangle(thrown_type->name(), buf, &le n, &status); | |
| 51 - if (status != 0) | |
| 52 - name = thrown_type->name(); | |
| 53 + const char* name = thrown_type->name(); | |
| 54 // If the uncaught exception can be caught with std::exception& | |
| 55 const __shim_type_info* catch_type = | |
| 56 static_cast<const __shim_type_info*>(&typeid(st d::exception)); | |
| 57 EOF | |
| 58 patch -d ../../libcxxabi -p0 | |
| 59 | |
| 60 "$CXX" -c -I../../libcxx/include/ -I../../libcxxabi/include ../../libcxxabi/src/ *.cpp $FLAGS | |
| 61 popd | |
| 62 | |
| 63 libtool -static -o libc++-static.a libcxx*/*.o | |
| 64 | |
| 65 cp libc++-static.a "${THIS_DIR}" | |
|
Mark Mentovai
2015/10/22 23:26:46
Is this gitignored?
Nico
2015/10/22 23:39:59
Done.
| |
| 66 upload_to_google_storage.py -b chromium-libcpp "${THIS_DIR}/libc++-static.a" | |
| 67 | |
| 68 popd | |
| 69 rm -rf "${DIR}" | |
| OLD | NEW |