<pre style='margin:0'>
Chris Jones (cjones051073) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/59bca6e0cf49381a74690e99e4ef59739714c3f7">https://github.com/macports/macports-ports/commit/59bca6e0cf49381a74690e99e4ef59739714c3f7</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 59bca6e0cf49381a74690e99e4ef59739714c3f7
</span>Author: Mark Mentovai <mark@mentovai.com>
AuthorDate: Tue Sep 24 16:53:06 2024 -0400
<span style='display:block; white-space:pre;color:#404040;'> clang-16, llvm-16: restore functionality on macOS 15 (Xcode 16)
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> This is a cherry-pick of:
</span><span style='display:block; white-space:pre;color:#404040;'> https://github.com/llvm/llvm-project/commit/c57c7b7c99605021123b54c02e57943923874cbe
</span><span style='display:block; white-space:pre;color:#404040;'> https://github.com/llvm/llvm-project/commit/7939ce39dac0078fef7183d6198598b99c652c88
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> This enables clang-16 to be built by Xcode 16, making it possible to
</span><span style='display:block; white-space:pre;color:#404040;'> build on macOS 15, and macOS 14 with Xcode 16. It also enables clang-16
</span><span style='display:block; white-space:pre;color:#404040;'> to be built by clang-18 and newer.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> References: https://trac.macports.org/ticket/70779
</span>---
lang/llvm-16/Portfile | 6 +-
.../0033-xray-Use-L-instead-of-.L-for-Mach-O.patch | 121 +++++++++++++++++++++
...ove-cfi-start-s-after-the-symbol-name-NFC.patch | 32 ++++++
3 files changed, 156 insertions(+), 3 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/llvm-16/Portfile b/lang/llvm-16/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 97d1612fc98..598e0949509 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/llvm-16/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/llvm-16/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -20,8 +20,6 @@ categories lang
</span> license NCSA
maintainers nomaintainer
<span style='display:block; white-space:pre;background:#ffe0e0;'>-platforms {darwin < 24}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span> set llvm_version 16
set clang_exe_version ${llvm_version}
version ${llvm_version}.0.6
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -29,7 +27,7 @@ version ${llvm_version}.0.6
</span> name llvm-${llvm_version}
revision 1
subport mlir-${llvm_version} { revision [ expr ${revision} + 0 ] }
<span style='display:block; white-space:pre;background:#ffe0e0;'>-subport clang-${llvm_version} { revision [ expr ${revision} + 4 ] }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+subport clang-${llvm_version} { revision [ expr ${revision} + 5 ] }
</span> subport lldb-${llvm_version} { revision [ expr ${revision} + 1 ] }
subport flang-${llvm_version} { revision [ expr ${revision} + 0 ] }
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -144,6 +142,8 @@ patchfiles-append \
</span> 0025-lldb-add-defines-needed-for-older-SDKs.patch \
0026-llvm-set-memrchr-unavailable.patch \
0032-lldb-Add-cstdio-include-to-fix-a595b931f1f91897317a4.patch \
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ 0033-xray-Use-L-instead-of-.L-for-Mach-O.patch \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 0034-builtins-Move-cfi-start-s-after-the-symbol-name-NFC.patch \
</span> 0999-i386-fix.diff
if {${os.platform} eq "darwin" && ${os.major} < 14} {
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/llvm-16/files/0033-xray-Use-L-instead-of-.L-for-Mach-O.patch b/lang/llvm-16/files/0033-xray-Use-L-instead-of-.L-for-Mach-O.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..198db6ce1d9
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/llvm-16/files/0033-xray-Use-L-instead-of-.L-for-Mach-O.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,121 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From c57c7b7c99605021123b54c02e57943923874cbe Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From: Fangrui Song <i@maskray.me>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Date: Fri, 16 Jun 2023 12:04:28 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH] [xray] Use L* instead of .L* for Mach-O
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Note: Mach-O support is not yet done and check-xray is not allowed yet.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+---
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ compiler-rt/lib/xray/xray_trampoline_x86_64.S | 28 +++++++++----------
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 1 file changed, 14 insertions(+), 14 deletions(-)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/compiler-rt/lib/xray/xray_trampoline_x86_64.S b/compiler-rt/lib/xray/xray_trampoline_x86_64.S
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 02cf69f766c4..0f00bcc41508 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/compiler-rt/lib/xray/xray_trampoline_x86_64.S
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/compiler-rt/lib/xray/xray_trampoline_x86_64.S
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -124,14 +124,14 @@ ASM_SYMBOL(__xray_FunctionEntry):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ // On x86/amd64, a simple (type-aligned) MOV instruction is enough.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ movq ASM_SYMBOL(_ZN6__xray19XRayPatchedFunctionE)(%rip), %rax
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ testq %rax, %rax
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- je .Ltmp0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ je LOCAL_LABEL(tmp0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ // The patched function prologue puts its xray_instr_map index into %r10d.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ movl %r10d, %edi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ xor %esi,%esi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ callq *%rax
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Ltmp0:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++LOCAL_LABEL(tmp0):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ RESTORE_REGISTERS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ RESTORE_STACK_ALIGNMENT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ retq
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -162,13 +162,13 @@ ASM_SYMBOL(__xray_FunctionExit):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ movq %rdx, 0(%rsp)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ movq ASM_SYMBOL(_ZN6__xray19XRayPatchedFunctionE)(%rip), %rax
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ testq %rax,%rax
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- je .Ltmp2
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ je LOCAL_LABEL(tmp2)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ movl %r10d, %edi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ movl $1, %esi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ callq *%rax
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Ltmp2:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++LOCAL_LABEL(tmp2):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ // Restore the important registers.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ movq 48(%rsp), %rbp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ movupd 32(%rsp), %xmm0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -198,13 +198,13 @@ ASM_SYMBOL(__xray_FunctionTailExit):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ movq ASM_SYMBOL(_ZN6__xray19XRayPatchedFunctionE)(%rip), %rax
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ testq %rax,%rax
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- je .Ltmp4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ je LOCAL_LABEL(tmp4)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ movl %r10d, %edi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ movl $2, %esi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ callq *%rax
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Ltmp4:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++LOCAL_LABEL(tmp4):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ RESTORE_REGISTERS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ RESTORE_STACK_ALIGNMENT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ retq
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -227,14 +227,14 @@ ASM_SYMBOL(__xray_ArgLoggerEntry):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ // Again, these function pointer loads must be atomic; MOV is fine.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ movq ASM_SYMBOL(_ZN6__xray13XRayArgLoggerE)(%rip), %rax
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ testq %rax, %rax
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- jne .Larg1entryLog
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ jne LOCAL_LABEL(arg1entryLog)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ // If [arg1 logging handler] not set, defer to no-arg logging.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ movq ASM_SYMBOL(_ZN6__xray19XRayPatchedFunctionE)(%rip), %rax
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ testq %rax, %rax
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- je .Larg1entryFail
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ je LOCAL_LABEL(arg1entryFail)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Larg1entryLog:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++LOCAL_LABEL(arg1entryLog):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ // First argument will become the third
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ movq %rdi, %rdx
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -247,7 +247,7 @@ ASM_SYMBOL(__xray_ArgLoggerEntry):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ callq *%rax
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.Larg1entryFail:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++LOCAL_LABEL(arg1entryFail):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ RESTORE_REGISTERS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ RESTORE_STACK_ALIGNMENT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ retq
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -270,11 +270,11 @@ ASM_SYMBOL(__xray_CustomEvent):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ // already.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ movq ASM_SYMBOL(_ZN6__xray22XRayPatchedCustomEventE)(%rip), %rax
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ testq %rax,%rax
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- je .LcustomEventCleanup
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ je LOCAL_LABEL(customEventCleanup)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ callq *%rax
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.LcustomEventCleanup:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++LOCAL_LABEL(customEventCleanup):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ RESTORE_REGISTERS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ retq
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # LLVM-MCA-END
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -296,11 +296,11 @@ ASM_SYMBOL(__xray_TypedEvent):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ // and rdx without our intervention.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ movq ASM_SYMBOL(_ZN6__xray21XRayPatchedTypedEventE)(%rip), %rax
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ testq %rax,%rax
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- je .LtypedEventCleanup
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ je LOCAL_LABEL(typedEventCleanup)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ callq *%rax
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-.LtypedEventCleanup:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++LOCAL_LABEL(typedEventCleanup):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ RESTORE_REGISTERS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ retq
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # LLVM-MCA-END
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+2.46.1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/llvm-16/files/0034-builtins-Move-cfi-start-s-after-the-symbol-name-NFC.patch b/lang/llvm-16/files/0034-builtins-Move-cfi-start-s-after-the-symbol-name-NFC.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..f1a5dd25d25
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/llvm-16/files/0034-builtins-Move-cfi-start-s-after-the-symbol-name-NFC.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,32 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From 7939ce39dac0078fef7183d6198598b99c652c88 Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From: Jon Roelofs <jonathan_roelofs@apple.com>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Date: Fri, 17 Nov 2023 14:21:57 -0800
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH] [builtins] Move cfi start's after the symbol name [NFC]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+... in preparation for diagnosing improperly nested .cfi regions.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+See https://reviews.llvm.org/D155245
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+---
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ compiler-rt/lib/builtins/assembly.h | 5 +++--
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 1 file changed, 3 insertions(+), 2 deletions(-)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/compiler-rt/lib/builtins/assembly.h b/compiler-rt/lib/builtins/assembly.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 169d49683f50..8c42fc773483 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/compiler-rt/lib/builtins/assembly.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/compiler-rt/lib/builtins/assembly.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -260,9 +260,10 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .globl name SEPARATOR \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ SYMBOL_IS_FUNC(name) SEPARATOR \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ DECLARE_SYMBOL_VISIBILITY_UNMANGLED(name) SEPARATOR \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- CFI_START SEPARATOR \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ DECLARE_FUNC_ENCODING \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- name: SEPARATOR BTI_C
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ name: \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ SEPARATOR CFI_START \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ SEPARATOR BTI_C
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #define DEFINE_COMPILERRT_FUNCTION_ALIAS(name, target) \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .globl SYMBOL_NAME(name) SEPARATOR \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+2.46.1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span></pre><pre style='margin:0'>
</pre>