Index: build/config/gcc/BUILD.gn |
diff --git a/build/config/gcc/BUILD.gn b/build/config/gcc/BUILD.gn |
index 62eec11904ac93b8cf26f75e76796c0881559dcd..17414467e76ee9a906d7e9bf4d1789933c9128c7 100644 |
--- a/build/config/gcc/BUILD.gn |
+++ b/build/config/gcc/BUILD.gn |
@@ -2,9 +2,7 @@ |
# Use of this source code is governed by a BSD-style license that can be |
# found in the LICENSE file. |
-import("//build/config/compiler/compiler.gni") |
import("//build/config/sanitizers/sanitizers.gni") |
-import("//build/config/sysroot.gni") |
import("//build/toolchain/toolchain.gni") |
# This config causes functions not to be automatically exported from shared |
@@ -71,9 +69,8 @@ config("rpath_for_built_shared_libraries") { |
# Settings for executables. |
config("executable_ldconfig") { |
- ldflags = [] |
if (is_android) { |
- ldflags += [ |
+ ldflags = [ |
"-Bdynamic", |
"-Wl,-z,nocopyreloc", |
] |
@@ -83,26 +80,19 @@ config("executable_ldconfig") { |
if (is_component_build || using_sanitizer) { |
configs = [ ":rpath_for_built_shared_libraries" ] |
} |
- if (current_cpu == "mipsel") { |
- ldflags += [ "-pie" ] |
- } |
- } |
- if (!is_android || !use_gold) { |
# Find the path containing shared libraries for this toolchain |
# relative to the build directory. ${root_out_dir} will be a |
# subdirectory of ${root_build_dir} when cross compiling. |
- _rpath_link = rebase_path(root_out_dir, root_build_dir) |
+ rebased_out_dir = rebase_path(root_out_dir, root_build_dir) |
if (shlib_subdir != ".") { |
- _rpath_link += "/$shlib_subdir" |
- } |
- if (is_android) { |
- _rebased_sysroot = rebase_path(sysroot, root_build_dir) |
- _rpath_link += ":$_rebased_sysroot/usr/lib" |
+ rpath_link = "${rebased_out_dir}/${shlib_subdir}" |
+ } else { |
+ rpath_link = rebased_out_dir |
} |
- ldflags += [ |
- "-Wl,-rpath-link=$_rpath_link", |
+ ldflags = [ |
+ "-Wl,-rpath-link=${rpath_link}", |
# TODO(GYP): Do we need a check on the binutils version here? |
# |
@@ -110,6 +100,9 @@ config("executable_ldconfig") { |
# and the new DT_RUNPATH doesn't work without --no-as-needed flag. |
"-Wl,--disable-new-dtags", |
] |
+ if (current_cpu == "mipsel") { |
+ ldflags += [ "-pie" ] |
+ } |
} |
} |