Merge pull request #80553 from 3405691582/nobtcfi_part2

Use -z,nobtcfi when BTCFI is disabled on OpenBSD.
This commit is contained in:
Doug Gregor
2025-04-15 12:43:22 -07:00
committed by GitHub

View File

@@ -965,6 +965,11 @@ function(add_swift_host_tool executable)
endif()
endif()
# Opt-out of OpenBSD BTCFI if instructed where it is enforced by default.
if(SWIFT_HOST_VARIANT_SDK STREQUAL "OPENBSD" AND SWIFT_HOST_VARIANT_ARCH STREQUAL "aarch64" AND NOT SWIFT_OPENBSD_BTCFI)
target_link_options(${executable} PRIVATE "LINKER:-z,nobtcfi")
endif()
if(SWIFT_BUILD_SWIFT_SYNTAX)
set(extra_relative_rpath "")
if(NOT "${ASHT_BOOTSTRAPPING}" STREQUAL "")