Skip to content

Commit

Permalink
clang-17, llvm-17: restore functionality on macOS 15 (Xcode 16)
Browse files Browse the repository at this point in the history
This is a cherry-pick of
llvm/llvm-project@7939ce3.

Xcode 16 runs om macOS 14 and 15, so the patch is applied on macOS ≥ 14.

Closes: https://trac.macports.org/ticket/70779
  • Loading branch information
markmentovai committed Sep 24, 2024
1 parent fc45ac0 commit 085c61d
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lang/llvm-17/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ legacysupport.use_static yes
legacysupport.disable_function_wrap yes

categories lang
platforms {darwin > 10 < 24}
platforms {darwin > 10}
license NCSA
maintainers nomaintainer

Expand Down Expand Up @@ -224,6 +224,11 @@ if {${os.platform} eq "darwin" && ${os.major} <= 16} {
patchfiles-append 0042-mbstate_t-not-defined.patch
}

if {${os.platform} eq "darwin" && ${os.major} >= 23} {
# https://trac.macports.org/ticket/70779
patchfiles-append 0043-builtins-Move-cfi-start-s-after-the-symbol-name-NFC.patch
}

post-patch {
reinplace "s|@@PREFIX@@|${prefix}|" \
${patch.dir}/clang/lib/Driver/ToolChains/Clang.cpp \
Expand Down
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

0 comments on commit 085c61d

Please sign in to comment.