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

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

Issue 1934853002: 👕 Fix Android arm64 executables not linking in component builds (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Also add sysroot Created 4 years, 8 months 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/android/BUILD.gn
diff --git a/build/config/android/BUILD.gn b/build/config/android/BUILD.gn
index ec3b531171d5fc17630fb763b2abef88804362a6..b44a855098ed53948d5b9d9c72760e8fedb6b7c4 100644
--- a/build/config/android/BUILD.gn
+++ b/build/config/android/BUILD.gn
@@ -8,6 +8,8 @@ import("//build/config/sysroot.gni")
assert(is_android)
+use_gold = current_cpu == "x86" || current_cpu == "x64" || current_cpu == "arm"
+
# This is included by reference in the //build/config/compiler config that
# is applied to all targets. It is here to separate out the logic that is
# Android-only.
@@ -43,7 +45,7 @@ config("compiler") {
}
# Use gold for Android for most CPU architectures.
- if (current_cpu == "x86" || current_cpu == "x64" || current_cpu == "arm") {
+ if (use_gold) {
ldflags += [ "-fuse-ld=gold" ]
if (is_clang) {
# Let clang find the ld.gold in the NDK.
@@ -179,6 +181,12 @@ config("executable_config") {
cflags = [ "-fPIE" ]
asmflags = [ "-fPIE" ]
ldflags = [ "-pie" ]
+
+ if (!use_gold) {
jbudorick 2016/05/02 17:18:05 Why is this only in executable_config? Do we need
agrieve 2016/05/02 17:20:33 For the most part, I don't know, but it doesn't se
jbudorick 2016/05/02 17:40:32 I'm reading this as "the build completed locally t
+ # ld needs help finding libraries when linking.
+ _rebased_sysroot = rebase_path(sysroot, root_build_dir)
+ ldflags += [ "-Wl,-rpath-link=.:$_rebased_sysroot/usr/lib" ]
+ }
}
config("hide_native_jni_exports") {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698