Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-3223] SourceKit compilation failures on Linux #45811

Closed
alblue opened this issue Nov 16, 2016 · 3 comments
Closed

[SR-3223] SourceKit compilation failures on Linux #45811

alblue opened this issue Nov 16, 2016 · 3 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.

Comments

@alblue
Copy link
Contributor

alblue commented Nov 16, 2016

Previous ID SR-3223
Radar None
Original Reporter @alblue
Type Bug
Status Closed
Resolution Done
Additional Detail from JIRA
Votes 1
Component/s
Labels Bug
Assignee @alblue
Priority Medium

md5: f4d89322660151769614a950f5b182cd

Issue 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_deletellvm::raw_pwrite_stream > (unsigned int)>, llvm::Module&, llvm::ModuleSummaryIndex&, llvm::StringMap<std::map<unsigned long, unsigned int, std::less, std::allocator<std::pair<unsigned long const, unsigned int> > >, llvm::MallocAllocator> const&, std::map<unsigned long, llvm::GlobalValueSummary*, std::less, std::allocator<std::pair<unsigned long const, llvm::GlobalValueSummary*> > > const&, llvm::MapVector<llvm::StringRef, llvm::MemoryBufferRef, llvm::DenseMap<llvm::StringRef, unsigned int, llvm::DenseMapInfollvm::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_deletellvm::raw_pwrite_stream > (unsigned int)>, llvm::Module&, llvm::ModuleSummaryIndex&, llvm::StringMap<std::map<unsigned long, unsigned int, std::less, std::allocator<std::pair<unsigned long const, unsigned int> > >, llvm::MallocAllocator> const&, std::map<unsigned long, llvm::GlobalValueSummary*, std::less, std::allocator<std::pair<unsigned long const, llvm::GlobalValueSummary*> > > const&, llvm::MapVector<llvm::StringRef, llvm::MemoryBufferRef, llvm::DenseMap<llvm::StringRef, unsigned int, llvm::DenseMapInfollvm::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_deletellvm::raw_pwrite_stream > (unsigned int)>, llvm::Module&, llvm::ModuleSummaryIndex&, llvm::StringMap<std::map<unsigned long, unsigned int, std::less, std::allocator<std::pair<unsigned long const, unsigned int> > >, llvm::MallocAllocator> const&, std::map<unsigned long, llvm::GlobalValueSummary*, std::less, std::allocator<std::pair<unsigned long const, llvm::GlobalValueSummary*> > > const&, llvm::MapVector<llvm::StringRef, llvm::MemoryBufferRef, llvm::DenseMap<llvm::StringRef, unsigned int, llvm::DenseMapInfollvm::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.

@belkadan
Copy link
Contributor

cc @benlangmuir

@alblue
Copy link
Contributor Author

alblue commented Nov 18, 2016

Pushed a fix to #5862

@alblue
Copy link
Contributor Author

alblue commented Dec 1, 2016

This has been merged to master

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.
Projects
None yet
Development

No branches or pull requests

2 participants