Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmake/modules/AddSwift.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,7 @@ function(add_swift_host_tool executable)
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)
if(SWIFT_HOST_VARIANT_SDK STREQUAL "OPENBSD" AND SWIFT_HOST_VARIANT_ARCH MATCHES "aarch64|x86_64" AND NOT SWIFT_OPENBSD_BTCFI)
target_link_options(${executable} PRIVATE "LINKER:-z,nobtcfi")
endif()

Expand Down
5 changes: 4 additions & 1 deletion lib/Basic/Platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ bool swift::tripleRequiresRPathForSwiftLibrariesInOS(
}

bool swift::tripleBTCFIByDefaultInOpenBSD(const llvm::Triple &triple) {
return triple.isOSOpenBSD() && triple.getArch() == llvm::Triple::aarch64;
return triple.isOSOpenBSD() && (
triple.getArch() == llvm::Triple::aarch64 ||
triple.getArch() == llvm::Triple::x86_64);

}

DarwinPlatformKind swift::getDarwinPlatformKind(const llvm::Triple &triple) {
Expand Down