-
Notifications
You must be signed in to change notification settings - Fork 333
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
[lldb][cmake] Remove local rpaths from the build host on ELF platforms #6456
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -172,25 +172,29 @@ function(add_properties_for_swift_modules target reldir) | |
target_link_directories(${target} PRIVATE | ||
"${CMAKE_OSX_SYSROOT}/usr/lib/swift" | ||
"${LLDB_SWIFT_LIBS}/macosx") | ||
set(SWIFT_RPATH "/usr/lib/swift") | ||
set(SWIFT_BUILD_RPATH "/usr/lib/swift") | ||
set(SWIFT_INSTALL_RPATH "/usr/lib/swift") | ||
elseif(APSM_BOOTSTRAPPING_MODE STREQUAL "BOOTSTRAPPING") | ||
target_link_directories(${target} PRIVATE "${LLDB_SWIFT_LIBS}/macosx") | ||
set(SWIFT_RPATH "${LLDB_SWIFT_LIBS}/macosx") | ||
set(SWIFT_BUILD_RPATH "${LLDB_SWIFT_LIBS}/macosx") | ||
set(SWIFT_INSTALL_RPATH "${LLDB_SWIFT_LIBS}/macosx") | ||
else() | ||
message(FATAL_ERROR "Unknown APSM_BOOTSTRAPPING_MODE '${APSM_BOOTSTRAPPING_MODE}'") | ||
endif() | ||
|
||
# Workaround for a linker crash related to autolinking: rdar://77839981 | ||
set_property(TARGET ${target} APPEND_STRING PROPERTY | ||
LINK_FLAGS " -lobjc ") | ||
elseif (CMAKE_SYSTEM_NAME MATCHES "Linux") | ||
elseif (CMAKE_SYSTEM_NAME MATCHES "Linux|Android|OpenBSD|FreeBSD") | ||
string(REGEX MATCH "^[^-]*" arch ${LLVM_TARGET_TRIPLE}) | ||
target_link_libraries(${target} PRIVATE swiftCore-linux-${arch}) | ||
set(SWIFT_RPATH "${LLDB_SWIFT_LIBS}/linux;$ORIGIN/../lib/swift/linux") | ||
string(TOLOWER ${CMAKE_SYSTEM_NAME} platform) | ||
set(SWIFT_BUILD_RPATH "${LLDB_SWIFT_LIBS}/${platform}") | ||
set(SWIFT_INSTALL_RPATH "$ORIGIN/swift/${platform}") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As long as I'm modifying this line, I extended it to support more platforms and modified it to look in However, I checked and the only one it's added to is |
||
endif() | ||
|
||
set_property(TARGET ${target} APPEND PROPERTY BUILD_RPATH "${SWIFT_RPATH}") | ||
set_property(TARGET ${target} APPEND PROPERTY INSTALL_RPATH "${SWIFT_RPATH}") | ||
set_property(TARGET ${target} APPEND PROPERTY BUILD_RPATH "${SWIFT_BUILD_RPATH}") | ||
set_property(TARGET ${target} APPEND PROPERTY INSTALL_RPATH "${SWIFT_INSTALL_RPATH}") | ||
|
||
if (SWIFT_SWIFT_PARSER) | ||
set_property(TARGET ${target} | ||
|
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.
I don't know if this rpath needs to be set for both the build and install on macOS, but just kept it the same for now.
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.
Isn't this a change for macOS?
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.
It shouldn't be. Currently,
SWIFT_RPATH
is set as both the build and install rpath for macOS below, whereas I simply use two variables set to the same rpath on macOS after this pull, ie the end result should be the same.I only had to copy these for macOS because on linux I need to set different build and install rpaths.