Skip to content

Commit c8bdc25

Browse files
committed
[Linux] Set rpath in add_swift_executable.
Because the rpath isn't set, the dynamic linker can't find the Swift libraries when we try to run `swift-backtrace` on Linux (when we actually install everything). rdar://113337854
1 parent cc72301 commit c8bdc25

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

stdlib/cmake/modules/AddSwiftStdlib.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2655,6 +2655,10 @@ function(_add_swift_target_executable_single name)
26552655
set_target_properties(${name} PROPERTIES
26562656
BUILD_WITH_INSTALL_RPATH YES
26572657
INSTALL_RPATH "@executable_path/../lib/swift/${SWIFT_SDK_${SWIFTEXE_SINGLE_SDK}_LIB_SUBDIR};@executable_path/../../../lib/swift/${SWIFT_SDK_${SWIFTEXE_SINGLE_SDK}_LIB_SUBDIR}")
2658+
elseif(SWIFT_HOST_VARIANT_SDK STREQUAL "LINUX")
2659+
set_target_properties(${name} PROPERTIES
2660+
BUILD_WITH_INSTALL_RPATH YES
2661+
INSTALL_RPATH "$ORIGIN/../../../lib/swift/${SWIFT_SDK_${SWIFTEXE_SINGLE_SDK}_LIB_SUBDIR}")
26582662
endif()
26592663
set_output_directory(${name}
26602664
BINARY_DIR ${SWIFT_RUNTIME_OUTPUT_INTDIR}

0 commit comments

Comments
 (0)