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

Side by Side Diff: build/mac/copy_asan_runtime_dylib.sh

Issue 11642018: Add a postbuild action for executables built with ASan on Mac OS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 10 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
« build/common.gypi ('K') | « build/common.gypi ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:executable
+ *
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 #!/bin/bash
2
3 # For executables built with ASan, copies the runtime lib
4 # (libclang_rt.asan_osx_dynamic.dylib) on which they depend from the compiler
5 # installation path to the build dir and fixes the dylib's install name in the
6 # binary to be relative to @executable_path. This is needed if the executables
7 # are copied to a different machine (the ASan runtime library must be copied in
8 # this case as well).
9
10 set -e
11 set -x
12
13 BINARY="${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}"
14 BINARY_PATH="$(dirname "${BINARY}")"
15 RUNTIME_PATTERN="asan_osx_dynamic.dylib"
16 RUNTIME_LIB="$(otool -L "${BINARY}" |
17 grep "${RUNTIME_PATTERN}" |
18 tr -d '\011' | # remove leading tab
19 sed "s/${RUNTIME_PATTERN}.*/${RUNTIME_PATTERN}/")"
20 if [ -z "${RUNTIME_LIB}" ]
21 then
22 # TODO(glider): report an error here once we switch to ASan with dynamic
23 # runtime.
24 exit 0
25 fi
26
27 RUNTIME_FNAME="$(basename "${RUNTIME_LIB}")"
28 cp "${RUNTIME_LIB}" "${BINARY_PATH}"
29 #install_name_tool \
30 # -change "${RUNTIME_LIB}" "@executable_path/${RUNTIME_FNAME}" "${BINARY}"
31 touch "${BINARY_PATH}"/"${RUNTIME_LIB}"
OLDNEW
« build/common.gypi ('K') | « build/common.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698