Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Unified Diff: third_party/libc++-static/build.sh

Issue 1415213004: mac: Pull a prebuilt libc++-static.a. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: foo Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/libc++-static/README.chromium ('k') | third_party/libc++-static/libc++-static.a.sha1 » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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}"
« no previous file with comments | « third_party/libc++-static/README.chromium ('k') | third_party/libc++-static/libc++-static.a.sha1 » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698