diff options
author | andybons <andybons@chromium.org> | 2015-08-17 19:15:20 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-18 02:16:07 +0000 |
commit | 465929bd9eccfd0de10965867e0378eee4a24dd5 (patch) | |
tree | 4129e7786ce1a6e3d8bbf7092a2fc50ac3f2df79 | |
parent | 83225c3e6386abc84c5162fee8832538371c7453 (diff) | |
download | chromium_src-465929bd9eccfd0de10965867e0378eee4a24dd5.zip chromium_src-465929bd9eccfd0de10965867e0378eee4a24dd5.tar.gz chromium_src-465929bd9eccfd0de10965867e0378eee4a24dd5.tar.bz2 |
Move rpath ldflags under is_component_build
The shared library flags currently being passed should only be passed in
component builds. The location of dylibs in a non-component build is already
known so it’s superfluous to specify additional search paths via rpath.
-search_paths_first is the default on ld starting with the Xcode4 toolchain.
-L. isn’t needed since the absolute path of the dylib is being specified at link time.
R=mark,dpranke,thakis
BUG=345021
Review URL: https://codereview.chromium.org/1298783003
Cr-Commit-Position: refs/heads/master@{#343793}
-rw-r--r-- | build/config/mac/BUILD.gn | 20 | ||||
-rw-r--r-- | build/toolchain/mac/BUILD.gn | 2 |
2 files changed, 12 insertions, 10 deletions
diff --git a/build/config/mac/BUILD.gn b/build/config/mac/BUILD.gn index 4a65d60..61c85bc 100644 --- a/build/config/mac/BUILD.gn +++ b/build/config/mac/BUILD.gn @@ -18,20 +18,22 @@ config("sdk") { # On Mac, this is used for everything except static libraries. config("mac_dynamic_flags") { - ldflags = [ - "-Wl,-search_paths_first", - "-L.", + ldflags = [] - # Path for loading shared libraries for unbundled binaries. - "-Wl,-rpath,@loader_path/.", + if (is_component_build) { + ldflags += [ + # Path for loading shared libraries for unbundled binaries. + "-Wl,-rpath,@loader_path/.", - # Path for loading shared libraries for bundled binaries. Get back from - # Binary.app/Contents/MacOS. - "-Wl,-rpath,@loader_path/../../..", - ] + # Path for loading shared libraries for bundled binaries. Get back from + # Binary.app/Contents/MacOS. + "-Wl,-rpath,@loader_path/../../..", + ] + } } # On Mac, this is used only for executables. config("mac_executable_flags") { + # Remove this when targeting >=10.7 since it is the default in that config. ldflags = [ "-Wl,-pie" ] # Position independent. } diff --git a/build/toolchain/mac/BUILD.gn b/build/toolchain/mac/BUILD.gn index 7f63f6f..2ef06d5 100644 --- a/build/toolchain/mac/BUILD.gn +++ b/build/toolchain/mac/BUILD.gn @@ -114,7 +114,7 @@ template("mac_toolchain") { dylib = "{{root_out_dir}}/{{target_output_name}}{{output_extension}}" # eg "./libfoo.dylib" rspfile = dylib + ".rsp" - # These variables are not build into GN but are helpers that implement + # 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. |