diff --git a/lang/llvm-16/Portfile b/lang/llvm-16/Portfile index 97d1612fc987c..598e09495094e 100644 --- a/lang/llvm-16/Portfile +++ b/lang/llvm-16/Portfile @@ -20,8 +20,6 @@ categories lang license NCSA maintainers nomaintainer -platforms {darwin < 24} - set llvm_version 16 set clang_exe_version ${llvm_version} version ${llvm_version}.0.6 @@ -29,7 +27,7 @@ version ${llvm_version}.0.6 name llvm-${llvm_version} revision 1 subport mlir-${llvm_version} { revision [ expr ${revision} + 0 ] } -subport clang-${llvm_version} { revision [ expr ${revision} + 4 ] } +subport clang-${llvm_version} { revision [ expr ${revision} + 5 ] } subport lldb-${llvm_version} { revision [ expr ${revision} + 1 ] } subport flang-${llvm_version} { revision [ expr ${revision} + 0 ] } @@ -144,6 +142,8 @@ patchfiles-append \ 0025-lldb-add-defines-needed-for-older-SDKs.patch \ 0026-llvm-set-memrchr-unavailable.patch \ 0032-lldb-Add-cstdio-include-to-fix-a595b931f1f91897317a4.patch \ + 0033-xray-Use-L-instead-of-.L-for-Mach-O.patch \ + 0034-builtins-Move-cfi-start-s-after-the-symbol-name-NFC.patch \ 0999-i386-fix.diff if {${os.platform} eq "darwin" && ${os.major} < 14} { 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 new file mode 100644 index 0000000000000..198db6ce1d929 --- /dev/null +++ b/lang/llvm-16/files/0033-xray-Use-L-instead-of-.L-for-Mach-O.patch @@ -0,0 +1,121 @@ +From c57c7b7c99605021123b54c02e57943923874cbe Mon Sep 17 00:00:00 2001 +From: Fangrui Song +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 + 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 new file mode 100644 index 0000000000000..f1a5dd25d2512 --- /dev/null +++ b/lang/llvm-16/files/0034-builtins-Move-cfi-start-s-after-the-symbol-name-NFC.patch @@ -0,0 +1,32 @@ +From 7939ce39dac0078fef7183d6198598b99c652c88 Mon Sep 17 00:00:00 2001 +From: Jon Roelofs +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 +