Index: third_party/libc++-static/build.sh |
diff --git a/third_party/libc++-static/build.sh b/third_party/libc++-static/build.sh |
new file mode 100755 |
index 0000000000000000000000000000000000000000..982d7db93fb9ddd215eea02ef03ead91cbeee158 |
--- /dev/null |
+++ b/third_party/libc++-static/build.sh |
@@ -0,0 +1,69 @@ |
+#!/bin/bash |
+ |
+set -eux |
+ |
+REV=245965 |
+DIR=$(mktemp -d -t libcpp) |
+ |
+THIS_DIR="${PWD}/$(dirname "${0}")" |
+ |
+# TODO(thakis): Figure out why our clang complains about visibility and |
+# redeclarations. |
+#CXX="$THIS_DIR/../llvm-build/Release+Asserts/bin/clang++" |
+CXX=c++ |
+ |
+ |
+FLAGS="-nostdinc++ -O3 -std=c++11 -fstrict-aliasing -fvisibility=hidden -fvisibility-inlines-hidden -mmacosx-version-min=10.6 -arch i386 -arch x86_64 -isysroot $(xcrun -show-sdk-path)" |
+ |
+pushd "${DIR}" |
+ |
+svn co --force https://llvm.org/svn/llvm-project/libcxx/trunk@$REV libcxx |
+svn co --force https://llvm.org/svn/llvm-project/libcxxabi/trunk@$REV libcxxabi |
+ |
+mkdir libcxxbuild |
+cd libcxxbuild |
+ |
+mkdir libcxx |
+pushd libcxx |
+sed -i '' 's/"default"/"hidden"/g' ../../libcxx/include/__config |
+"$CXX" -c -I../../libcxx/include/ ../../libcxx/src/*.cpp $FLAGS |
+popd |
+ |
+mkdir libcxxabi |
+pushd libcxxabi |
+sed -i '' 's/"default"/"hidden"/g' ../../libcxxabi/src/* |
+sed -i '' 's/push(default)/push(hidden)/g' ../../libcxxabi/src/* |
+ |
+# Let the default handler not depend on __cxa_demangle, this saves 0.5MB binary |
+# size in each binary linking against libc++-static.a |
+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.
|
+--- src/cxa_default_handlers.cpp (revision 245965) |
++++ src/cxa_default_handlers.cpp (working copy) |
+@@ -46,13 +46,7 @@ |
+ exception_header + 1; |
+ const __shim_type_info* thrown_type = |
+ static_cast<const __shim_type_info*>(exception_header->exceptionType); |
+- // Try to get demangled name of thrown_type |
+- int status; |
+- char buf[1024]; |
+- size_t len = sizeof(buf); |
+- const char* name = __cxa_demangle(thrown_type->name(), buf, &len, &status); |
+- if (status != 0) |
+- name = thrown_type->name(); |
++ const char* name = thrown_type->name(); |
+ // If the uncaught exception can be caught with std::exception& |
+ const __shim_type_info* catch_type = |
+ static_cast<const __shim_type_info*>(&typeid(std::exception)); |
+EOF |
+patch -d ../../libcxxabi -p0 |
+ |
+"$CXX" -c -I../../libcxx/include/ -I../../libcxxabi/include ../../libcxxabi/src/*.cpp $FLAGS |
+popd |
+ |
+libtool -static -o libc++-static.a libcxx*/*.o |
+ |
+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.
|
+upload_to_google_storage.py -b chromium-libcpp "${THIS_DIR}/libc++-static.a" |
+ |
+popd |
+rm -rf "${DIR}" |