-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Linux] Set rpath in add_swift_executable. #67711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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
@swift-ci Please smoke test |
@swift-ci Please smoke test Windows platform |
@swift-ci Please smoke test macOS platform |
@swift-ci Please smoke test Windows platform |
@swift-ci Please smoke test macOS platform |
elseif(SWIFT_HOST_VARIANT_SDK STREQUAL "LINUX") | ||
set_target_properties(${name} PROPERTIES | ||
BUILD_WITH_INSTALL_RPATH YES | ||
INSTALL_RPATH "$ORIGIN/../../../lib/swift/${SWIFT_SDK_${SWIFTEXE_SINGLE_SDK}_LIB_SUBDIR}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will add this relative rpath to all target executables on linux, like swift-reflection-test
, so it seems mistaken. Better to pass in a relative path, like _add_swift_runtime_link_flags()
does with relpath_to_lib_dir
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
swift-reflection-test
isn't ever installed, and the rpath set there doesn't matter. If it was installed, it would be put into libexec
and in that case it would also need this rpath.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, it isn't installed now.
@swift-ci Please smoke test Windows platform |
1 similar comment
@swift-ci Please smoke test Windows platform |
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