Chromium Code Reviews| Index: build/mac/copy_asan_runtime_dylib.sh |
| =================================================================== |
| --- build/mac/copy_asan_runtime_dylib.sh (revision 208704) |
| +++ build/mac/copy_asan_runtime_dylib.sh (working copy) |
| @@ -6,7 +6,7 @@ |
| # For app bundles built with ASan, copies the runtime lib |
| # (libclang_rt.asan_osx_dynamic.dylib), on which their executables depend, from |
| -# the compiler installation path to appname.app/Contents/Resources and fixes the |
| +# the compiler installation path to appname.app/Contents/Libraries and fixes the |
| # dylib's install name in the binary to be relative to @executable_path. |
| set -e |
| @@ -35,12 +35,22 @@ |
| exit 1 |
| fi |
| -LIBRARIES_DIR="$(dirname "${BINARY_DIR}")/Libraries" |
| -mkdir -p "${LIBRARIES_DIR}" |
| +# Check whether the directory containing the executable binary has an .app |
|
stuartmorgan
2013/07/01 09:09:12
Update comment to reflect code.
Alexander Potapenko
2013/07/01 09:52:52
Done.
|
| +# extension. In this case we're probably building an iOS gtest app, |
| +# otherwise it is a regular OSX application. |
| +BINARY_DIR_EXT=$(echo "${BINARY_DIR}" | sed 's/^.*\.//') |
|
stuartmorgan
2013/07/01 09:09:12
Unused now.
Alexander Potapenko
2013/07/01 09:52:52
Done.
|
| +UPPER_DIR=$(dirname "${BINARY_DIR}") |
| +if [ "${UPPER_DIR}" == "MacOS" ]; then |
| + LIBRARIES_DIR="${UPPER_DIR}/Libraries" |
| + mkdir -p "${LIBRARIES_DIR}" |
| + NEW_LC_ID_DYLIB="@executable_path/../Libraries/${ASAN_DYLIB_NAME}" |
| +else |
| + LIBRARIES_DIR="${BINARY_DIR}" |
| + NEW_LC_ID_DYLIB="@executable_path/${ASAN_DYLIB_NAME}" |
| +fi |
| + |
| cp "${ASAN_DYLIB}" "${LIBRARIES_DIR}" |
| -NEW_LC_ID_DYLIB="@executable_path/../Libraries/${ASAN_DYLIB_NAME}" |
| - |
| # Make LC_ID_DYLIB of the runtime copy point to its location. |
| install_name_tool \ |
| -id "${NEW_LC_ID_DYLIB}" \ |