<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/93df941348056bddd6f378306312267032346e98">https://github.com/macports/macports-ports/commit/93df941348056bddd6f378306312267032346e98</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 93df9413480 clang-14: Fix build under Xcode 15, re-enabling sanitizers on macOS 14
</span>93df9413480 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 93df941348056bddd6f378306312267032346e98
</span>Author: Mark Mentovai <mark@mentovai.com>
AuthorDate: Thu Sep 28 11:22:57 2023 -0400
<span style='display:block; white-space:pre;color:#404040;'> clang-14: Fix build under Xcode 15, re-enabling sanitizers on macOS 14
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> This also reverts the following as they relate to clang-14:
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> 370d81aeeea1 llvm-14: Allow build on darwin23 but disable sanitizers
</span><span style='display:block; white-space:pre;color:#404040;'> 0c2af4734924 llvm-{10-14}: Restrict to darwin < 23
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Note that the actual incompatibility was not strictly between clang-14
</span><span style='display:block; white-space:pre;color:#404040;'> and Darwin 23 (macOS 14) as these previous commits suggest. The
</span><span style='display:block; white-space:pre;color:#404040;'> incompatibility existed between clang-14 and the macOS 14 SDK, which is
</span><span style='display:block; white-space:pre;color:#404040;'> part of Xcode 15. The incompatibility equally affected clang-14 on macOS
</span><span style='display:block; white-space:pre;color:#404040;'> 13 (Darwin 22) using Xcode 15.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> This also makes the compiler-rt build for various runtimes targeting iOS
</span><span style='display:block; white-space:pre;color:#404040;'> and iOS Simulator work correctly by removing the macOS SDK -syslibroot
</span><span style='display:block; white-space:pre;color:#404040;'> when linking, allowing the platform-specific SDK provided by the Clang
</span><span style='display:block; white-space:pre;color:#404040;'> build to be effective.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Fixes: https://trac.macports.org/ticket/68257
</span>---
lang/llvm-14/Portfile | 27 +++++++++++--------
lang/llvm-14/files/patch-xcode-15.diff | 47 ++++++++++++++++++++++++++++++++++
2 files changed, 64 insertions(+), 10 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/llvm-14/Portfile b/lang/llvm-14/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 2184efe022c..244927241c7 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/llvm-14/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/llvm-14/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -27,7 +27,7 @@ version ${llvm_version}.0.6
</span> name llvm-${llvm_version}
revision 0
subport mlir-${llvm_version} { revision 0 }
<span style='display:block; white-space:pre;background:#ffe0e0;'>-subport clang-${llvm_version} { revision 1 }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+subport clang-${llvm_version} { revision 2 }
</span> subport lldb-${llvm_version} { revision 1 }
subport flang-${llvm_version} { revision 0 }
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -136,7 +136,8 @@ patchfiles-append \
</span> MachOWriter.cpp-types.patch \
SyntheticSections.cpp-types.patch \
patch-lldb-stdc-macros-134877.diff \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- patch-lldb-fix-swig-lvalue-2128646.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patch-lldb-fix-swig-lvalue-2128646.diff \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patch-xcode-15.diff
</span>
if {${os.platform} eq "darwin" && ${os.major} < 14} {
patchfiles-append \
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -331,14 +332,6 @@ if { ${subport} eq "clang-${llvm_version}" || ${subport} eq "flang-${llvm_versio
</span> -DCOMPILER_RT_BUILD_MEMPROF=OFF
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {${os.platform} eq "darwin" && ${os.major} > 22} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # sanitizers also fail to build on macOS14
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # https://trac.macports.org/ticket/68257
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- configure.args-append -DCOMPILER_RT_BUILD_SANITIZERS=OFF \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- -DCOMPILER_RT_BUILD_XRAY=OFF \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- -DCOMPILER_RT_BUILD_MEMPROF=OFF
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span> if {${os.platform} eq "darwin" && ${os.major} <= 11} {
# xpc.h available 10.7 but doesn't support nullable features
configure.args-append -DCLANGD_BUILD_XPC=OFF
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -538,6 +531,20 @@ if {${subport} eq "clang-${llvm_version}"} {
</span> if { ${cxx_stdlib} eq "libstdc++" } {
default_variants-append +libstdcxx
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ post-configure {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # -Wl,-syslibroot referencing the macOS SDK must not appear when linking
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # runtime libraries for non-macOS platforms, which are cross-built and
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # used for cross-platform support. The clang build will provide the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # proper -isysroot for the platform in these cases. Remove the macOS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # SDK.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach rtl_dir {asan lsan stats tsan/rtl ubsan ubsan_minimal} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set rtl [lindex [split ${rtl_dir} /] 0]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach rtl_os {ios iossim} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ reinplace "s|-Wl,-syslibroot,${configure.sdkroot}||" "${workpath}/build/projects/compiler-rt/lib/${rtl_dir}/CMakeFiles/clang_rt.${rtl}_${rtl_os}_dynamic.dir/link.txt"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span> }
livecheck.type regex
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/llvm-14/files/patch-xcode-15.diff b/lang/llvm-14/files/patch-xcode-15.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..e6d5ddb22a7
</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-14/files/patch-xcode-15.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,47 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From 786c10cd82a78c210379700b72cf18a018e1e1f7 Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From: Mark Mentovai <mark@mentovai.com>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Date: Thu, 28 Sep 2023 11:18:41 -0400
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH] [sanitizer] Use consistent checks for XDR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+MIME-Version: 1.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Content-Type: text/plain; charset=UTF-8
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Content-Transfer-Encoding: 8bit
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+This is a backport of 28800c2e18972935cd4f942aa428c5e6cc4c1670
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+(https://reviews.llvm.org/D130060), which is in llvm-15, to llvm-14,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+however it’s been adapted to be
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+pre-8246b2e156568c31e71e16cbaf4c14d316e7c06e
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+(https://reviews.llvm.org/D126263), which renamed SANITIZER_MAC (the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+macro in llvm-14) to SANITIZER_APPLE (the macro in llvm-15 and later).
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+The original change’s description:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+> sanitizer_platform_limits_posix.h defines `__sanitizer_XDR ` if
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+> `SANITIZER_LINUX && !SANITIZER_ANDROID`, but
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+> sanitizer_platform_limits_posix.cpp tries to check it if
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+> `HAVE_RPC_XDR_H`. This coincidentally works because macOS has a broken
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+> <rpc/xdr.h> which causes `HAVE_RPC_XDR_H` to be 0, but if <rpc/xdr.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+> is fixed then clang fails to compile on macOS. Restore the platform
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+> checks so that <rpc/xdr.h> can be fixed on macOS.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+This has become important with Xcode 15, which contains the macOS 14
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+SDK, which does have a fixed <rpc/xdr.h>.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+---
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ .../lib/sanitizer_common/sanitizer_platform_limits_posix.cpp | 2 +-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 1 file changed, 1 insertion(+), 1 deletion(-)
</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/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 32b8f47ed633..6cefef3f3327 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1250,7 +1250,7 @@ CHECK_SIZE_AND_OFFSET(group, gr_passwd);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ CHECK_SIZE_AND_OFFSET(group, gr_gid);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ CHECK_SIZE_AND_OFFSET(group, gr_mem);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if HAVE_RPC_XDR_H
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_RPC_XDR_H && !SANITIZER_MAC
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ CHECK_TYPE_SIZE(XDR);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ CHECK_SIZE_AND_OFFSET(XDR, x_op);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ CHECK_SIZE_AND_OFFSET(XDR, x_ops);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+2.42.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span></pre><pre style='margin:0'>
</pre>