bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/28893] New: binutils-2.37: PGO build with Clang results in


From: telans at posteo dot de
Subject: [Bug binutils/28893] New: binutils-2.37: PGO build with Clang results in configure error: AR with --plugin and rc is required for LTO build
Date: Tue, 15 Feb 2022 10:49:25 +0000

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

            Bug ID: 28893
           Summary: binutils-2.37: PGO build with Clang results in
                    configure error: AR with --plugin and rc is required
                    for LTO build
           Product: binutils
           Version: 2.37
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: telans at posteo dot de
  Target Milestone: ---

Created attachment 13978
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13978&action=edit
build.log

Downstream Gentoo report: https://bugs.gentoo.org/833371

It appears that --enable-pgo-build requires checking for GCC plugin support
from within config/gcc-plugin.m4. This breaks the build when CC=clang with the
following:

configure: error: AR with --plugin and rc is required for LTO build

I believe this issue comes from binutils requesting a GCC LTO plugin regardless
of whether Clang is used or not:
https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=config/gcc-plugin.m4#l139

>From the above:

 136 plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
 137 plugin_option=
 138 for plugin in $plugin_names; do
 139   plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
 140   if test x$plugin_so = x$plugin; then
 141     plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
 142   fi
 143   if test x$plugin_so != x$plugin; then
 144     plugin_option="--plugin $plugin_so"
 145     break
 146   fi
 147 done


When GCC is used as $CC in the two commands, the outputs are:
    telans@desktop ~ $ gcc --print-prog-name liblto_plugin.so
    /usr/libexec/gcc/x86_64-pc-linux-gnu/11.2.1/liblto_plugin.so
    telans@desktop ~ $ gcc --print-file-name liblto_plugin.so
    liblto_plugin.so

Compared to Clang:
    telans@desktop ~ $ clang --print-prog-name liblto_plugin.so
    liblto_plugin.so
    telans@desktop ~ $ clang --print-file-name liblto_plugin.so
    liblto_plugin.so

As on line 143, test is expecting a difference between the outputs which does
not occur using Clang (it might be testing for the existence of the plugin?).

I'm fairly sure these config tests can be skipped when using Clang + lld, but
I'm not sure. Thanks.

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]