[Bug ipa/59469] [4.8/4.9 Regression] LLVM build failure with gcc LTO
trippels at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Feb 5 12:20:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59469
--- Comment #43 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Created attachment 32045
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32045&action=edit
new testcase
r207489 fixes the original issue. Thanks.
But llvm still doesn't build with -flto:
FAILED: : && /usr/bin/g++ -fPIC -fvisibility-inlines-hidden -Wall -W
-Wno-unused-parameter -Wwrite-strings -Wno-missing-field-initializers -pedantic
-Wno-long-long -Wno-may
be-uninitialized -Wnon-virtual-dtor -fno-rtti -O3 -DNDEBUG -pipe -march=native
-flto=4
-Wl,-O1,--hash-style=gnu,--as-needed,--gc-sections,--icf=all,--icf-iterations=3
utils/
FileCheck/CMakeFiles/FileCheck.dir/FileCheck.cpp.o -o bin/FileCheck -lrt -ldl
-lcurses -lpthread -lz lib/libLLVMSupport.so -lpthread -lrt -ldl -lcurses
-lpthread -lz -Wl,-r
path,/var/tmp/llvm_build/lib && :
lib/libLLVMSupport.so: error: undefined reference to 'void*
llvm::object_creator<llvm::StringMap<llvm::Timer, llvm::MallocAllocator> >()'
lib/libLLVMSupport.so: error: undefined reference to 'void*
llvm::object_creator<std::string>()'
lib/libLLVMSupport.so: error: undefined reference to 'void*
llvm::object_creator<std::vector<llvm::Timer*, std::allocator<llvm::Timer*> >
>()'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
In this case lto produces an undefined symbol for e.g.:
42902 static ManagedStatic<std::vector<Timer*> > ActiveTimers;
Before r207489 the symbol was weak.
markus@x4 llvm_build % g++ -fPIC -O3 -flto -shared Timer.ii
markus@x4 llvm_build % nm a.out | grep
_ZN4llvm14object_creatorISt6vectorIPNS_5TimerESaIS3_EEEEPvv
U _ZN4llvm14object_creatorISt6vectorIPNS_5TimerESaIS3_EEEEPvv
markus@x4 llvm_build % g++ -fPIC -O3 -flto -flto-partition=none -shared
Timer.ii
markus@x4 llvm_build % nm a.out | grep
_ZN4llvm14object_creatorISt6vectorIPNS_5TimerESaIS3_EEEEPvv
0000000000003770 W _ZN4llvm14object_creatorISt6vectorIPNS_5TimerESaIS3_EEEEPvv
markus@x4 llvm_build % g++ -fPIC -O3 -shared Timer.ii
markus@x4 llvm_build % nm a.out | grep
_ZN4llvm14object_creatorISt6vectorIPNS_5TimerESaIS3_EEEEPvv
0000000000008dc0 W _ZN4llvm14object_creatorISt6vectorIPNS_5TimerESaIS3_EEEEPvv
markus@x4 llvm_build %
More information about the Gcc-bugs
mailing list