[PATCH] D25761: Use linker flag --fix-cortex-a53-843419 on Android ARM64 compilation.

Stephen Hines via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 19 01:58:52 PDT 2016


srhines created this revision.
srhines added a reviewer: cfe-commits.
srhines added subscribers: danalbert, pirama.
Herald added subscribers: tberghammer, rengolin, aemerson.

This is only forced on if there is no non-Cortex-A53 CPU specified as
well. Android's platform and NDK builds need to assume that the code can
be run on Cortex-A53 devices, so we always enable the fix unless we know
specifically that the code is only running on a different kind of CPU.


https://reviews.llvm.org/D25761

Files:
  lib/Driver/Tools.cpp


Index: lib/Driver/Tools.cpp
===================================================================
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -9677,6 +9677,14 @@
   if (Arch == llvm::Triple::armeb || Arch == llvm::Triple::thumbeb)
     arm::appendEBLinkFlags(Args, CmdArgs, Triple);
 
+  // Most Android ARM64 targets should enable the linker fix for erratum
+  // 843419. Only non-Cortex-A53 devices are allowed to skip this flag.
+  if (Arch == llvm::Triple::aarch64 && isAndroid) {
+    std::string CPU = getCPUName(Args, Triple);
+    if (CPU.empty() || CPU == "generic" || CPU == "cortex-a53")
+      CmdArgs.push_back("--fix-cortex-a53-843419");
+  }
+
   for (const auto &Opt : ToolChain.ExtraOpts)
     CmdArgs.push_back(Opt.c_str());
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25761.75119.patch
Type: text/x-patch
Size: 752 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161019/0e2168e8/attachment.bin>


More information about the cfe-commits mailing list