From e2b8f5709a09ebcbd6d2c93560d65f51c8dd43ea Mon Sep 17 00:00:00 2001 From: Alexey Gladkov Date: Mon, 27 Mar 2017 20:13:53 +0000 Subject: [PATCH] ALT: Use rpath-link and absolute rpath Signed-off-by: Alexey Gladkov --- build/config/BUILD.gn | 2 +- build/config/gcc/BUILD.gn | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/build/config/BUILD.gn b/build/config/BUILD.gn index ed94a16a017..c404ee38392 100644 --- a/build/config/BUILD.gn +++ b/build/config/BUILD.gn @@ -339,21 +339,21 @@ config("shared_library_config") { } else if (is_mac) { configs += [ "//build/config/mac:mac_dynamic_flags" ] } else if (is_ios) { configs += [ "//build/config/ios:ios_dynamic_flags", "//build/config/ios:ios_shared_library_flags", ] } else if (is_chromecast) { configs += [ "//build/config/chromecast:shared_library_config" ] } else if (is_linux || is_chromeos || current_os == "aix") { - configs += [ "//build/config/gcc:shared_library_config" ] + configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ] } # If we're using the prebuilt instrumented libraries with the sanitizers, we # need to add ldflags to every binary to make sure they are picked up. if (prebuilt_instrumented_libraries_available) { configs += [ "//third_party/instrumented_libraries:prebuilt_ldflags" ] } if (use_locally_built_instrumented_libraries) { configs += [ "//third_party/instrumented_libraries:locally_built_ldflags" ] } diff --git a/build/config/gcc/BUILD.gn b/build/config/gcc/BUILD.gn index 154b259b5fa..6ebdf6063b6 100644 --- a/build/config/gcc/BUILD.gn +++ b/build/config/gcc/BUILD.gn @@ -69,20 +69,21 @@ config("rpath_for_built_shared_libraries") { ldflags = [ # Want to pass "\$". GN will re-escape as required for ninja. "-Wl,-rpath=\$ORIGIN", ] } else { ldflags = [ "-Wl,-rpath=${gcc_target_rpath}" ] } if (current_toolchain == default_toolchain && ldso_path != "") { ldflags += [ "-Wl,--dynamic-linker=${ldso_path}" ] } + ldflags += [ "-Wl,-rpath=" + getenv("CHROMIUM_RPATH") ] } } if (is_component_build && !is_android) { # See the rpath_for... config above for why this is necessary for component # builds. executable_and_shared_library_configs_ = [ ":rpath_for_built_shared_libraries" ] } else { executable_and_shared_library_configs_ = [] -- 2.25.4