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

Side by Side Diff: chrome/tools/build/mac/verify_no_objc.sh

Issue 7746007: temporary make build fix (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 2
3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 # This script makes sure that no __OBJC,__image_info section appears in the 7 # This script makes sure that no __OBJC,__image_info section appears in the
8 # executable file built by the Xcode target that runs the script. If such a 8 # executable file built by the Xcode target that runs the script. If such a
9 # section appears, the script prints an error message and exits nonzero. 9 # section appears, the script prints an error message and exits nonzero.
10 # 10 #
11 # Why is this important? 11 # Why is this important?
12 # 12 #
13 # On 10.5, there's a bug in CFBundlePreflightExecutable that causes it to 13 # On 10.5, there's a bug in CFBundlePreflightExecutable that causes it to
14 # crash when operating in an executable that has not loaded at its default 14 # crash when operating in an executable that has not loaded at its default
15 # address (that is, when it's a position-independent executable with the 15 # address (that is, when it's a position-independent executable with the
16 # MH_PIE bit set in its mach_header) and the executable has an 16 # MH_PIE bit set in its mach_header) and the executable has an
17 # __OBJC,__image_info section. See http://crbug.com/88697. 17 # __OBJC,__image_info section. See http://crbug.com/88697.
18 # 18 #
19 # Chrome's main executables don't use any Objective-C at all, and don't need 19 # Chrome's main executables don't use any Objective-C at all, and don't need
20 # to carry this section around. Not linking them as Objective-C when they 20 # to carry this section around. Not linking them as Objective-C when they
21 # don't need it anyway saves about 4kB in the linked executable, although most 21 # don't need it anyway saves about 4kB in the linked executable, although most
22 # of that 4kB is just filled with zeroes. 22 # of that 4kB is just filled with zeroes.
23 # 23 #
24 # This script makes sure that nobody goofs and accidentally introduces these 24 # This script makes sure that nobody goofs and accidentally introduces these
25 # sections into the main executables. 25 # sections into the main executables.
26 26
27 set -eu 27 set -eu
28 28
29 otool="${DEVELOPER_BIN_DIR}/otool" 29 otool="${DEVELOPER_BIN_DIR:-/usr/bin}/otool"
30 executable="${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" 30 executable="${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}"
31 31
32 if "${otool}" -arch i386 -o "${executable}" | grep -q '^Contents.*section$'; \ 32 if "${otool}" -arch i386 -o "${executable}" | grep -q '^Contents.*section$'; \
33 then 33 then
34 echo "${0}: ${executable} has an __OBJC,__image_info section" 2>&1 34 echo "${0}: ${executable} has an __OBJC,__image_info section" 2>&1
35 exit 1 35 exit 1
36 fi 36 fi
37 37
38 if [[ ${PIPESTATUS[0]} -ne 0 ]]; then 38 if [[ ${PIPESTATUS[0]} -ne 0 ]]; then
39 echo "${0}: otool failed" 2>&1 39 echo "${0}: otool failed" 2>&1
40 exit 1 40 exit 1
41 fi 41 fi
42 42
43 exit 0 43 exit 0
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698