-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Closed
Labels
ConcurrencуArea → standard library: The `Concurrency` module under the standard library umbrellaArea → standard library: The `Concurrency` module under the standard library umbrellaLinuxPlatform: LinuxPlatform: LinuxbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.static librariesstatic stdlib
Description
Previous ID | SR-15690 |
Radar | rdar://problem/87165056 |
Original Reporter | t089 (JIRA User) |
Type | Bug |
Environment
Swift version 5.5.2
Docker: swift:5.5.2-focal
Additional Detail from JIRA
Votes | 1 |
Component/s | |
Labels | Bug |
Assignee | @drexin |
Priority | Medium |
md5: 419a2a530bb784aa387000ea2cfc2cf0
Issue Description:
Given this swift executable program
# app.swift
@main
struct App {
static func main() async throws {
print("Hello")
try await Task.sleep(nanoseconds: 1_000_000_000)
print("Bye!")
}
}
On linux, you cannot build a binary with{{}}
swift build -c release --static-swift-stdlib
{{}}Because of
error: link command failed with exit code 1 (use -v to see invocation)
/usr/lib/swift_static/linux/libswift_Concurrency.a(GlobalExecutor.cpp.o):GlobalExecutor.cpp:function swift_task_enqueueGlobalImpl(swift::Job*): error: undefined reference to '_dispatch_queue_attr_concurrent'
/usr/lib/swift_static/linux/libswift_Concurrency.a(GlobalExecutor.cpp.o):GlobalExecutor.cpp:function swift_task_enqueueGlobalImpl(swift::Job*): error: undefined reference to '_dispatch_queue_attr_concurrent'
/usr/lib/swift_static/linux/libswift_Concurrency.a(GlobalExecutor.cpp.o):GlobalExecutor.cpp:function swift_task_enqueueGlobalImpl(swift::Job*): error: undefined reference to 'dispatch_queue_attr_make_with_qos_class'
/usr/lib/swift_static/linux/libswift_Concurrency.a(GlobalExecutor.cpp.o):GlobalExecutor.cpp:function swift_task_enqueueGlobalImpl(swift::Job*): error: undefined reference to 'dispatch_queue_create'
/usr/lib/swift_static/linux/libswift_Concurrency.a(GlobalExecutor.cpp.o):GlobalExecutor.cpp:function swift_task_enqueueGlobalImpl(swift::Job*): error: undefined reference to 'dispatch_queue_set_width'
/usr/lib/swift_static/linux/libswift_Concurrency.a(GlobalExecutor.cpp.o):GlobalExecutor.cpp:function swift_task_enqueueGlobalImpl(swift::Job*): error: undefined reference to 'dispatch_release'
/usr/lib/swift_static/linux/libswift_Concurrency.a(GlobalExecutor.cpp.o):GlobalExecutor.cpp:function swift_task_enqueueGlobalWithDelayImpl(unsigned long long, swift::Job*): error: undefined reference to 'dispatch_time'
/usr/lib/swift_static/linux/libswift_Concurrency.a(GlobalExecutor.cpp.o):GlobalExecutor.cpp:function swift_task_enqueueGlobalWithDelayImpl(unsigned long long, swift::Job*): error: undefined reference to 'dispatch_after_f'
/usr/lib/swift_static/linux/libswift_Concurrency.a(GlobalExecutor.cpp.o):GlobalExecutor.cpp:function swift_task_enqueueGlobalWithDelayImpl(unsigned long long, swift::Job*): error: undefined reference to '_dispatch_queue_attr_concurrent'
/usr/lib/swift_static/linux/libswift_Concurrency.a(GlobalExecutor.cpp.o):GlobalExecutor.cpp:function swift_task_enqueueGlobalWithDelayImpl(unsigned long long, swift::Job*): error: undefined reference to '_dispatch_queue_attr_concurrent'
/usr/lib/swift_static/linux/libswift_Concurrency.a(GlobalExecutor.cpp.o):GlobalExecutor.cpp:function swift_task_enqueueGlobalWithDelayImpl(unsigned long long, swift::Job*): error: undefined reference to 'dispatch_queue_attr_make_with_qos_class'
/usr/lib/swift_static/linux/libswift_Concurrency.a(GlobalExecutor.cpp.o):GlobalExecutor.cpp:function swift_task_enqueueGlobalWithDelayImpl(unsigned long long, swift::Job*): error: undefined reference to 'dispatch_queue_create'
/usr/lib/swift_static/linux/libswift_Concurrency.a(GlobalExecutor.cpp.o):GlobalExecutor.cpp:function swift_task_enqueueGlobalWithDelayImpl(unsigned long long, swift::Job*): error: undefined reference to 'dispatch_queue_set_width'
/usr/lib/swift_static/linux/libswift_Concurrency.a(GlobalExecutor.cpp.o):GlobalExecutor.cpp:function swift_task_enqueueGlobalWithDelayImpl(unsigned long long, swift::Job*): error: undefined reference to 'dispatch_release'
/usr/lib/swift_static/linux/libswift_Concurrency.a(GlobalExecutor.cpp.o):GlobalExecutor.cpp:function swift_task_enqueueMainExecutor: error: undefined reference to '_dispatch_main_q'
/usr/lib/swift_static/linux/libswift_Concurrency.a(GlobalExecutor.cpp.o):GlobalExecutor.cpp:function swift_task_enqueueMainExecutor: error: undefined reference to '_dispatch_main_q'
/usr/lib/swift_static/linux/libswift_Concurrency.a(GlobalExecutor.cpp.o):GlobalExecutor.cpp:function swift_task_enqueueMainExecutorImpl(swift::Job*): error: undefined reference to '_dispatch_main_q'
/usr/lib/swift_static/linux/libswift_Concurrency.a(GlobalExecutor.cpp.o):GlobalExecutor.cpp:function swift_task_enqueueMainExecutorImpl(swift::Job*): error: undefined reference to '_dispatch_main_q'
/usr/lib/swift_static/linux/libswift_Concurrency.a(GlobalExecutor.cpp.o):GlobalExecutor.cpp:function dispatchEnqueueDispatchAsync(dispatch_queue_s*, void*, unsigned int): error: undefined reference to 'dispatch_async_f'
/usr/lib/swift_static/linux/libswift_Concurrency.a(Task.cpp.o):Task.cpp:function swift_task_asyncMainDrainQueueImpl(): error: undefined reference to 'dispatch_main'
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
It works if you explicitly import Dispatch.
Swift version 5.5.2
Metadata
Metadata
Assignees
Labels
ConcurrencуArea → standard library: The `Concurrency` module under the standard library umbrellaArea → standard library: The `Concurrency` module under the standard library umbrellaLinuxPlatform: LinuxPlatform: LinuxbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.static librariesstatic stdlib