[llvm-dev] (Thin)LTO llvm build

Teresa Johnson via llvm-dev llvm-dev at lists.llvm.org
Mon Sep 26 14:02:57 PDT 2016

On Mon, Sep 26, 2016 at 10:07 AM, Carsten Mattner <carstenmattner at gmail.com>

> $ /usr/bin/time ninja -j4
> ...
> [1223/1315] Linking CXX executable bin/lldb-3.9.1
> FAILED: bin/lldb-3.9.1
> [long list of object files as part of clang++ invocation command]
> /usr/bin/ld: bin/lldb-3.9.1: hidden symbol `__morestack' in
> /usr/lib64/gcc/x86_64-pc-linux-gnu/6.2.1/libgcc.a(morestack.o)
> is referenced by DSO
> /usr/bin/ld: final link failed: Bad value
> ...
> 27428.01user 218.31system 1:59:40elapsed 385%CPU (0avgtext+0avgdata
> 980356maxresident)k
> 931232inputs+4172128outputs (1390major+36787899minor)pagefaults 0swaps
> Failed to link lldb, while less then 100 ninja targets were left.
> Same if I retry with ninja -j1.
> Any suggestions?

I did some poking around on the web and found that this exact issue in the
lldb link cropped up due to a patch:

It was fixed by making the symbol weak:

I'm wondering if ThinLTO is mucking with the symbol linkage somehow and
effectively undoing that weak resolution. However, typically we change the
linkage type only for definitions, and in this case the def is in libgcc.a,
not in LLVM. So I am not completely sure what is going on.

I'll either need to get a reproducer from you and/or try to repro it
myself. I usually don't check out and build lldb, so perhaps I will start
with that. As a workaround you could try -DBUILD_SHARED_LIBS=OFF.


Teresa Johnson |  Software Engineer |  tejohnson at google.com |  408-460-2413
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160926/584a1265/attachment.html>

More information about the llvm-dev mailing list