Using Clang LTO/gold plugin to build clang

Hi,

I was trying to build clang (svn head version) using clang-3.1 version. I am building a debug version using LTO/gold plugin. It is crashing with signal 9 when trying to link the bitcode files to build the executable. I am not sure, if this is a bug or just a memory issue. Has anyone done anything similar or noticed similar behavior? Any help would be welcome.

Thanks,
Swarup.

Hi,

    I was trying to build clang (svn head version) using clang-3.1 version.
I am building a debug version using LTO/gold plugin. It is crashing with
signal 9 when trying to link the bitcode files to build the executable. I am
not sure, if this is a bug or just a memory issue. Has anyone done anything
similar or noticed similar behavior? Any help would be welcome.

It is likely just using too much memory. Unfortunately currently LTO
uses a lot of memory for the debug info. I would suggest building
without it to check if that works.

Thanks,
Swarup.

Cheers,
Rafael

Two suggestions:

- Use a 64-bit operating system.
- You could disable the LTO optimizations by commenting out a few
lines in tools/lto/LTOCodeGenerator.cpp to determine if the problem is
a pass or with LTO itself.

Thanks for the help. LTO optimization was not an issue. llvm-ld was just using too much memory (especially with -g option). Now, it is able to link with more memory. But, llc is giving the following assertion violation when compiled with "-g" option.

While deleting: metadata %
An asserting value handle still pointed to this value!
UNREACHABLE executed at Value.cpp:620!

I saw the following bug reports with same assertion violation, but doesn't look like anybody is trying fix it :frowning:
http://llvm.org/bugs/show_bug.cgi?id=13495
http://llvm.org/bugs/show_bug.cgi?id=13495

-Swarup.