[PATCH] Fix the --enable-shared build

Rafael Avila de Espindola rafael.espindola at gmail.com
Tue Aug 19 15:39:12 PDT 2014


> I've tried several testcases, both the snippet from
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61659#c0  and the
> testcase/attachment at
> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33036
> 
> ~> head -n 1 simple.cpp
> struct generic_parser_base {
> 
> ~> /home/willschm/install/gcc-4.9-20140806/bin/c++ ~/simple.cpp
> /lib/../lib64/crt1.o:(.rodata+0x8): undefined reference to `main'
> /tmp/ccrlSpMV.o: In function `list::list()':
> simple.cpp:(.text._ZN4listC2Ev[_ZN4listC5Ev]+0x34): undefined reference to `PassNameParser::PassNameParser()'
> collect2: error: ld returned 1 exit status
> 
> ~> head -n 1 foo.cpp
> template <typename _Tp> _Tp *__addressof (_Tp &);
> ~> /home/willschm/install/gcc-4.9-20140806/bin/c++ ~/foo.cpp  -std=c++11
> /lib/../lib64/crt1.o:(.rodata+0x8): undefined reference to `main'
> collect2: error: ld returned 1 exit status
> 


Note that the bug is in the optimizer and the the reduced testcase is not a full program, so you should probably test with g++ -c -O3.

Cheers,
Rafael




More information about the llvm-commits mailing list