[PATCH] D136703: [Driver][Fuchsia] Make -mfix-cortex-a53-835769 default when targeting Fuchsia

Alex Brachet via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 25 12:18:36 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG4981a186b3aa: [Driver][Fuchsia] Make -mfix-cortex-a53-835769 default when targeting Fuchsia (authored by abrachet).
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136703/new/

https://reviews.llvm.org/D136703

Files:
  clang/lib/Driver/ToolChains/Arch/AArch64.cpp
  clang/test/Driver/aarch64-fix-cortex-a53-835769.c


Index: clang/test/Driver/aarch64-fix-cortex-a53-835769.c
===================================================================
--- clang/test/Driver/aarch64-fix-cortex-a53-835769.c
+++ clang/test/Driver/aarch64-fix-cortex-a53-835769.c
@@ -8,6 +8,12 @@
 // RUN: %clang -target aarch64-android-eabi %s -### 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-YES %s
 
+// RUN: %clang --target=aarch64-fuchsia %s -### 2>&1 \
+// RUN:   | FileCheck --check-prefix=CHECK-YES %s
+
+// RUN: %clang --target=aarch64-fuchsia -mcpu=cortex-a73 %s -### 2>&1 \
+// RUN:   | FileCheck --check-prefix=CHECK-DEF %s
+
 // CHECK-DEF-NOT: "{[+-]}fix-cortex-a53-835769"
 // CHECK-YES: "+fix-cortex-a53-835769"
 // CHECK-NO: "-fix-cortex-a53-835769"
Index: clang/lib/Driver/ToolChains/Arch/AArch64.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Arch/AArch64.cpp
+++ clang/lib/Driver/ToolChains/Arch/AArch64.cpp
@@ -7,6 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "AArch64.h"
+#include "../CommonArgs.h"
 #include "clang/Driver/Driver.h"
 #include "clang/Driver/DriverDiagnostic.h"
 #include "clang/Driver/Options.h"
@@ -615,6 +616,10 @@
   } else if (Triple.isAndroid()) {
     // Enabled A53 errata (835769) workaround by default on android
     Features.push_back("+fix-cortex-a53-835769");
+  } else if (Triple.isOSFuchsia()) {
+    std::string CPU = getCPUName(D, Args, Triple);
+    if (CPU.empty() || CPU == "generic" || CPU == "cortex-a53")
+      Features.push_back("+fix-cortex-a53-835769");
   }
 
   if (Args.getLastArg(options::OPT_mno_bti_at_return_twice))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136703.470591.patch
Type: text/x-patch
Size: 1661 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221025/62282709/attachment.bin>


More information about the cfe-commits mailing list