Commit 3b3db143 authored by Tom Anderson's avatar Tom Anderson Committed by Commit Bot

Add RPATH to shared libraries

Fixes libfontconfig.so not being able to find libfreetype_harfbuzz.so:

$ ldd libfontconfig.so | grep freetype_harfbuzz
	libfreetype_harfbuzz.so => not found
$ ls libfreetype_harfbuzz.so
libfreetype_harfbuzz.so

R=thakis

Bug: 911836,912366
Change-Id: Ia0aaed8fc2c745b02cecf9ee3ce9888c1d8ccf77
Reviewed-on: https://chromium-review.googlesource.com/c/1362457
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: default avatarDirk Pranke <dpranke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#614255}
parent 3cd31839
......@@ -385,6 +385,8 @@ config("shared_library_config") {
configs += [ "//build/config/ios:ios_dynamic_flags" ]
} else if (is_chromecast) {
configs += [ "//build/config/chromecast:shared_library_config" ]
} else if (is_linux || current_os == "aix") {
configs += [ "//build/config/gcc:shared_library_config" ]
}
# If we're using the prebuilt instrumented libraries with the sanitizers, we
......
......@@ -84,20 +84,24 @@ config("rpath_for_built_shared_libraries") {
}
}
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_ = []
}
# Settings for executables.
config("executable_config") {
configs = executable_and_shared_library_configs_
ldflags = [ "-pie" ]
if (is_android) {
ldflags += [
"-Bdynamic",
"-Wl,-z,nocopyreloc",
]
} else {
# See the rpath_for... config above for why this is necessary for component
# builds.
if (is_component_build) {
configs = [ ":rpath_for_built_shared_libraries" ]
}
}
if (!is_android && current_os != "aix") {
......@@ -116,3 +120,8 @@ config("executable_config") {
]
}
}
# Settings for shared libraries.
config("shared_library_config") {
configs = executable_and_shared_library_configs_
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment