Commit 9fe8c63c authored by ellyjones's avatar ellyjones Committed by Commit bot

mac: remove libc++-static 10.6 compatibility hack

This hack is obsolete since the minimum supported Mac version is now 10.9.

This CL also removes the checked-in copy of libc++-static, and removes
it from DEPS.

BUG=

Review-Url: https://codereview.chromium.org/2314753002
Cr-Commit-Position: refs/heads/master@{#418584}
parent dbae21c6
...@@ -865,18 +865,6 @@ hooks = [ ...@@ -865,18 +865,6 @@ hooks = [
'-s', 'src/buildtools/linux64/clang-format.sha1', '-s', 'src/buildtools/linux64/clang-format.sha1',
], ],
}, },
# Pull the prebuilt libc++ static library for mac.
{
'name': 'libcpp_mac',
'pattern': '.',
'action': [ 'download_from_google_storage',
'--no_resume',
'--platform=darwin',
'--no_auth',
'--bucket', 'chromium-libcpp',
'-s', 'src/third_party/libc++-static/libc++.a.sha1',
],
},
# Pull luci-go binaries (isolate, swarming) using checked-in hashes. # Pull luci-go binaries (isolate, swarming) using checked-in hashes.
{ {
'name': 'luci-go_win', 'name': 'luci-go_win',
......
...@@ -404,34 +404,8 @@ config("compiler") { ...@@ -404,34 +404,8 @@ config("compiler") {
} }
if (is_mac) { if (is_mac) {
# 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.)
cflags_cc += [ "-stdlib=libc++" ] cflags_cc += [ "-stdlib=libc++" ]
ldflags += [ "-stdlib=libc++" ] ldflags += [ "-stdlib=libc++" ]
if (!is_component_build && !is_asan) {
ldflags += [
"-L",
rebase_path("//third_party/libc++-static", root_build_dir),
]
}
} }
# Add flags for link-time optimization. These flags enable # Add flags for link-time optimization. These flags enable
......
...@@ -12,8 +12,6 @@ ...@@ -12,8 +12,6 @@
# #
# This script can be used to verify that all of the global text symbols in # 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. # 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 if [ ${#} -ne 2 ] ; then
echo "usage: ${0} LAST_SYMBOL MACH_O_FILE" >& 2 echo "usage: ${0} LAST_SYMBOL MACH_O_FILE" >& 2
...@@ -47,13 +45,5 @@ if [ ${?} -ne 0 ] ; then ...@@ -47,13 +45,5 @@ if [ ${?} -ne 0 ] ; then
echo "${0}: failed to get libraries in ${MACH_O_FILE}" >& 2 echo "${0}: failed to get libraries in ${MACH_O_FILE}" >& 2
exit 1 exit 1
fi 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 exit 0
==============================================================================
libc++ License
==============================================================================
The libc++ library is dual licensed under both the University of Illinois
"BSD-Like" license and the MIT license. As a user of this code you may choose
to use it under either license. As a contributor, you agree to allow your code
to be used under both.
Full text of the relevant licenses is included below.
==============================================================================
University of Illinois/NCSA
Open Source License
Copyright (c) 2009-2015 by the contributors listed in CREDITS.TXT
All rights reserved.
Developed by:
LLVM Team
University of Illinois at Urbana-Champaign
http://llvm.org
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal with
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimers.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimers in the
documentation and/or other materials provided with the distribution.
* Neither the names of the LLVM Team, University of Illinois at
Urbana-Champaign, nor the names of its contributors may be used to
endorse or promote products derived from this Software without specific
prior written permission.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
SOFTWARE.
==============================================================================
Copyright (c) 2009-2014 by the contributors listed in CREDITS.TXT
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Name: libcxx
Short Name: libc++
Security Critical: Yes
License: MIT
License File: LICENSE.TXT
Version: 0
Revision: 245965
URL: http://libcxx.llvm.org/
To upload (run automatically by build.sh):
upload_to_google_storage.py -b chromium-libcpp third_party/libc++-static/libc++.a
To initialize gsutil's credentials:
python ~/depot_tools/third_party/gsutil/gsutil config
That will give a URL which you should log into with your web browser. The
username should be the one that is on the ACL for the "chromium-libcpp"
bucket (probably your @google.com address). Contact the build team for help
getting access if necessary.
Copy the code back to the command line util. Ignore the project ID (it's OK
to just leave blank when prompted).
gsutil documentation:
https://developers.google.com/storage/docs/gsutil
To build: Run `third_party/libc++-static/build.sh`. It'll upload to google
storage and update the .sha1 file.
#!/bin/bash
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
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++.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
cp libc++.a "${THIS_DIR}/libc++.a"
upload_to_google_storage.py -b chromium-libcpp "${THIS_DIR}/libc++.a"
popd
rm -rf "${DIR}"
c1f2875483dd79ca3e0fe514014c3ea52d9f2b14
\ No newline at end of file
--- 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));
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment