Skip to content
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

[SR-7085] Link error related to libdispatch when using -static-stdlib on Linux #661

swift-ci opened this issue Feb 26, 2018 · 4 comments


Copy link

Previous ID SR-7085
Radar None
Original Reporter notorca (JIRA User)
Type Bug
Status Resolved
Resolution Duplicate

Ubuntu 16.04 and swift-4.1-DEVELOPMENT-SNAPSHOT-2018-02-25-a-ubuntu16.04

Additional Detail from JIRA
Votes 0
Component/s libdispatch
Labels Bug
Assignee None
Priority Medium

md5: 7e68a5445dfe205831b793e0904a8527


  • SR-7039 can't use -static-stdlib (or -static-executable) with any Dispatch using app

Issue Description:

Static version of libdispatch is missing in swift-4.1-DEVELOPMENT-SNAPSHOT-2018-02-25-a-ubuntu16.04. Seems it is also missing in 4.0.3 release.

For test program like this:

import Dispatch

Result is:

~/test$ swift build -c release -Xswiftc -static-stdlib
Compile Swift Module 'test' (1 sources)
Linking ./.build/x86_64-unknown-linux/release/test
/usr/bin/ error: cannot find -ldispatch
/usr/bin/ error: cannot find -lswiftImageInspectionShared
blic/runtime/SwiftRT-ELF.cpp:function swift_image_constructor(): error: undefined reference to 'swift_addNewDSOImage'
/home/notorca/test/.build/x86_64-unknown-linux/release/ main: error: unde
fined reference to '_T08Dispatch12dispatchMains5NeverOyF'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
<unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)
error: terminated(1): /swift-4.1-DEVELOPMENT-SNAPSHOT-2018-02-25-a-ubuntu16.04/usr/bin/swift-build-tool -f /home/notorca/test/.build/release.yaml main output:

Error about swiftImageInspectionShared is related to SR-7038.

Copy link

This is expected, IIRC.

Copy link

Comment by Cyril Lashkevich (JIRA)

Is there any specific reason not to have static libdispatch?

Copy link

I think we just need to finish the support for static linking. I am sure there’s already a bug tracking this.

Copy link

Oops, yep.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

3 participants