| Index: build/config/mac/BUILD.gn
|
| diff --git a/build/config/mac/BUILD.gn b/build/config/mac/BUILD.gn
|
| index 4a65d6017611212b1f51a97f7abad2a43d195be8..61c85bcc10909d8d37402d3135e711e1fbf3d85f 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.
|
| }
|
|
|