https://sourceware.org/bugzilla/show_bug.cgi?id=33470

--- Comment #8 from Alan Modra <amodra at gmail dot com> ---
(In reply to H.J. Lu from comment #6)
> Created attachment 16368 [details]
> A patch to build binutils with clang and LTO

Thanks for looking into this, but it doesn't work for me.  After applying your
patch I still see
ranlib --plugin /usr/lib/gcc/x86_64-linux-gnu/14/liblto_plugin.so --plugin
/usr/lib/gcc/x86_64-linux-gnu/14/liblto_plugin.so .libs/libbfd.a

Notice there are two --plugin options given, one from GCC_PLUGIN_OPTION called
from the top-level configure, the second from libtool.m4.

The problem is
$ clang --print-file-name=liblto_plugin.so
/usr/lib/gcc/x86_64-linux-gnu/14/liblto_plugin.so

$ clang --print-search-dirs
programs:
=/usr/lib/llvm-20/bin:/usr/lib/gcc/x86_64-linux-gnu/14/../../../../x86_64-linux-gnu/bin
libraries:
=/usr/lib/llvm-20/lib/clang/20:/usr/lib/gcc/x86_64-linux-gnu/14:/usr/lib/gcc/x86_64-linux-gnu/14/../../../../lib64:/lib/x86_64-linux-gnu:/lib/../lib64:/usr/lib/x86_64-linux-gnu:/usr/lib/../lib64:/lib:/usr/lib

Now I don't know if clang searching the gcc directory is something added by
Debian or Ubuntu, but it means that your patch doesn't even get a chance to try
LLVMgold.so as a plugin.  Also, I don't have llvm-config installed.

What does work for me is to add LLVMgold.so first to plugin_names in
config/gcc-plugin.m4 and libtool.m4.  I also note that nm is used in one of the
configure scripts, and that should also be given a plugin option.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to