sourcegraph / lsif-clang

Language Server Indexing Format (LSIF) generator for C, C++ and Objective C
https://lsif.dev/
34 stars 8 forks source link

doesn't build on ubuntu 18.04 #3

Closed shrouxm closed 4 years ago

shrouxm commented 4 years ago

after successfully configuring the project, running make yields the following errors

CMakeFiles/lsif-clang.dir/IndexerMain.cpp.o:(.data.rel.ro._ZTIN4llvm2cl15OptionValueCopyINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE[_ZTIN4llvm2cl15OptionValueCopyINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE]+0x10): undefined reference to `typeinfo for llvm::cl::GenericOptionValue'
CMakeFiles/lsif-clang.dir/IndexerMain.cpp.o:(.data.rel.ro+0x10): undefined reference to `typeinfo for clang::tooling::FrontendActionFactory'
../libclangDaemonFork.a(IndexAction.cpp.o):(.data.rel.ro+0x10): undefined reference to `typeinfo for clang::PPCallbacks'
../libclangDaemonFork.a(IndexAction.cpp.o):(.data.rel.ro+0x28): undefined reference to `typeinfo for clang::ASTFrontendAction'
../libclangDaemonFork.a(SourceCode.cpp.o):(.data.rel.ro._ZTIN4llvm13FormatAdapterINS_5ErrorEEE[_ZTIN4llvm13FormatAdapterINS_5ErrorEEE]+0x10): undefined reference to `typeinfo for llvm::detail::format_adapter'
../libclangDaemonFork.a(SourceCode.cpp.o):(.data.rel.ro._ZTIN4llvm6detail23provider_format_adapterIRiEE[_ZTIN4llvm6detail23provider_format_adapterIRiEE]+0x10): undefined reference to `typeinfo for llvm::detail::format_adapter'
../libclangDaemonFork.a(SourceCode.cpp.o):(.data.rel.ro._ZTIN4llvm6detail30stream_operator_format_adapterIN5clang6clangd14OffsetEncodingEEE[_ZTIN4llvm6detail30stream_operator_format_adapterIN5clang6clangd14OffsetEncodingEEE]+0x10): undefined reference to `typeinfo for llvm::detail::format_adapter'
../libclangDaemonFork.a(SourceCode.cpp.o):(.data.rel.ro._ZTIN4llvm6detail23provider_format_adapterIRNS_11SmallStringILj128EEEEE[_ZTIN4llvm6detail23provider_format_adapterIRNS_11SmallStringILj128EEEEE]+0x10): undefined reference to `typeinfo for llvm::detail::format_adapter'
../libclangDaemonFork.a(SourceCode.cpp.o):(.data.rel.ro._ZTIN4llvm6detail23provider_format_adapterINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE[_ZTIN4llvm6detail23provider_format_adapterINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE]+0x10): undefined reference to `typeinfo for llvm::detail::format_adapter'
../libclangDaemonFork.a(SourceCode.cpp.o):(.data.rel.ro._ZTIN4llvm6detail23provider_format_adapterIRNS_9StringRefEEE[_ZTIN4llvm6detail23provider_format_adapterIRNS_9StringRefEEE]+0x10): more undefined references to `typeinfo for llvm::detail::format_adapter' follow
../libclangDaemonFork.a(FuzzyMatch.cpp.o):(.data.rel.ro._ZTIN4llvm13format_objectIJiEEE[_ZTIN4llvm13format_objectIJiEEE]+0x10): undefined reference to `typeinfo for llvm::format_object_base'
../libclangDaemonFork.a(FuzzyMatch.cpp.o):(.data.rel.ro._ZTIN4llvm13format_objectIJicEEE[_ZTIN4llvm13format_objectIJicEEE]+0x10): undefined reference to `typeinfo for llvm::format_object_base'
../libclangDaemonFork.a(Logger.cpp.o):(.data.rel.ro._ZTIN4llvm6detail23provider_format_adapterIcEE[_ZTIN4llvm6detail23provider_format_adapterIcEE]+0x10): undefined reference to `typeinfo for llvm::detail::format_adapter'
../libclangDaemonFork.a(Logger.cpp.o):(.data.rel.ro._ZTIN4llvm6detail23provider_format_adapterIRNSt6chrono10time_pointINS2_3_V212system_clockENS2_8durationIlSt5ratioILl1ELl1000000000EEEEEEEE[_ZTIN4llvm6detail23provider_format_adapterIRNSt6chrono10time_pointINS2_3_V212system_clockENS2_8durationIlSt5ratioILl1ELl1000000000EEEEEEEE]+0x10): undefined reference to `typeinfo for llvm::detail::format_adapter'
../libclangDaemonFork.a(Logger.cpp.o):(.data.rel.ro._ZTIN4llvm6detail30stream_operator_format_adapterIRKNS_19formatv_object_baseEEE[_ZTIN4llvm6detail30stream_operator_format_adapterIRKNS_19formatv_object_baseEEE]+0x10): undefined reference to `typeinfo for llvm::detail::format_adapter'
../libclangDaemonFork.a(URI.cpp.o):(.data.rel.ro._ZTIN4llvm6detail23provider_format_adapterIRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE[_ZTIN4llvm6detail23provider_format_adapterIRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE]+0x10): undefined reference to `typeinfo for llvm::detail::format_adapter'
../libclangDaemonFork.a(CanonicalIncludes.cpp.o):(.data.rel.ro+0x10): undefined reference to `typeinfo for clang::CommentHandler'
../libclangDaemonFork.a(Headers.cpp.o):(.data.rel.ro+0x10): undefined reference to `typeinfo for clang::PPCallbacks'
collect2: error: ld returned 1 exit status
indexer/CMakeFiles/lsif-clang.dir/build.make:146: recipe for target 'bin/lsif-clang' failed
make[2]: *** [bin/lsif-clang] Error 1
CMakeFiles/Makefile2:197: recipe for target 'indexer/CMakeFiles/lsif-clang.dir/all' failed
make[1]: *** [indexer/CMakeFiles/lsif-clang.dir/all] Error 2
Makefile:148: recipe for target 'all' failed
make: *** [all] Error 2

i was unable to reproduce this on a fresh ubuntu 18.04 docker image, waiting on user to provide more environment information

aidaeology commented 4 years ago

@gbrik What is the status of this issue, was this resolved with the 3.20 milestone or does it still need work? If it's resolved and longer a problem then please mark as closed and link the relevant PR. Otherwise please provide a status update here on what the remaining work is to get it resolved.

shrouxm commented 4 years ago

Remaining work is confirming with @beyang whether this is still an issue and, if so, getting more detailed information about the build environment & steps to determine what is causing the issue.

beyang commented 4 years ago

I futzed around a lot with my clang installation today and got it to work. I don't have exact repro steps on how I resolved the issue, but it had something to do with the fact that my original clang installation was missing a bunch of header files (including the ones containing the definitions for the undefined references in the stack trace). After uninstalling, manually cleaning a bunch of old directories that apt remove failed to remove, and then reinstalling using the current instructions, the build worked, and I've successfully run lsif-clang on itself.

I will try to replicate inside a clean Ubuntu 18.04 container, but consider me unblocked and thanks for looking into this.

shrouxm commented 4 years ago

closing for now, we can re-open if this crops up again