mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Add a build flavor to opt-out of BTCFI on OpenBSD.
To work-around #80059, we need to stop return address signing and opt-out of BTCFI enforcement via enabling a platform linker option. We don't want to completely undo the BTCFI work in the rare case that we later figure out how to properly address the above issue, or allow users who might want to benefit from BTCFI enforcement and won't use Concurrency. To do this, condition the existing BTCFI flag enforcement into a configuration option that defaults to off for now. Because the new swift-driver needs to "know" whether the frontend is configured to opt-out or not, and since the new driver communicates with the frontend via the target info JSON to begin with, we add a field that emits the build flavor to signal the right behavior.
This commit is contained in:
@@ -575,6 +575,17 @@ set(SWIFT_DARWIN_XCRUN_TOOLCHAIN "XcodeDefault" CACHE STRING
|
||||
set(SWIFT_DARWIN_STDLIB_INSTALL_NAME_DIR "/usr/lib/swift" CACHE STRING
|
||||
"The directory of the install_name for standard library dylibs")
|
||||
|
||||
#
|
||||
# User-configurable OpenBSD-specific options.
|
||||
#
|
||||
|
||||
option(SWIFT_OPENBSD_BTCFI
|
||||
"Emit branch target identification instructions and sign return addresses when available"
|
||||
FALSE)
|
||||
if(SWIFT_OPENBSD_BTCFI)
|
||||
add_definitions("-DSWIFT_OPENBSD_BTCFI")
|
||||
endif()
|
||||
|
||||
# We don't want to use the same install_name_dir as the standard library which
|
||||
# will be installed in /usr/lib/swift. These private libraries should continue
|
||||
# to use @rpath for now.
|
||||
|
||||
Reference in New Issue
Block a user