musllvm/patches/llvm/0003-llvm-fix-some-MF_EXEC-related-test-failures-on-aarch.patch
cowmonk 6110995cfb Initial stub of a Makefile and patches for LLVM
Nothing much, but getting some patches from chimera linux that should
work.
2025-10-25 16:23:17 -07:00

26 lines
1.1 KiB
Diff

From f9afee0ee3d452b701cfaa5b61729a46a97c36ce Mon Sep 17 00:00:00 2001
From: q66 <q66@chimera-linux.org>
Date: Tue, 2 May 2023 16:04:20 +0200
Subject: [PATCH 03/29] llvm: fix some MF_EXEC related test failures on aarch64
https://bugs.llvm.org/show_bug.cgi?id=14278#c10
---
llvm/lib/Support/Unix/Memory.inc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/lib/Support/Unix/Memory.inc b/llvm/lib/Support/Unix/Memory.inc
index bac208a7d..4cb941d39 100644
--- a/llvm/lib/Support/Unix/Memory.inc
+++ b/llvm/lib/Support/Unix/Memory.inc
@@ -50,7 +50,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
llvm::sys::Memory::MF_EXEC:
return PROT_READ | PROT_WRITE | PROT_EXEC;
case llvm::sys::Memory::MF_EXEC:
-#if defined(__FreeBSD__) || defined(__powerpc__)
+#if defined(__FreeBSD__) || defined(__powerpc__) || (defined(__linux__) && defined(__aarch64__))
// On PowerPC, having an executable page that has no read permission
// can have unintended consequences. The function InvalidateInstruction-
// Cache uses instructions dcbf and icbi, both of which are treated by
--
2.49.0