Index: build/config/posix/BUILD.gn |
diff --git a/build/config/posix/BUILD.gn b/build/config/posix/BUILD.gn |
index 11cad83d0755bdf1bd448c63355f422942fef144..057efb82a19e4de1127705f788ce841c0aa56c05 100644 |
--- a/build/config/posix/BUILD.gn |
+++ b/build/config/posix/BUILD.gn |
@@ -25,12 +25,19 @@ config("runtime_library") { |
ldflags = cflags |
# Need to get some linker flags out of the sysroot. |
- ldflags += exec_script("sysroot_ld_path.py", |
+ ld_paths = exec_script("sysroot_ld_path.py", |
[ |
rebase_path("//build/linux/sysroot_ld_path.sh", |
root_build_dir), |
rebase_path(sysroot), |
], |
"list lines") |
+ foreach(ld_path, ld_paths) { |
+ ld_path = rebase_path(ld_path, root_build_dir) |
+ ldflags += [ |
+ "-L" + ld_path, |
+ "-Wl,-rpath-link=" + ld_path, |
+ ] |
+ } |
} |
} |