-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[5.9][CMake] Support Macros in Linux #68190
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
Merged
shahmishal
merged 20 commits into
swiftlang:release/5.9
from
rintaro:5.9-swift-swift-linux
Aug 31, 2023
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
277619a
[CMake] Add paths for building Swift code against host toolchain
DougGregor c573a7a
[CMake] Fix host library builds and rpaths for testing macros
DougGregor defe9eb
[SourceKit] Fix paths when including the new Swift compiler
DougGregor 040d15d
[CMake] Support Macros in Linux
rintaro 16bf7a3
Avoid adding redundant temporary RUNPATH to builder's stdlib
rintaro bf0081a
[CMake] Fatal error when bootstrapping is not "hosttools"
rintaro 79f6bca
[CMake] Update for review comments
rintaro 42360db
[CMake] Fix weiredness in swift runtime linking for SourceKit libraries
rintaro 64c5430
[CMake] Further cleanup for RUNPATH setting
rintaro f5445f4
[CMake] Set LD_LIBRARY_PATH to builder's runtime when building stdlib
rintaro 5bbab90
[CMake] Fix install for macOS toolchain
rintaro 3badb3b
[CMake] Fix RUNPATH of lib_InternalSwiftScan in Linux
rintaro 1e7c84a
[CMake] Stop some exectuable link with swiftCore
rintaro c39f95b
[CMake] Use RPATH_CHANGE instead RPATH_SET
rintaro d8a1265
[CMake] Always use builder's runtime for building Swift code in Linux
rintaro c244dfc
[CMake][SourceKit] Add RPATH to 'lib/swift/host'
rintaro 714589e
[CMake] Update host platform check for macro support
rintaro 5125ac3
[CMake] Handle cases where Swift parser integration is disabled in Linux
rintaro f038280
[stdlib] Set PYTHONIOENCODING when building the stdlib
bnbarham 71f5b47
[CMake] Instantiate missing C++ templates
rintaro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
set(SWIFT_SET_RPATH_SCRIPT_FILE "${CMAKE_CURRENT_LIST_FILE}") | ||
|
||
function(swift_get_set_rpath_script_file out_var) | ||
set(${out_var} "${SWIFT_SET_RPATH_SCRIPT_FILE}" PARENT_SCOPE) | ||
endfunction() | ||
|
||
# Actual RPATH_CHANGE operation to the file. | ||
function(_swift_set_rpath_impl file new_rpath) | ||
# FIXME: Handle non-ELF files. We can't use RPATH_SET because it's only available CMake 3.21.0 | ||
execute_process( | ||
COMMAND readelf -Wd "${file}" | ||
COMMAND grep -Po "R(UN)?PATH.*\\[\\K[^\\]]*" | ||
OUTPUT_VARIABLE current_rpath | ||
) | ||
string(STRIP "${current_rpath}" current_rpath) | ||
|
||
# NOTE: RPATH_CHANGE is not documented, and works only for ELF and XCOFF. | ||
file(RPATH_CHANGE FILE "${file}" OLD_RPATH "${current_rpath}" NEW_RPATH "${new_rpath}") | ||
endfunction() | ||
|
||
# For 'cmake -P <scirpt>'. | ||
if (SWIFT_SET_RPATH_FILE AND SWIFT_SET_RPATH_NEW_RPATH) | ||
_swift_set_rpath_impl("${SWIFT_SET_RPATH_FILE}" "${SWIFT_SET_RPATH_NEW_RPATH}") | ||
endif() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
There's a bunch of places we're only checking for Linux and others where we check for DARWIN and then else. Given we haven't checked the other platforms, should we just check for LINUX for now?