[LLVMdev] gold and debug information

Guoliang Jin jingl1345 at gmail.com
Mon Jul 19 23:45:30 PDT 2010

  On 7/20/2010 1:25 AM, Eli Friedman wrote:
> On Mon, Jul 19, 2010 at 11:06 PM, Guoliang Jin<jingl1345 at gmail.com>  wrote:
>>   Hi,
>> I would like to get the whole program bitcode with debug information in it.
>> I tried to use CFLAGS = "-O4 -g", but it ends with the following error:
>> collect2: ld terminated with signal 6 [Aborted]
>> Unknown constant!
>> UNREACHABLE executed at
>> /local.toadette/aliang/fixing/llvm-2.7/llvm-2.7/lib/Bitcode/Writer/BitcodeWriter.cpp:895!
>> What is the right way to get a whole program bitcode with debug
>> information using gold plugin?
> That looks like a bug; can you attach a testcase?
I suppose you also have the gold plugin with the also-emit-llvm support. 
It is in the mainline llvm, and I ported it back to 2.7.

The same error happened for both of them: the modified 2.7, and a 
mainline I checked out three weeks ago.

This problem is reproducible while compiling flex-2.5.35.tar.gz and many 
others (mysql and cherokee). I set the following:

export CC="llvm-gcc -use-gold-plugin -Wl,-plugin-opt=also-emit-llvm"
export CXX="llvm-g++ -use-gold-plugin -Wl,-plugin-opt=also-emit-llvm"
export RANLIB=/bin/true
export CFLAGS="-O4 -g"

then configure, make, and then hit the error.

The error only happens if the CFLAGS has -g in it.


More information about the llvm-dev mailing list