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

swiftc -static-stdlib option fails on Ubuntu 14.04 & 15.10

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Done
    • Component/s: Compiler
    • Labels:
      None
    • Environment:

      Ubuntu 14.04, Ubuntu 15.10

      Description

      The `-static-stdlib` option fails on Ubuntu 14.04 and on 15.10 (on macOS it works). This is using the latest nightly toolchain (`LLVM 3a878c6fdb, Clang cb02d1caed, Swift 8436ef8993`).

      To reproduce:

      echo 'print("hello")' > main.swift
      swiftc -static-stdlib main.swift -o main
      

      The result is this:

      <unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)
      user@ubuntu:/var/tmp/Static$ ^C
      user@ubuntu:/var/tmp/Static$ swiftc -static-stdlib main.swift
      /usr/bin/ld: cannot find -lbsd
      /usr/bin/ld: cannot find -licui18n
      /usr/bin/ld: cannot find -licuuc
      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)
      

      Passing `-v` yields this:

      Swift version 3.0-dev (LLVM 3a878c6fdb, Clang cb02d1caed, Swift 8436ef8993)
      Target: x86_64-unknown-linux-gnu
      /home/user/Documents/usr/bin/swift -frontend -c -primary-file main.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -color-diagnostics -module-name main -o /tmp/main-58b97c.o
      /home/user/Documents/usr/bin/swift-autolink-extract /tmp/main-58b97c.o -o /tmp/main-f05ff6.autolink
      /usr/bin/clang++ -fuse-ld=gold -target x86_64-unknown-linux-gnu -Xlinker -rpath -Xlinker /home/user/Documents/usr/lib/swift/linux /home/user/Documents/usr/lib/swift/linux/x86_64/swift_begin.o /tmp/main-58b97c.o -L /home/user/Documents/usr/lib/swift_static/linux -ldl -lpthread -lbsd -licui18n -licuuc -Xlinker -export-dynamic -Xlinker --exclude-libs -Xlinker ALL --target=x86_64-unknown-linux-gnu -lswiftCore @/tmp/main-f05ff6.autolink /home/user/Documents/usr/lib/swift/linux/x86_64/swift_end.o -o main
      /usr/bin/ld: cannot find -lbsd
      /usr/bin/ld: cannot find -licui18n
      /usr/bin/ld: cannot find -licuuc
      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)
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                spevans Simon Evans
                Reporter:
                abertelrud Anders Bertelrud
              • Votes:
                4 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: