-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clang-14, llvm-14: restore functionality on macOS 15 (Xcode 16)
This is a cherry-pick of: llvm/llvm-project@c57c7b7 llvm/llvm-project@7939ce3 This enables clang-14 to be built by Xcode 16, making it possible to build on macOS 15, and macOS 14 with Xcode 16. It also enables clang-14 to be built by clang-18 and newer. References: https://trac.macports.org/ticket/70779
- Loading branch information
1 parent
2605e66
commit 2b4d892
Showing
3 changed files
with
156 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
121 changes: 121 additions & 0 deletions
121
lang/llvm-14/files/0033-xray-Use-L-instead-of-.L-for-Mach-O.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
From c57c7b7c99605021123b54c02e57943923874cbe Mon Sep 17 00:00:00 2001 | ||
From: Fangrui Song <[email protected]> | ||
Date: Fri, 16 Jun 2023 12:04:28 -0700 | ||
Subject: [PATCH] [xray] Use L* instead of .L* for Mach-O | ||
|
||
Note: Mach-O support is not yet done and check-xray is not allowed yet. | ||
--- | ||
compiler-rt/lib/xray/xray_trampoline_x86_64.S | 28 +++++++++---------- | ||
1 file changed, 14 insertions(+), 14 deletions(-) | ||
|
||
diff --git a/compiler-rt/lib/xray/xray_trampoline_x86_64.S b/compiler-rt/lib/xray/xray_trampoline_x86_64.S | ||
index 02cf69f766c4..0f00bcc41508 100644 | ||
--- a/compiler-rt/lib/xray/xray_trampoline_x86_64.S | ||
+++ b/compiler-rt/lib/xray/xray_trampoline_x86_64.S | ||
@@ -124,14 +124,14 @@ ASM_SYMBOL(__xray_FunctionEntry): | ||
// On x86/amd64, a simple (type-aligned) MOV instruction is enough. | ||
movq ASM_SYMBOL(_ZN6__xray19XRayPatchedFunctionE)(%rip), %rax | ||
testq %rax, %rax | ||
- je .Ltmp0 | ||
+ je LOCAL_LABEL(tmp0) | ||
|
||
// The patched function prologue puts its xray_instr_map index into %r10d. | ||
movl %r10d, %edi | ||
xor %esi,%esi | ||
callq *%rax | ||
|
||
-.Ltmp0: | ||
+LOCAL_LABEL(tmp0): | ||
RESTORE_REGISTERS | ||
RESTORE_STACK_ALIGNMENT | ||
retq | ||
@@ -162,13 +162,13 @@ ASM_SYMBOL(__xray_FunctionExit): | ||
movq %rdx, 0(%rsp) | ||
movq ASM_SYMBOL(_ZN6__xray19XRayPatchedFunctionE)(%rip), %rax | ||
testq %rax,%rax | ||
- je .Ltmp2 | ||
+ je LOCAL_LABEL(tmp2) | ||
|
||
movl %r10d, %edi | ||
movl $1, %esi | ||
callq *%rax | ||
|
||
-.Ltmp2: | ||
+LOCAL_LABEL(tmp2): | ||
// Restore the important registers. | ||
movq 48(%rsp), %rbp | ||
movupd 32(%rsp), %xmm0 | ||
@@ -198,13 +198,13 @@ ASM_SYMBOL(__xray_FunctionTailExit): | ||
|
||
movq ASM_SYMBOL(_ZN6__xray19XRayPatchedFunctionE)(%rip), %rax | ||
testq %rax,%rax | ||
- je .Ltmp4 | ||
+ je LOCAL_LABEL(tmp4) | ||
|
||
movl %r10d, %edi | ||
movl $2, %esi | ||
callq *%rax | ||
|
||
-.Ltmp4: | ||
+LOCAL_LABEL(tmp4): | ||
RESTORE_REGISTERS | ||
RESTORE_STACK_ALIGNMENT | ||
retq | ||
@@ -227,14 +227,14 @@ ASM_SYMBOL(__xray_ArgLoggerEntry): | ||
// Again, these function pointer loads must be atomic; MOV is fine. | ||
movq ASM_SYMBOL(_ZN6__xray13XRayArgLoggerE)(%rip), %rax | ||
testq %rax, %rax | ||
- jne .Larg1entryLog | ||
+ jne LOCAL_LABEL(arg1entryLog) | ||
|
||
// If [arg1 logging handler] not set, defer to no-arg logging. | ||
movq ASM_SYMBOL(_ZN6__xray19XRayPatchedFunctionE)(%rip), %rax | ||
testq %rax, %rax | ||
- je .Larg1entryFail | ||
+ je LOCAL_LABEL(arg1entryFail) | ||
|
||
-.Larg1entryLog: | ||
+LOCAL_LABEL(arg1entryLog): | ||
|
||
// First argument will become the third | ||
movq %rdi, %rdx | ||
@@ -247,7 +247,7 @@ ASM_SYMBOL(__xray_ArgLoggerEntry): | ||
|
||
callq *%rax | ||
|
||
-.Larg1entryFail: | ||
+LOCAL_LABEL(arg1entryFail): | ||
RESTORE_REGISTERS | ||
RESTORE_STACK_ALIGNMENT | ||
retq | ||
@@ -270,11 +270,11 @@ ASM_SYMBOL(__xray_CustomEvent): | ||
// already. | ||
movq ASM_SYMBOL(_ZN6__xray22XRayPatchedCustomEventE)(%rip), %rax | ||
testq %rax,%rax | ||
- je .LcustomEventCleanup | ||
+ je LOCAL_LABEL(customEventCleanup) | ||
|
||
callq *%rax | ||
|
||
-.LcustomEventCleanup: | ||
+LOCAL_LABEL(customEventCleanup): | ||
RESTORE_REGISTERS | ||
retq | ||
# LLVM-MCA-END | ||
@@ -296,11 +296,11 @@ ASM_SYMBOL(__xray_TypedEvent): | ||
// and rdx without our intervention. | ||
movq ASM_SYMBOL(_ZN6__xray21XRayPatchedTypedEventE)(%rip), %rax | ||
testq %rax,%rax | ||
- je .LtypedEventCleanup | ||
+ je LOCAL_LABEL(typedEventCleanup) | ||
|
||
callq *%rax | ||
|
||
-.LtypedEventCleanup: | ||
+LOCAL_LABEL(typedEventCleanup): | ||
RESTORE_REGISTERS | ||
retq | ||
# LLVM-MCA-END | ||
-- | ||
2.46.1 | ||
|
32 changes: 32 additions & 0 deletions
32
lang/llvm-14/files/0034-builtins-Move-cfi-start-s-after-the-symbol-name-NFC.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
From 7939ce39dac0078fef7183d6198598b99c652c88 Mon Sep 17 00:00:00 2001 | ||
From: Jon Roelofs <[email protected]> | ||
Date: Fri, 17 Nov 2023 14:21:57 -0800 | ||
Subject: [PATCH] [builtins] Move cfi start's after the symbol name [NFC] | ||
|
||
... in preparation for diagnosing improperly nested .cfi regions. | ||
|
||
See https://reviews.llvm.org/D155245 | ||
--- | ||
compiler-rt/lib/builtins/assembly.h | 5 +++-- | ||
1 file changed, 3 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/compiler-rt/lib/builtins/assembly.h b/compiler-rt/lib/builtins/assembly.h | ||
index 169d49683f50..8c42fc773483 100644 | ||
--- a/compiler-rt/lib/builtins/assembly.h | ||
+++ b/compiler-rt/lib/builtins/assembly.h | ||
@@ -260,9 +260,10 @@ | ||
.globl name SEPARATOR \ | ||
SYMBOL_IS_FUNC(name) SEPARATOR \ | ||
DECLARE_SYMBOL_VISIBILITY_UNMANGLED(name) SEPARATOR \ | ||
- CFI_START SEPARATOR \ | ||
DECLARE_FUNC_ENCODING \ | ||
- name: SEPARATOR BTI_C | ||
+ name: \ | ||
+ SEPARATOR CFI_START \ | ||
+ SEPARATOR BTI_C | ||
|
||
#define DEFINE_COMPILERRT_FUNCTION_ALIAS(name, target) \ | ||
.globl SYMBOL_NAME(name) SEPARATOR \ | ||
-- | ||
2.46.1 | ||
|