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

--- Comment #14 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Alan Modra from comment #8)
> (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.

I only see GCC_PLUGIN_OPTION in

config/ChangeLog: * gcc-plugin.m4 (GCC_PLUGIN_OPTION): Check if AR works with
config/ChangeLog: * gcc-plugin.m4 (GCC_PLUGIN_OPTION): New.
config/gcc-plugin.m4:dnl GCC_PLUGIN_OPTION
config/gcc-plugin.m4:AC_DEFUN([GCC_PLUGIN_OPTION],[dnl
configure:# Try CLANG_PLUGIN_FILE first since GCC_PLUGIN_OPTION may return the
configure.ac:# Try CLANG_PLUGIN_FILE first since GCC_PLUGIN_OPTION may return
the
configure.ac:  GCC_PLUGIN_OPTION(PLUGIN_OPTION)
libiberty/configure:# Try CLANG_PLUGIN_FILE first since GCC_PLUGIN_OPTION may
return the
libiberty/configure.ac:# Try CLANG_PLUGIN_FILE first since GCC_PLUGIN_OPTION
may return the
libiberty/configure.ac:  GCC_PLUGIN_OPTION(PLUGIN_OPTION)

not in libtool.m4.   Please try the v2 patch which requires llvm-config if
needed.

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

Reply via email to