[LLVMdev] linker warnings in Linking CXX executable Debug/AsanTest

Jack Howarth howarth at bromo.med.uc.edu
Fri Nov 2 07:59:19 PDT 2012


On Fri, Nov 02, 2012 at 06:45:07PM +0400, Alexey Samsonov wrote:
> Hi, Jack!
> 
> On Fri, Nov 2, 2012 at 6:18 PM, Jack Howarth <howarth at bromo.med.uc.edu>wrote:
> 
> > Nick,
> >    Have you noticed that llvm/clang svn produces the following linker
> > warnings on
> > 'make check-all'?
> >
> > Linking CXX executable Debug/AsanTest
> > ld: warning: direct access in
> > llvm::convertible_fwd_ostream::~convertible_fwd_ostream() to global weak
> > symbol vtable for llvm::convertible_fwd_ostream means the weak symbol
> > cannot be overridden at runtime. This was likely caused by different
> > translation units being compiled with different visibility settings.
> > ld: warning: direct access in
> > llvm::convertible_fwd_ostream::~convertible_fwd_ostream() to global weak
> > symbol vtable for llvm::convertible_fwd_ostream means the weak symbol
> > cannot be overridden at runtime. This was likely caused by different
> > translation units being compiled with different visibility settings.
> > ld: warning: direct access in non-virtual thunk to
> > llvm::convertible_fwd_ostream::~convertible_fwd_ostream() to global weak
> > symbol vtable for llvm::convertible_fwd_ostream means the weak symbol
> > cannot be overridden at runtime. This was likely caused by different
> > translation units being compiled with different visibility settings.
> > ld: warning: direct access in non-virtual thunk to
> > llvm::convertible_fwd_ostream::~convertible_fwd_ostream() to global weak
> > symbol vtable for llvm::convertible_fwd_ostream means the weak symbol
> > cannot be overridden at runtime. This was likely caused by different
> > translation units being compiled with different visibility settings.
> > ld: warning: direct access in
> > llvm::convertible_fwd_ostream::~convertible_fwd_ostream() to global weak
> > symbol vtable for llvm::convertible_fwd_ostream means the weak symbol
> > cannot be overridden at runtime. This was likely caused by different
> > translation units being compiled with different visibility settings.
> > ld: warning: direct access in
> > llvm::convertible_fwd_ostream::~convertible_fwd_ostream() to global weak
> > symbol vtable for llvm::convertible_fwd_ostream means the weak symbol
> > cannot be overridden at runtime. This was likely caused by different
> > translation units being compiled with different visibility settings.
> > ld: warning: direct access in non-virtual thunk to
> > llvm::convertible_fwd_ostream::~convertible_fwd_ostream() to global weak
> > symbol vtable for llvm::convertible_fwd_ostream means the weak symbol
> > cannot be overridden at runtime. This was likely caused by different
> > translation units being compiled with different visibility settings.
> > ld: warning: direct access in non-virtual thunk to
> > llvm::convertible_fwd_ostream::~convertible_fwd_ostream() to global weak
> > symbol vtable for llvm::convertible_fwd_ostream means the weak symbol
> > cannot be overridden at runtime. This was likely caused by different
> > translation units being compiled with different visibility settings.
> >
> 
> I'll take a look at this. However, tests below fail for a different reason
> (they don't use Debug/AsanTest at all).
> How do you configure a CMake build tree? Can you somehow get (or run
> manually) the script which is used
> for running log-path_test.cc and other failing test cases?

I use cmake as follows...

cd build
CMAKE_OPTIONS="-DLLVM_BUILD_32_BITS:BOOL=OFF -DLLVM_TARGETS_TO_BUILD=X86"
cmake $CMAKE_OPTIONS -DCMAKE_INSTALL_PREFIX=/sw/opt/llvm-3.2 -DCMAKE_BUILD_TYPE=Debug ..
make VERBOSE=1

I do notice that AsanTest in build/projects/compiler-rt/lib/asan/tests/Debug is linked as...

% otool -L AsanTest
AsanTest:
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 945.11.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
	/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0)
	/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 744.12.0)

Is is that normal to link against both the Foundation.framework and the CoreFoundation.framework at the same time?
             Jack

> 
> 
> >
> > I am seeing some AddressSanitizer failures like...
> >
> > FAIL: AddressSanitizer :: log-path_test.cc (13 of 12542)
> > ******************** TEST 'AddressSanitizer :: log-path_test.cc' FAILED
> > ********************
> >
> > FAIL: AddressSanitizer :: strncpy-overflow.cc (27 of 12542)
> > ******************** TEST 'AddressSanitizer :: strncpy-overflow.cc' FAILED
> > ********************
> >
> > FAIL: AddressSanitizer :: use-after-free.cc (34 of 12542)
> > ******************** TEST 'AddressSanitizer :: use-after-free.cc' FAILED
> > ********************
> >
> > etc, and wonder if they could be related to that those linkage warnings.
> > If so, I'll open a bug report.
> > Thanks in advance.
> >          Jack
> > ps This is using a debug build on x86_64-apple-darwin12 with Xcode 4.5.2's
> > linker.
> >
> >
> > _______________________________________________
> > LLVM Developers mailing list
> > LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> >
> 
> 
> 
> -- 
> Alexey Samsonov, MSK



More information about the llvm-dev mailing list