diff options
author | dalecurtis <dalecurtis@chromium.org> | 2015-10-23 12:21:03 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-23 19:21:59 +0000 |
commit | 73e401c9ac64cce0bde4028783f19e2e802137dc (patch) | |
tree | 8a6e08f1c608dc4b05cfaae199877c5e2ffd845a | |
parent | e1157e36dcded8703bb90587c19b9f7c9603403d (diff) | |
download | chromium_src-73e401c9ac64cce0bde4028783f19e2e802137dc.zip chromium_src-73e401c9ac64cce0bde4028783f19e2e802137dc.tar.gz chromium_src-73e401c9ac64cce0bde4028783f19e2e802137dc.tar.bz2 |
Revert of mac: In static library builds, link against a static libc++.a (patchset #4 id:60001 of https://codereview.chromium.org/1413863003/ )
Reason for revert:
Failed lots of bots still :( Some in runhooks with:
Using overrides found in /Users/chrome-bot/.gyp/include.gypi
gyp: name 'asan' is not defined while evaluating condition '0==0 and component=="static_library" and asan==0' in /b/build/slave/Mac/build/src/third_party/pdfium/pdfium.gyp
http://build.chromium.org/p/chromium/buildstatus?builder=Mac&number=8563
Some with compile errors:
FAILED: /b/build/goma/gomacc ../../third_party/llvm-build/Release+Asserts/bin/clang -Wl,-search_paths_first ...
ld: library not found for -lc++
http://build.chromium.org/p/chromium.memory/buildstatus?builder=Mac%20ASan%2064%20Builder&number=27065
Original issue's description:
> 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).
>
> 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
> R=mark@chromium.org
>
> Committed: https://chromium.googlesource.com/chromium/src/+/494270d01189f8b4b2b4ebd501fd980833489729
>
> Committed: https://chromium.googlesource.com/chromium/src/+/0f56cff872068cef226e7ad3f9701eb41d4eb2f5
TBR=mark@chromium.org,thakis@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=400091
Review URL: https://codereview.chromium.org/1424593003
Cr-Commit-Position: refs/heads/master@{#355854}
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | DEPS | 2 | ||||
-rw-r--r-- | build/common.gypi | 45 | ||||
-rw-r--r-- | chrome/chrome_dll.gypi | 2 | ||||
-rwxr-xr-x | chrome/tools/build/mac/verify_order | 16 | ||||
-rwxr-xr-x | third_party/libc++-static/build.sh | 8 | ||||
-rw-r--r-- | third_party/libc++-static/libc++-static.a.sha1 (renamed from third_party/libc++-static/libc++.a.sha1) | 0 |
7 files changed, 22 insertions, 53 deletions
@@ -335,7 +335,7 @@ v8.log /third_party/khronos_glcts /third_party/leveldatabase/src /third_party/leveldb -/third_party/libc++-static/libc++.a +/third_party/libc++-static/libc++-static.a /third_party/libaddressinput/src /third_party/libexif/sources /third_party/libjingle/source @@ -682,7 +682,7 @@ hooks = [ '--platform=darwin', '--no_auth', '--bucket', 'chromium-libcpp', - '-s', 'src/third_party/libc++-static/libc++.a.sha1', + '-s', 'src/third_party/libc++-static/libc++-static.a.sha1', ], }, # Pull luci-go binaries (isolate, swarming) using checked-in hashes. diff --git a/build/common.gypi b/build/common.gypi index b75b7fb..e7b0527 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -5260,26 +5260,6 @@ }, # configuration "Release" }, # configurations 'xcode_settings': { - # Tell the compiler to use libc++'s headers and the linker to link - # against libc++. The latter part normally requires OS X 10.7, but - # we still support running on 10.6. How does this work? Two parts: - # 1. Chromium's clang doesn't error on -mmacosx-version-min=10.6 - # combined with -stdlib=libc++ (it normally silently produced a - # binary that doesn't run on 10.6) - # 2. Further down, library_dirs is set to third_party/libc++-static, - # which contains a static libc++.a library. The linker then links - # against that instead of against /usr/lib/libc++.dylib when it - # sees the -lc++ flag added by the driver. - # - # In component builds, just link to the system libc++. - # This has the effect of making everything depend on libc++, which - # means component-build binaries won't run on 10.6 (no libc++ there), - # but for a developer-only configuration that's ok. (We don't want - # to raise the deployment target yet so that official and dev builds - # have the same deployment target. This affects things like which - # functions are considered deprecated.) - 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++ - 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic # (Equivalent to -fPIC) # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min @@ -5296,18 +5276,23 @@ # specified or not. '-fno-strict-aliasing', # See http://crbug.com/32204. ], + 'conditions': [ + ['component=="shared_library"', { + # In component builds, link to the system libc++. This requires + # OS X 10.7, but we currently pass -mmacosx-version-min=10.6. + # Xcode's clang complains about this, but our open-source bundled + # chromium clang doesn't. This has the effect of making + # everything depend on libc++, which means component-build + # binaries won't run on 10.6 (no libc++ there), but for a + # developer-only configuration that's ok. + # (We don't want to raise the deployment target yet so that + # official and dev builds have the same deployment target. This + # affects things like which functions are considered deprecated.) + 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++ + }], + ], }, 'target_conditions': [ - ['>(nacl_untrusted_build)==0 and component=="static_library" and asan==0', { - # See the comment for CLANG_CXX_LIBRARY above for what this does. - # The NaCl toolchains have their own toolchain and don't need this. - # ASan requires 10.7+ and clang implicitly adds -lc++abi in ASan - # mode. Our libc++.a contains both libc++ and libc++abi in one - # library, so it doesn't work in that mode. - 'library_dirs': [ - '<(DEPTH)/third_party/libc++-static', - ], - }], ['_type=="executable"', { 'postbuilds': [ { diff --git a/chrome/chrome_dll.gypi b/chrome/chrome_dll.gypi index f15884a..ef61887 100644 --- a/chrome/chrome_dll.gypi +++ b/chrome/chrome_dll.gypi @@ -304,7 +304,7 @@ ], }], # This step currently fails when using LTO. TODO(pcc): Re-enable. - ['OS=="mac" and use_lto==0 and component=="static_library"', { + ['OS=="mac" and use_lto==0', { 'postbuilds': [ { # This step causes an error to be raised if the .order file diff --git a/chrome/tools/build/mac/verify_order b/chrome/tools/build/mac/verify_order index cfa4c5a..3d5d644 100755 --- a/chrome/tools/build/mac/verify_order +++ b/chrome/tools/build/mac/verify_order @@ -12,8 +12,6 @@ # # 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 @@ -42,18 +40,4 @@ 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 diff --git a/third_party/libc++-static/build.sh b/third_party/libc++-static/build.sh index d79054d..96d490c 100755 --- a/third_party/libc++-static/build.sh +++ b/third_party/libc++-static/build.sh @@ -38,16 +38,16 @@ 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++.a +# size in each binary linking against libc++-static.a patch -d ../../libcxxabi -p0 < "${THIS_DIR}/libcxxabi.patch" "$CXX" -c -I../../libcxx/include/ -I../../libcxxabi/include ../../libcxxabi/src/*.cpp $FLAGS popd -libtool -static -o libc++.a libcxx*/*.o +libtool -static -o libc++-static.a libcxx*/*.o -cp libc++.a "${THIS_DIR}/libc++.a" -upload_to_google_storage.py -b chromium-libcpp "${THIS_DIR}/libc++.a" +cp libc++-static.a "${THIS_DIR}" +upload_to_google_storage.py -b chromium-libcpp "${THIS_DIR}/libc++-static.a" popd rm -rf "${DIR}" diff --git a/third_party/libc++-static/libc++.a.sha1 b/third_party/libc++-static/libc++-static.a.sha1 index 06a3493..06a3493 100644 --- a/third_party/libc++-static/libc++.a.sha1 +++ b/third_party/libc++-static/libc++-static.a.sha1 |