-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Build] Add the new fully-static Linux SDK. #73455
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
[Build] Add the new fully-static Linux SDK.
Explanation: Adds the fully statically linked Linux SDK to the build system. |
@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) ```
Cherry picked this fix: #73474 |
@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`.
And this one too: #73470 |
@swift-ci Please test |
Declare a new
LINUX_STATIC
SDK and configure it.Add options to set the build architectures for the
LINUX
andLINUX_STATIC
SDKs, 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