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

SourceKit compilation failures on Linux

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Done
    • Component/s: None
    • Labels:
      None

      Description

      When compiling SourceKit on Linux, the following link errors are seen:

      {{[656/659] Linking CXX executable bin/sourcekitd-repl
      FAILED: : && /usr/bin/clang++ -fno-stack-protector -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Werror=date-time -std=c++11 -fcolor-diagnostics -ffunction-sections -fdata-sections -Wdocumentation -Wimplicit-fallthrough -Wunreachable-code -Woverloaded-virtual -O3 -target x86_64-unknown-linux-gnu -lpthread -ldl -lBlocksRuntime tools/SourceKit/tools/sourcekitd-repl/CMakeFiles/sourcekitd-repl.dir/sourcekitd-repl.cpp.o -o bin/sourcekitd-repl -L/build/Ninja-ReleaseAssert/llvm-linux-x86_64/./lib lib/libsourcekitdInProc.so /tmp/libdispatch-linux-x86_64/src/.libs/libdispatch.so lib/swift/linux/libswiftCore.so -ledit /build/Ninja-ReleaseAssert/llvm-linux-x86_64/lib/libLLVMSupport.a -lBlocksRuntime -lrt -ldl -ltinfo -lpthread -lz -lm -Wl,-rpath,/build/Ninja-ReleaseAssert/llvm-linux-x86_64/./lib:/build/Ninja-ReleaseAssert/swift-linux-x86_64/lib:/tmp/libdispatch-linux-x86_64/src/.libs:/build/Ninja-ReleaseAssert/swift-linux-x86_64/lib/swift/linux && :
      lib/libsourcekitdInProc.so: undefined reference to `llvm::coverage::CoverageFilenamesSectionWriter::write(llvm::raw_ostream&)'
      lib/libsourcekitdInProc.so: undefined reference to `llvm::lto::thinBackend(llvm::lto::Config&, unsigned int, std::function<std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> > (unsigned int)>, llvm::Module&, llvm::ModuleSummaryIndex&, llvm::StringMap<std::map<unsigned long, unsigned int, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, unsigned int> > >, llvm::MallocAllocator> const&, std::map<unsigned long, llvm::GlobalValueSummary*, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, llvm::GlobalValueSummary*> > > const&, llvm::MapVector<llvm::StringRef, llvm::MemoryBufferRef, llvm::DenseMap<llvm::StringRef, unsigned int, llvm::DenseMapInfo<llvm::StringRef>, llvm::detail::DenseMapPair<llvm::StringRef, unsigned int> >, std::vector<std::pair<llvm::StringRef, llvm::MemoryBufferRef>, std::allocator<std::pair<llvm::StringRef, llvm::MemoryBufferRef> > > >&)'
      lib/libsourcekitdInProc.so: undefined reference to `llvm::coverage::CoverageMappingWriter::write(llvm::raw_ostream&)'
      clang: error: linker command failed with exit code 1 (use -v to see invocation)

      [656/659] Linking CXX executable bin/complete-test
      FAILED: : && /usr/bin/clang++ -fno-stack-protector -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Werror=date-time -std=c++11 -fcolor-diagnostics -ffunction-sections -fdata-sections -Wdocumentation -Wimplicit-fallthrough -Wunreachable-code -Woverloaded-virtual -O3 -target x86_64-unknown-linux-gnu -lpthread -ldl -lBlocksRuntime tools/SourceKit/tools/complete-test/CMakeFiles/complete-test.dir/complete-test.cpp.o -o bin/complete-test -L/build/Ninja-ReleaseAssert/llvm-linux-x86_64/./lib lib/libsourcekitdInProc.so /tmp/libdispatch-linux-x86_64/src/.libs/libdispatch.so lib/swift/linux/libswiftCore.so /build/Ninja-ReleaseAssert/llvm-linux-x86_64/lib/libLLVMSupport.a /build/Ninja-ReleaseAssert/llvm-linux-x86_64/lib/libLLVMOption.a -lBlocksRuntime /build/Ninja-ReleaseAssert/llvm-linux-x86_64/lib/libLLVMSupport.a -lrt -ldl -ltinfo -lpthread -lz -lm -Wl,-rpath,/build/Ninja-ReleaseAssert/llvm-linux-x86_64/./lib:/build/Ninja-ReleaseAssert/swift-linux-x86_64/lib:/tmp/libdispatch-linux-x86_64/src/.libs:/build/Ninja-ReleaseAssert/swift-linux-x86_64/lib/swift/linux && :
      lib/libsourcekitdInProc.so: undefined reference to `llvm::coverage::CoverageFilenamesSectionWriter::write(llvm::raw_ostream&)'
      lib/libsourcekitdInProc.so: undefined reference to `llvm::lto::thinBackend(llvm::lto::Config&, unsigned int, std::function<std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> > (unsigned int)>, llvm::Module&, llvm::ModuleSummaryIndex&, llvm::StringMap<std::map<unsigned long, unsigned int, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, unsigned int> > >, llvm::MallocAllocator> const&, std::map<unsigned long, llvm::GlobalValueSummary*, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, llvm::GlobalValueSummary*> > > const&, llvm::MapVector<llvm::StringRef, llvm::MemoryBufferRef, llvm::DenseMap<llvm::StringRef, unsigned int, llvm::DenseMapInfo<llvm::StringRef>, llvm::detail::DenseMapPair<llvm::StringRef, unsigned int> >, std::vector<std::pair<llvm::StringRef, llvm::MemoryBufferRef>, std::allocator<std::pair<llvm::StringRef, llvm::MemoryBufferRef> > > >&)'
      lib/libsourcekitdInProc.so: undefined reference to `llvm::coverage::CoverageMappingWriter::write(llvm::raw_ostream&)'
      clang: error: linker command failed with exit code 1 (use -v to see invocation)

      [656/659] Linking CXX executable bin/sourcekitd-test
      FAILED: : && /usr/bin/clang++ -fno-stack-protector -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Werror=date-time -std=c++11 -fcolor-diagnostics -ffunction-sections -fdata-sections -Wdocumentation -Wimplicit-fallthrough -Wunreachable-code -Woverloaded-virtual -O3 -target x86_64-unknown-linux-gnu -lpthread -ldl -lBlocksRuntime tools/SourceKit/tools/sourcekitd-test/CMakeFiles/sourcekitd-test.dir/sourcekitd-test.cpp.o tools/SourceKit/tools/sourcekitd-test/CMakeFiles/sourcekitd-test.dir/TestOptions.cpp.o -o bin/sourcekitd-test -L/build/Ninja-ReleaseAssert/llvm-linux-x86_64/./lib lib/libsourcekitdInProc.so lib/swift/linux/libswiftCore.so lib/libSourceKitSupport.a /build/Ninja-ReleaseAssert/llvm-linux-x86_64/lib/libclangRewrite.a /build/Ninja-ReleaseAssert/llvm-linux-x86_64/lib/libclangLex.a /build/Ninja-ReleaseAssert/llvm-linux-x86_64/lib/libclangBasic.a /build/Ninja-ReleaseAssert/llvm-linux-x86_64/lib/libLLVMCore.a /build/Ninja-ReleaseAssert/llvm-linux-x86_64/lib/libLLVMSupport.a /build/Ninja-ReleaseAssert/llvm-linux-x86_64/lib/libLLVMOption.a /tmp/libdispatch-linux-x86_64/src/.libs/libdispatch.so lib/libswiftBasic.a /usr/lib/x86_64-linux-gnu/libuuid.so /build/Ninja-ReleaseAssert/llvm-linux-x86_64/./lib/libclangBasic.a /build/Ninja-ReleaseAssert/llvm-linux-x86_64/./lib/libclangRewrite.a -lBlocksRuntime /build/Ninja-ReleaseAssert/llvm-linux-x86_64/lib/libLLVMMC.a /build/Ninja-ReleaseAssert/llvm-linux-x86_64/lib/libLLVMSupport.a -lrt -ldl -ltinfo -lpthread -lz -lm -Wl,-rpath,/build/Ninja-ReleaseAssert/llvm-linux-x86_64/./lib:/build/Ninja-ReleaseAssert/swift-linux-x86_64/lib:/build/Ninja-ReleaseAssert/swift-linux-x86_64/lib/swift/linux:/tmp/libdispatch-linux-x86_64/src/.libs && :
      lib/libsourcekitdInProc.so: undefined reference to `llvm::coverage::CoverageFilenamesSectionWriter::write(llvm::raw_ostream&)'
      lib/libsourcekitdInProc.so: undefined reference to `llvm::lto::thinBackend(llvm::lto::Config&, unsigned int, std::function<std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> > (unsigned int)>, llvm::Module&, llvm::ModuleSummaryIndex&, llvm::StringMap<std::map<unsigned long, unsigned int, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, unsigned int> > >, llvm::MallocAllocator> const&, std::map<unsigned long, llvm::GlobalValueSummary*, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, llvm::GlobalValueSummary*> > > const&, llvm::MapVector<llvm::StringRef, llvm::MemoryBufferRef, llvm::DenseMap<llvm::StringRef, unsigned int, llvm::DenseMapInfo<llvm::StringRef>, llvm::detail::DenseMapPair<llvm::StringRef, unsigned int> >, std::vector<std::pair<llvm::StringRef, llvm::MemoryBufferRef>, std::allocator<std::pair<llvm::StringRef, llvm::MemoryBufferRef> > > >&)'
      lib/libsourcekitdInProc.so: undefined reference to `llvm::coverage::CoverageMappingWriter::write(llvm::raw_ostream&)'
      clang: error: linker command failed with exit code 1 (use -v to see invocation)
      [656/659] Building CXX object stdlib/p...st-linux-x86_64.dir/InspectValue.cpp.o
      ninja: build stopped: subcommand failed.

      ./swift/utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting
      }}

      They can be fixed by adding 'coverage' and 'lto' to the dependencies for the sourcekitd-repl, complete-test and sourcekitd-test dependencies.

        Attachments

          Activity

            People

            Assignee:
            alblue Alex Blewitt
            Reporter:
            alblue Alex Blewitt
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: