Skip to content

Conversation

alblue
Copy link
Contributor

@alblue alblue commented Nov 18, 2016

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
Copy link
Contributor Author

alblue commented Nov 22, 2016

I have fixed this to also allow the unit tests to run successfully.

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
Copy link
Contributor Author

alblue commented Nov 29, 2016

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

@modocache
Copy link
Contributor

@swift-ci Please smoke test

@alblue
Copy link
Contributor Author

alblue commented Nov 29, 2016

Thanks!

@jrose-apple
Copy link
Contributor

@nkcsgexi or @akyrtzi, sanity check?

@akyrtzi
Copy link
Contributor

akyrtzi commented Nov 30, 2016

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
Copy link
Contributor Author

alblue commented Nov 30, 2016

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
Copy link
Contributor

akyrtzi commented Nov 30, 2016

Ok, SGTM.

@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