[cfe-dev] Building Clang with shared libraries

David Blaikie via cfe-dev cfe-dev at lists.llvm.org
Thu Oct 8 09:14:03 PDT 2015


On Thu, Oct 8, 2015 at 2:39 AM, Benjamin Kramer <benny.kra at gmail.com> wrote:

>
>
> On Wed, Oct 7, 2015 at 10:25 PM, David Blaikie via cfe-dev <
> cfe-dev at lists.llvm.org> wrote:
>
>> So I decided to try to improve my iterative dev time (instigated by
>> playing around with LLD) & while LLVM passes all its test with cmake
>> BUILD_SHARED_LIBS=ON, clang does not. I hit the following error.
>>
>> Has anyone seen this/worked around it/know what it's about?
>>
>
> It was a bug ;) r249608 should help.
>

Seems to have done the trick - thanks a bunch!


>
> - Ben
>
>> /usr/local/google/home/blaikie/install/bin/clang++   -fcolor-diagnostics -Wdeprecated -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -Werror -std=c++11 -fcolor-diagnostics -fno-common -Woverloaded-virtual -Wno-nested-anon-types -g  -Wl,-allow-shlib-undefined tools/clang/unittests/Driver/CMakeFiles/ClangDriverTests.dir/ToolChainTest.cpp.o tools/clang/unittests/Driver/CMakeFiles/ClangDriverTests.dir/MultilibTest.cpp.o  -o tools/clang/unittests/Driver/ClangDriverTests  lib/libgtest.so.3.8.0svn lib/libgtest_main.so.3.8.0svn lib/libLLVMSupport.so.3.8.0svn lib/libclangDriver.so.3.8.0svn -Wl,-rpath,"\$ORIGIN/../lib" && :
>> /usr/local/google/home/blaikie/dev/llvm/src/tools/clang/unittests/Driver/ToolChainTest.cpp:31: error: undefined reference to 'clang::DiagnosticIDs::DiagnosticIDs()'
>> /usr/local/google/home/blaikie/dev/llvm/src/tools/clang/unittests/Driver/ToolChainTest.cpp:33: error: undefined reference to 'clang::DiagnosticsEngine::DiagnosticsEngine(llvm::IntrusiveRefCntPtr<clang::DiagnosticIDs> const&, clang::DiagnosticOptions*, clang::DiagnosticConsumer*, bool)'
>> /usr/local/google/home/blaikie/dev/llvm/src/tools/clang/unittests/Driver/ToolChainTest.cpp:35: error: undefined reference to 'clang::vfs::InMemoryFileSystem::InMemoryFileSystem()'
>> /usr/local/google/home/blaikie/dev/llvm/src/tools/clang/unittests/Driver/ToolChainTest.cpp:58: error: undefined reference to 'clang::vfs::InMemoryFileSystem::addFile(llvm::Twine const&, long, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer> >)'
>> /usr/local/google/home/blaikie/dev/llvm/src/tools/clang/unittests/Driver/ToolChainTest.cpp:72: error: undefined reference to 'clang::DiagnosticsEngine::~DiagnosticsEngine()'
>> /usr/local/google/home/blaikie/dev/llvm/src/tools/clang/unittests/Driver/ToolChainTest.cpp:32: error: undefined reference to 'clang::DiagnosticConsumer::~DiagnosticConsumer()'
>> /usr/local/google/home/blaikie/dev/llvm/src/tools/clang/include/clang/Basic/Diagnostic.h:1313: error: undefined reference to 'vtable for clang::DiagnosticConsumer'
>> /usr/local/google/home/blaikie/install/bin/ld: the vtable symbol may be undefined because the class is missing its key function
>> /usr/local/google/home/blaikie/dev/llvm/src/include/llvm/ADT/IntrusiveRefCntPtr.h:54: error: undefined reference to 'clang::DiagnosticIDs::~DiagnosticIDs()'
>> tools/clang/unittests/Driver/CMakeFiles/ClangDriverTests.dir/ToolChainTest.cpp.o:/usr/local/google/home/blaikie/dev/llvm/src/tools/clang/unittests/Driver/ToolChainTest.cpp:vtable for (anonymous namespace)::ToolChainTest_VFSGCCInstallation_Test::TestBody()::TestDiagnosticConsumer: error: undefined reference to 'clang::DiagnosticConsumer::IncludeInDiagnosticCounts() const'
>> tools/clang/unittests/Driver/CMakeFiles/ClangDriverTests.dir/ToolChainTest.cpp.o:/usr/local/google/home/blaikie/dev/llvm/src/tools/clang/unittests/Driver/ToolChainTest.cpp:vtable for (anonymous namespace)::ToolChainTest_VFSGCCInstallation_Test::TestBody()::TestDiagnosticConsumer: error: undefined reference to 'clang::DiagnosticConsumer::HandleDiagnostic(clang::DiagnosticsEngine::Level, clang::Diagnostic const&)'
>> clang-3.4: error: linker command failed with exit code 1 (use -v to see invocation)
>>
>>
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20151008/f77b9515/attachment.html>


More information about the cfe-dev mailing list