Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3263)

Unified Diff: build/config/gcc/BUILD.gn

Issue 1448213002: Only set -rpath=$ORIGIN in component builds by default. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: refactor to make base_unittests pass Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/gcc/BUILD.gn
diff --git a/build/config/gcc/BUILD.gn b/build/config/gcc/BUILD.gn
index b6ab1d4b96ba7ba9a39409006f949569551f92d2..9bc16d9e0d918096cec7124ccf20f145643824b8 100644
--- a/build/config/gcc/BUILD.gn
+++ b/build/config/gcc/BUILD.gn
@@ -20,14 +20,8 @@ config("symbol_visibility_hidden") {
cflags = [ "-fvisibility=hidden" ]
}
-# Settings for executables and shared libraries.
-config("executable_ldconfig") {
- if (is_android) {
- ldflags = [
- "-Bdynamic",
- "-Wl,-z,nocopyreloc",
- ]
- } else {
+config("rpath_link") {
+ if (!is_android) {
# Note: Android doesn't support rpath.
rpath_link = ""
if (shlib_subdir != ".") {
@@ -37,7 +31,25 @@ config("executable_ldconfig") {
# Want to pass "\$". GN will re-escape as required for ninja.
"-Wl,-rpath=\$ORIGIN/${rpath_link}",
"-Wl,-rpath-link=${rpath_link}",
+ ]
+ }
+}
+# Settings for executables and shared libraries.
+config("executable_ldconfig") {
+ if (is_android) {
+ ldflags = [
+ "-Bdynamic",
+ "-Wl,-z,nocopyreloc",
+ ]
+ } else {
+ if (is_component_build) {
+ configs += [ ":rpath_link" ]
+ }
+
+ ldflags = [
+ # TODO(GYP): Do we need a check on the binutils version here?
+ #
# Newer binutils don't set DT_RPATH unless you disable "new" dtags
# and the new DT_RUNPATH doesn't work without --no-as-needed flag.
"-Wl,--disable-new-dtags",
« no previous file with comments | « base/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698