diff options
author | andybons <andybons@chromium.org> | 2015-08-18 14:04:55 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-18 21:05:28 +0000 |
commit | f6982d816ef5a3bb63c1977bfe24663b07c03648 (patch) | |
tree | 0d782e38d574e79171c687870c0220469f705bde | |
parent | 3d4f5582811575182af4cf7ccc20889c36cfd68e (diff) | |
download | chromium_src-f6982d816ef5a3bb63c1977bfe24663b07c03648.zip chromium_src-f6982d816ef5a3bb63c1977bfe24663b07c03648.tar.gz chromium_src-f6982d816ef5a3bb63c1977bfe24663b07c03648.tar.bz2 |
Specify -install_name of target within solink.
R=dpranke@chromium.org,thakis@chromium.org,mark@chromium.org
BUG=345410,345021
Review URL: https://codereview.chromium.org/1288863005
Cr-Commit-Position: refs/heads/master@{#344027}
-rw-r--r-- | build/toolchain/mac/BUILD.gn | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/build/toolchain/mac/BUILD.gn b/build/toolchain/mac/BUILD.gn index 2ef06d5..e8fe804 100644 --- a/build/toolchain/mac/BUILD.gn +++ b/build/toolchain/mac/BUILD.gn @@ -117,7 +117,7 @@ template("mac_toolchain") { # These variables are not built into GN but are helpers that implement # (1) linking to produce a .so, (2) extracting the symbols from that file # to a temporary file, (3) if the temporary file has differences from the - # existing .TOC file, overwrite it, oterwise, don't change it. + # existing .TOC file, overwrite it, otherwise, don't change it. # # As a special case, if the library reexports symbols from other dynamic # libraries, we always update the .TOC and skip the temporary file and @@ -126,7 +126,13 @@ template("mac_toolchain") { temporary_tocname = dylib + ".tmp" does_reexport_command = "[ ! -e $dylib -o ! -e $tocname ] || otool -l $dylib | grep -q LC_REEXPORT_DYLIB" - link_command = "$ld -shared {{ldflags}} -o $dylib -Wl,-filelist,$rspfile {{solibs}} {{libs}}" + + link_command = "$ld -shared {{ldflags}} -o $dylib -Wl,-filelist,$rspfile" + if (is_component_build) { + link_command += " -Wl,-install_name,@rpath/{{target_output_name}}{{output_extension}}" + } + link_command += " {{solibs}} {{libs}}" + replace_command = "if ! cmp -s $temporary_tocname $tocname; then mv $temporary_tocname $tocname" extract_toc_command = "{ otool -l $dylib | grep LC_ID_DYLIB -A 5; nm -gP $dylib | cut -f1-2 -d' ' | grep -v U\$\$; true; }" |