diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
commit | d8bbc7858622b6d9c278469aab701ca0b609cddf (patch) | |
tree | eff41dc61d9f714852212739e6b3738b82a2af87 /build/build-clang/arm64e-hack.patch | |
parent | Releasing progress-linux version 125.0.3-1~progress7.99u1. (diff) | |
download | firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'build/build-clang/arm64e-hack.patch')
-rw-r--r-- | build/build-clang/arm64e-hack.patch | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/build/build-clang/arm64e-hack.patch b/build/build-clang/arm64e-hack.patch new file mode 100644 index 0000000000..8856fd2f5b --- /dev/null +++ b/build/build-clang/arm64e-hack.patch @@ -0,0 +1,52 @@ +Add hackish support for arm64e to LLD + +The current lld output is known as arm64e.old. This hack adds the right flag to +make it appear as arm64e. + +An upstreamable solution would be more involved. + +diff --git a/lld/MachO/Driver.cpp b/lld/MachO/Driver.cpp +index 14c111ce9685..45fa7c59c420 100644 +--- a/lld/MachO/Driver.cpp ++++ b/lld/MachO/Driver.cpp +@@ -773,8 +773,13 @@ static TargetInfo *createTargetInfo(InputArgList &args) { + switch (cpuType) { + case CPU_TYPE_X86_64: + return createX86_64TargetInfo(); +- case CPU_TYPE_ARM64: +- return createARM64TargetInfo(); ++ case CPU_TYPE_ARM64: { ++ auto target = createARM64TargetInfo(); ++ if (cpuSubtype == CPU_SUBTYPE_ARM64E) { ++ target->cpuSubtype = CPU_SUBTYPE_ARM64E | CPU_SUBTYPE_PTRAUTH_ABI; ++ } ++ return target; ++ } + case CPU_TYPE_ARM64_32: + return createARM64_32TargetInfo(); + default: +diff --git a/lldb/include/lldb/Host/SafeMachO.h b/lldb/include/lldb/Host/SafeMachO.h +index 0540383b8c52..a7650f760305 100644 +--- a/lldb/include/lldb/Host/SafeMachO.h ++++ b/lldb/include/lldb/Host/SafeMachO.h +@@ -115,6 +115,8 @@ + #undef CPU_SUBTYPE_MC980000_ALL + #undef CPU_SUBTYPE_MC98601 + ++#undef CPU_SUBTYPE_PTRAUTH_ABI ++ + #undef VM_PROT_READ + #undef VM_PROT_WRITE + #undef VM_PROT_EXECUTE +diff --git a/llvm/include/llvm/BinaryFormat/MachO.h b/llvm/include/llvm/BinaryFormat/MachO.h +index bef70f869520..7dfe5d031381 100644 +--- a/llvm/include/llvm/BinaryFormat/MachO.h ++++ b/llvm/include/llvm/BinaryFormat/MachO.h +@@ -1578,6 +1578,7 @@ enum : uint32_t { + // Capability bits used in the definition of cpusubtype. + CPU_SUBTYPE_MASK = 0xff000000, // Mask for architecture bits + CPU_SUBTYPE_LIB64 = 0x80000000, // 64 bit libraries ++ CPU_SUBTYPE_PTRAUTH_ABI = 0x80000000, // pointer authentication with versioned ABI + + // Special CPU subtype constants. + CPU_SUBTYPE_MULTIPLE = ~0u |