ldc/ldc-1.32.2-llvm-16-fix-aarch64-support.patch

30 lines
982 B
Diff

From 25cf7f83ce7e1b071912a015b366ce8f71783306 Mon Sep 17 00:00:00 2001
From: Ikey Doherty <ikey@serpentos.com>
Date: Mon, 22 May 2023 09:06:43 +0100
Subject: [PATCH] driver/targetmachine: Fix aarch64 support for LLVM >= 1600
This isn't *the* most ideal approach and in future we may want
to select specific fallbacks other than "generic".
Signed-off-by: Ikey Doherty <ikey@serpentos.com>
---
driver/targetmachine.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/driver/targetmachine.cpp b/driver/targetmachine.cpp
index be47a1dc93..3f16e20813 100644
--- a/driver/targetmachine.cpp
+++ b/driver/targetmachine.cpp
@@ -203,9 +203,11 @@ static std::string getARMTargetCPU(const llvm::Triple &triple) {
}
static std::string getAArch64TargetCPU(const llvm::Triple &triple) {
+#if LDC_LLVM_VER < 1600
auto defaultCPU = llvm::AArch64::getDefaultCPU(triple.getArchName());
if (!defaultCPU.empty())
return std::string(defaultCPU);
+#endif
return "generic";
}