aboutsummaryrefslogtreecommitdiff
path: root/build/tools
diff options
context:
space:
mode:
authorPeter Collingbourne <pcc@google.com>2018-08-28 16:04:23 -0700
committerPeter Collingbourne <pcc@google.com>2018-08-28 16:09:13 -0700
commitb64266eafd6eef7c2839c63957c112de337d7d5a (patch)
treeafd93938a2bd49aadd2b6eb16e7387ab9b842f32 /build/tools
parent31a860014cc856b495e6600c86ea82e2b6d0972f (diff)
downloadndk-b64266eafd6eef7c2839c63957c112de337d7d5a.tar.gz
Build GCC prebuilts with x18 reserved.
Once https://reviews.llvm.org/D45588 lands in our copy of Clang we should get x18 reserved in everything built by Clang, but that won't cover the prebuilts built by GCC (most notably libgcc.a). This CL changes the cflags and cxxflags that we pass to GCC so that libgcc.a is built with x18 reserved. Bug: 112907825 Test: cd toolchain/gcc && python build.py --toolchain aarch64-linux-android Change-Id: I9d40356dae89ca24fbea34c89acdf86a1cc28b2d
Diffstat (limited to 'build/tools')
-rw-r--r--build/tools/prebuilt-common.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/build/tools/prebuilt-common.sh b/build/tools/prebuilt-common.sh
index 324f73751..2d459107d 100644
--- a/build/tools/prebuilt-common.sh
+++ b/build/tools/prebuilt-common.sh
@@ -1037,6 +1037,10 @@ parse_toolchain_name ()
ARCH="arm64"
ABI="arm64-v8a"
ABI_CONFIGURE_TARGET="aarch64-linux-android"
+ # Reserve the platform register, x18. This should happen automatically
+ # with clang but we need to pass it manually when compiling with gcc.
+ ABI_CFLAGS_FOR_TARGET="-ffixed-x18"
+        ABI_CXXFLAGS_FOR_TARGET="-ffixed-x18"
;;
x86-*)
ARCH="x86"