Fix build errors for SourceKit on Linux by alblue · Pull Request #5862 · swiftlang/swift · GitHub
Skip to content

Fix build errors for SourceKit on Linux - #5862

Merged
jrose-apple merged 1 commit into
swiftlang:masterfrom
alblue:SR-3223
Nov 30, 2016
Merged

jrose-apple merged 1 commit into
swiftlang:masterfrom
alblue:SR-3223

Conversation

@alblue

@alblue alblue commented Nov 18, 2016

Copy link
Copy Markdown
Contributor

The sourcekitd-repl, sourcekitd-test and complete-test use symbols
from both the coverage and lto modules, specifically
llvm::coverage::CoverageFilenamesSectionWriter::write and
llvm::lto::thinBackend. Adding these to the list of dependencies
allows SourceKit to be built on Linux.

Resolves SR-3223.

@alblue

alblue commented Nov 22, 2016

Copy link
Copy Markdown
Contributor Author

The sourcekitd-repl, sourcekitd-test and complete-test use symbols
from both the coverage and lto modules, specifically
`llvm::coverage::CoverageFilenamesSectionWriter::write` and
`llvm::lto::thinBackend`. Adding these to the list of dependencies
allows SourceKit to be built on Linux.

Issue: SR-3223
@alblue

alblue commented Nov 29, 2016

Copy link
Copy Markdown
Contributor Author

Can someone trigger a smoke test for this? The checks appear to have been hanging for some time.

@modocache

Copy link
Copy Markdown
Contributor

@swift-ci Please smoke test

@alblue

alblue commented Nov 29, 2016

Copy link
Copy Markdown
Contributor Author

Thanks!

@jrose-apple

Copy link
Copy Markdown
Contributor

@nkcsgexi or @akyrtzi, sanity check?

@akyrtzi

akyrtzi commented Nov 30, 2016

Copy link
Copy Markdown
Contributor

Could you try removing coverage from tools/SourceKit/lib/SwiftLang/CMakeLists.txt ?
A bunch of such dependencies were added a while back to workaround linker errors on linux but they may be unnecessary now. Also stuff like mc, mcparser, etc.

It would be great if you could check if we can reduce dependencies now.

@alblue

alblue commented Nov 30, 2016

Copy link
Copy Markdown
Contributor Author

No, it doesn't compile if you remove coverage from tools/SourceKit/lib/SwiftLang/CMakeLists.txt

.../swift-build/build/Ninja-ReleaseAssert/llvm-linux-x86_64/./lib/libclangCodeGen.a(CoverageMappingGen.cpp.o):.../swift-build/llvm/tools/clang/lib/CodeGen/CoverageMappingGen.cpp:function clang::CodeGen::CoverageMappingModuleGen::emit(): error: undefined reference to 'llvm::coverage::CoverageFilenamesSectionWriter::write(llvm::raw_ostream&)'
.../swift-build/build/Ninja-ReleaseAssert/llvm-linux-x86_64/./lib/libclangCodeGen.a(CoverageMappingGen.cpp.o):.../swift-build/llvm/tools/clang/lib/CodeGen/CoverageMappingGen.cpp:function clang::CodeGen::CoverageMappingGen::emitCounterMapping(clang::Decl const*, llvm::raw_ostream&): error: undefined reference to 'llvm::coverage::CoverageMappingWriter::write(llvm::raw_ostream&)'
.../swift-build/build/Ninja-ReleaseAssert/llvm-linux-x86_64/./lib/libclangCodeGen.a(CoverageMappingGen.cpp.o):.../swift-build/llvm/tools/clang/lib/CodeGen/CoverageMappingGen.cpp:function clang::CodeGen::CoverageMappingGen::emitEmptyMapping(clang::Decl const*, llvm::raw_ostream&): error: undefined reference to 'llvm::coverage::CoverageMappingWriter::write(llvm::raw_ostream&)'

Once I get the code building error free, I'd like to try and get SourceKit building by default on Linux (see pull request #5903 for an approach that works but is almost certainly the wrong one). When we have the build of SourceKit happening by default on Linux then we can look at reducing the dependencies.

@akyrtzi

akyrtzi commented Nov 30, 2016

Copy link
Copy Markdown
Contributor

@jrose-apple
jrose-apple merged commit 8531c5d into swiftlang:master Nov 30, 2016
@alblue
alblue deleted the SR-3223 branch December 1, 2016 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants