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

Stdlib not being linked on swift build

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Done
    • Component/s: Package Manager
    • Labels:
      None
    • Environment:
      • OS X 10.11.1
      • Apple Swift version 2.2-dev (LLVM 46be9ff861, Clang 4deb154edc, Swift 778f82939c) Target: x86_64-apple-macosx10.9.

      Description

      Hi,

      as pushed over swift-users@ previously, I'm currently experiencing an issue where `swift build` apparently fails to link the standard library.

      The project being built here is just a minimal hello-world example with nothing but a print() statement. Everything seems to run just fine in the REPL.

      Here's the verbose output when trying to build:

      ```
      /Library/Developer/Toolchains/swift-2.2-SNAPSHOT-2015-12-01-a.xctoolchain/usr/bin/swiftc -module-name foo -incremental -emit-dependencies -emit-module -emit-module-path /Users/kilian/Desktop/foo/.build/debug/foo.swiftmodule -output-file-map /Users/kilian/Desktop/foo/.build/debug/foo.o/foo/output-file-map.json -c /Users/kilian/Desktop/foo/Sources/main.swift -I /Users/kilian/Desktop/foo/.build/debug -j8 -Onone -g -target x86_64-apple-macosx10.10 -sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -I /usr/local/include
      /Library/Developer/Toolchains/swift-2.2-SNAPSHOT-2015-12-01-a.xctoolchain/usr/bin/swiftc -o /Users/kilian/Desktop/foo/.build/debug/foo /Users/kilian/Desktop/foo/.build/debug/foo.o/Sources/main.swift.o -Xlinker -all_load -target x86_64-apple-macosx10.10 -sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -L/usr/local/lib
      Undefined symbols for architecture x86_64:
      "_TFSSCfT21_builtinStringLiteralBp8byteSizeBw7isASCIIBi1_SS", referenced from:
      _main in main.swift.o
      "_TFs5printFTGSaP9separatorSS10terminatorSS_T", referenced from:
      _main in main.swift.o
      "_TIFs5printFTGSaP9separatorSS10terminatorSS_T_A0", referenced from:
      _main in main.swift.o
      "_TIFs5printFTGSaP9separatorSS10terminatorSS_T_A1", referenced from:
      _main in main.swift.o
      "__TMSS", referenced from:
      _main in main.swift.o
      "_TTSg5P__TFs27_allocateUninitializedArrayurFBwTGSax_Bp", referenced from:
      _main in main.swift.o
      "_TZvOs7Process11_unsafeArgvGSpGSpVs4Int8_", referenced from:
      _main in main.swift.o
      "__TZvOs7Process5_argcVs5Int32", referenced from:
      _main in main.swift.o
      "_globalinit_33_1BDF70FFC18749BAB495A73B459ED2F0_func5", referenced from:
      _main in main.swift.o
      "_globalinit_33_1BDF70FFC18749BAB495A73B459ED2F0_token5", referenced from:
      _main in main.swift.o
      ld: symbol(s) not found for architecture x86_64
      <unknown>:0: error: build had 1 command failures
      swift-build: exit(1): ["/Library/Developer/Toolchains/swift-2.2-SNAPSHOT-2015-12-01-a.xctoolchain/usr/bin/swift-build-tool", "-v", "-f", "/Users/kilian/Desktop/foo/.build/debug/foo.o/llbuild.yaml"]
      ```

        Attachments

          Activity

            People

            Assignee:
            ddunbar Daniel Dunbar
            Reporter:
            kiliankoe Kilian Koeltzsch
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: