Closed as not planned
Closed as not planned
Description
Description
When switching between different linking modes on Linux, the build state is apparently not cleaned up correctly, which causes build errors.
Expected behavior
Running swift build --no-static-swift-stdlib
after swift build --static-swift-stdlib
should rebuild the project with correct linker settings with no errors.
Actual behavior
Build fails with this error message
error: link command failed with exit code 1 (use -v to see invocation)
/usr/bin/ld.gold: error: cannot find -lDispatchStubs
/usr/bin/ld.gold: error: cannot find -lCoreFoundation
/usr/bin/ld.gold: error: cannot find -luuid
clang-13: error: linker command failed with exit code 1 (use -v to see invocation)
Steps to reproduce
- Generate a new project with
swift package init --type executable
- Build it with
swift build --static-swift-stdlib
- Build it again, now with
swift build --no-static-swift-stdlib
Swift Package Manager version/commit hash
5.7.0
Swift & OS version (output of swift --version && uname -a
)
Swift version 5.7 (swift-5.7-RELEASE)
Target: aarch64-unknown-linux-gnu
Linux 2e60786449d5 5.15.49-linuxkit #1 SMP PREEMPT Tue Sep 13 07:51:32 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux