Skip to content

Commit 8f3341e

Browse files
committed
FreeBSD: Set runtime module triple correctly
LLVM FreeBSD triples include the version number, which gets encoded into the swiftmodule. The filename should not include the version number though. This patch drops the version number from the filename, but not from the target triple. This fixes several tests which uses the computed target triple as the flag to pass to `-target`. Since it was missing the version number, the compiler assumed it defaulted to zero and would report "compiling for freebsd 0, but module 'Dispatch' has a minimum deployment target of freebsd 14.3" Fixes: rdar://156163594
1 parent 95dfa3d commit 8f3341e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cmake/modules/SwiftConfigureSDK.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,8 @@ macro(configure_sdk_unix name architectures)
440440
string(REGEX REPLACE "[-].*" "" freebsd_system_version ${CMAKE_SYSTEM_VERSION})
441441
message(STATUS "FreeBSD Version: ${freebsd_system_version}")
442442

443-
set(SWIFT_SDK_FREEBSD_ARCH_${arch}_TRIPLE "${arch}-unknown-freebsd")
443+
set(SWIFT_SDK_FREEBSD_ARCH_${arch}_TRIPLE "${arch}-unknown-freebsd${freebsd_system_version}}")
444+
set(SWIFT_SDK_FREEBSD_ARCH_${arch}_MODULE "${arch}-unknown-freebsd")
444445
elseif("${prefix}" STREQUAL "OPENBSD")
445446
if(NOT arch STREQUAL "x86_64" AND NOT arch STREQUAL "aarch64")
446447
message(FATAL_ERROR "unsupported arch for OpenBSD: ${arch}")

0 commit comments

Comments
 (0)