summaryrefslogtreecommitdiffstats
path: root/chrome/tools/build/mac/verify_order
diff options
context:
space:
mode:
authorthakis <thakis@chromium.org>2015-10-24 00:16:57 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-24 07:17:43 +0000
commitf8a27cca3c79ca9c8f6bf701aa2cb8bbbc8b3059 (patch)
treef050913c4c20bf8ad2baad4abefda92f2f49b1c7 /chrome/tools/build/mac/verify_order
parent0fceaeddf5408ab60dccc2c2b45ca066caf50396 (diff)
downloadchromium_src-f8a27cca3c79ca9c8f6bf701aa2cb8bbbc8b3059.zip
chromium_src-f8a27cca3c79ca9c8f6bf701aa2cb8bbbc8b3059.tar.gz
chromium_src-f8a27cca3c79ca9c8f6bf701aa2cb8bbbc8b3059.tar.bz2
mac: In static library builds, link against a static libc++.a
To achieve this, just add a -Lthird_party/libc++-static flag to the link line, and add a postbuild that checks that Chromium Framework depends on neither libstdc++.dylib nor libc++.dylib Use the existing verify_order postbuild for this, and let it not run in component builds (since what it checks for isn't interesting in that config, and we do depend on system libc++ in component builds). Also don't do this in asan builds. asan already requires OS X 10.7+. And don't do this for targets below native_client, since those still use the 10.6 SDK (!). This change is small but subtle, see thread "[chromium-dev] Intent to implement: Statically linking libc++ for Chrome/Mac" and the document linked from comment 14 on the bug for details. Ideally, this has no observable behavior change. If it looks like this breaks tests somewhere, especially on 10.6, please revert. (The bots like it, and the things I tried on 10.6 worked too, though.) BUG=400091,544325 R=mark@chromium.org Committed: https://chromium.googlesource.com/chromium/src/+/494270d01189f8b4b2b4ebd501fd980833489729 Committed: https://chromium.googlesource.com/chromium/src/+/0f56cff872068cef226e7ad3f9701eb41d4eb2f5 Review URL: https://codereview.chromium.org/1413863003 Cr-Commit-Position: refs/heads/master@{#355966}
Diffstat (limited to 'chrome/tools/build/mac/verify_order')
-rwxr-xr-xchrome/tools/build/mac/verify_order16
1 files changed, 16 insertions, 0 deletions
diff --git a/chrome/tools/build/mac/verify_order b/chrome/tools/build/mac/verify_order
index 3d5d644..cfa4c5a 100755
--- a/chrome/tools/build/mac/verify_order
+++ b/chrome/tools/build/mac/verify_order
@@ -12,6 +12,8 @@
#
# This script can be used to verify that all of the global text symbols in
# a Mach-O file are accounted for in an order file.
+#
+# Also check that the file does not depend on either of libstdc++ or libc++.
if [ ${#} -ne 2 ] ; then
echo "usage: ${0} LAST_SYMBOL MACH_O_FILE" >& 2
@@ -40,4 +42,18 @@ if [ ${?} -eq 0 ] || [ -n "${UNORDERED_SYMBOLS}" ] ; then
exit 1
fi
+LIBS=$(otool -L "${MACH_O_FILE}")
+if [ ${?} -ne 0 ] ; then
+ echo "${0}: failed to get libraries in ${MACH_O_FILE}" >& 2
+ exit 1
+fi
+if grep -Fq libstdc++ <<< ${LIBS} ; then
+ echo "${0}: ${MACH_O_FILE} depends on libstdc++" >& 2
+ exit 1
+fi
+if grep -Fq libc++ <<< ${LIBS} ; then
+ echo "${0}: ${MACH_O_FILE} depends on libc++" >& 2
+ exit 1
+fi
+
exit 0