[Build] Add the new fully-static Linux SDK.#73455
Merged
al45tair merged 3 commits intoswiftlang:release/6.0from May 7, 2024
Merged
[Build] Add the new fully-static Linux SDK.#73455al45tair merged 3 commits intoswiftlang:release/6.0from
al45tair merged 3 commits intoswiftlang:release/6.0from
Conversation
[Build] Add the new fully-static Linux SDK.
Contributor
Author
|
Explanation: Adds the fully statically linked Linux SDK to the build system. |
Contributor
Author
|
@swift-ci Please test |
When SWIFT_BUILD_STATIC_STDLIB=ON, SWIFT_BUILD_DYNAMIC_STDLIB=OFF, and
the sdk being built is not a static-only (e.g. WASI), the build fails
due to duplicate custom command rules against the same output path.
In the case of WASI, the static archive should be copied into lib/swift
by the first lipo target, and then the second lipo target should copy it
into lib/swift_static.
```
CMake Error at cmake/modules/SwiftAddCustomCommandTarget.cmake:144 (add_custom_command):
Attempt to add a custom rule to output
/home/build-user/build/buildbot_linux/wasmstdlib-linux-x86_64/lib/swift_static/wasi/libswiftCore.a.rule
which already has a custom rule.
Call Stack (most recent call first):
stdlib/cmake/modules/AddSwiftStdlib.cmake:673 (add_custom_command_target)
stdlib/cmake/modules/AddSwiftStdlib.cmake:2657 (_add_swift_lipo_target)
stdlib/public/core/CMakeLists.txt:401 (add_swift_target_library)
```
Contributor
Author
|
Cherry picked this fix: #73474 |
Contributor
Author
|
@swift-ci Please test |
In swiftlang#72061 the test was modified because LLD and Gold linker map formats are different, so they need different CHECKs. The original method in PR swiftlang#72061 presents problems when the output is not exactly only one line. These changes use the first line of the linker map file to decide if the Gold or the LLD linker map checks should be used, since the format differs in both for the first line. This way of checking works in my Linux machine when using the default linker, when forcing Gold with `-use-ld=gold` and when forcing LLD with `-use-ld=lld`.
Contributor
Author
|
And this one too: #73470 |
Contributor
Author
|
@swift-ci Please test |
tbkka
approved these changes
May 7, 2024
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Declare a new
LINUX_STATICSDK and configure it.Add options to set the build architectures for the
LINUXandLINUX_STATICSDKs, similar to what we have for Darwin, because we'll be cross-compiling.Also add an option to point the build system at the sources for the musl C library, which we're using for
LINUX_STATIC.rdar://123503470