Missing symbols in libLLVM.so when built with clang-4.0

Hi,

When I build clang-4.0 with gcc-4.8.5, it fails to link against a
libLLVM-4.0.so that was built with clang-4.0 due to missing symbols:

../../lib/libclangCodeGen.a(BackendUtil.cpp.o): In function `(anonymous namespace)::EmitAssemblyHelper::EmitAssemblyWithNewPassManager(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >)':
BackendUtil.cpp:(.text._ZN12_GLOBAL__N_118EmitAssemblyHelper30EmitAssemblyWithNewPassManagerEN5clang13BackendActionESt10unique_ptrIN4llvm17raw_pwrite_streamESt14default_deleteIS5_EE+0x12f): undefined reference to `llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>::AnalysisManager(bool)'

Linking is successful, though, if I build libLLVM-4.0.so with gcc-4.8.5.

I was looking at the difference between the two shared objects and I
see:

$ nm --demangle libLLVM-4.0.so.clang4.0 \

grep 'llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults\&>::AnalysisManager(bool)'

00000000013af5f0 W llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>::AnalysisManager(bool)
00000000013af5f0 W llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>::AnalysisManager(bool)

$ nm --demangle check-for-broken-symbol.sh libLLVM-4.0.so.gcc4.8.5 \

grep 'llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults\&>::AnalysisManager(bool)'

00000000013f12d0 W llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>::AnalysisManager(bool)
00000000013f12d0 W llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>::AnalysisManager(bool)
00000000013f12d0 t llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>::AnalysisManager(bool)
00000000013f12d0 t llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>::AnalysisManager(bool)

Is this a bug in clang/llvm that libLLVM-4.0.so only has weak versions
of these symbols? What else should I be looking at to figure out what
is wrong here?

Thanks,
Tom