Uploaded image for project: 'Swift'
  1. Swift
  2. SR-7085

Link error related to libdispatch when using -static-stdlib on Linux

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Duplicate
    • Component/s: libdispatch
    • Labels:
      None
    • Environment:

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

      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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                notorca Cyril Lashkevich
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: