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

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

Comments

@swift-ci
Copy link

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

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

duplicates:

  • 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
dispatchMain()

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/ld.gold: error: cannot find -ldispatch
/usr/bin/ld.gold: error: cannot find -lswiftImageInspectionShared
/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-02-25-a-ubuntu16.04/usr/lib/swift/linux/x86_64/swiftrt.o:/home/buildnode/jenkins/workspace/oss-swift-4.1-package-linux-ubuntu-16_04/swift/stdlib/pu
blic/runtime/SwiftRT-ELF.cpp:function swift_image_constructor(): error: undefined reference to 'swift_addNewDSOImage'
/home/notorca/test/.build/x86_64-unknown-linux/release/test.build/main.swift.o:/home/notorca/test/.build/x86_64-unknown-linux/release/test.build/main.swift.o:function 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.

@aciidb0mb3r
Copy link
Member

This is expected, IIRC.

@swift-ci
Copy link
Author

Comment by Cyril Lashkevich (JIRA)

Is there any specific reason not to have static libdispatch?

@aciidb0mb3r
Copy link
Member

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

@belkadan
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
Projects
None yet
Development

No branches or pull requests

3 participants