clang-16: fix support for macOS 26

Also fix flang-16 compilation on macOS 15+ by adding
-Wno-missing-template-arg-list-after-template-kw

Signed-off-by: Paul Guyot <pguyot@kallisys.net>
This commit is contained in:
Paul Guyot
2026-03-14 16:42:35 +01:00
committed by Renee Otten
parent 1ce97cc6de
commit beaeb3bf05
+16 -1
View File
@@ -320,6 +320,12 @@ if { ${subport} eq "flang-${llvm_version}" } {
depends_lib-append port:clang-${llvm_version} port:mlir-${llvm_version}
depends_run-append port:bash
# Xcode Clang 16.3+ (macOS 15+) errors on template keyword without
# explicit template arguments in flang/runtime/reduction-templates.h
if {[string match *clang* ${configure.compiler}] && ${os.major} >= 24} {
configure.cxxflags-append -Wno-missing-template-arg-list-after-template-kw
}
# https://trac.macports.org/ticket/72931
build.mem_per_job 3072
@@ -331,7 +337,7 @@ if { ${subport} eq "flang-${llvm_version}" } {
}
if { ${subport} eq "clang-${llvm_version}" || ${subport} eq "flang-${llvm_version}" } {
platforms {darwin < 25}
platforms {darwin < 26}
depends_lib-append port:libxml2 port:libomp port:llvm-${llvm_version}
depends_run-append port:ld64
@@ -374,6 +380,15 @@ if { ${subport} eq "clang-${llvm_version}" || ${subport} eq "flang-${llvm_versio
-DCOMPILER_RT_BUILD_MEMPROF=OFF
}
if {${os.platform} eq "darwin" && ${os.major} >= 25} {
# tsan and other sanitizers fail to link on macOS 26+ (Darwin 25+) due to
# the new Apple ld-prime linker rejecting 32-bit relocations in 64-bit binaries
# e.g. tsan_rtl_aarch64.S: "ld: 32-bit pointer in 64-bit arch"
configure.args-append -DCOMPILER_RT_BUILD_SANITIZERS=OFF \
-DCOMPILER_RT_BUILD_XRAY=OFF \
-DCOMPILER_RT_BUILD_MEMPROF=OFF
}
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