Bug 2149614 - gcc-annobin.so missing in GCC Toolset 12
Summary: gcc-annobin.so missing in GCC Toolset 12
Keywords:
Status: CLOSED DUPLICATE of bug 2107575
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: gcc-toolset-12-gcc
Version: 9.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Marek Polacek
QA Contact: qe-baseos-tools-bugs
URL:
Whiteboard:
Depends On: 2107575 2151926 2164769 2164771 2164772 2164773 2164774 2164775
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-11-30 11:36 UTC by Terje Røsten
Modified: 2023-07-17 16:36 UTC (History)
0 users

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
If this bug requires documentation, please select an appropriate Doc Type value.
Clone Of:
Environment:
Last Closed: 2023-07-17 16:35:53 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-140876 0 None None None 2022-11-30 11:49:08 UTC

Description Terje Røsten 2022-11-30 11:36:53 UTC
Description of problem:

rpmbuild uses %optflags which is:

$ rpm --eval %optflags
-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection

Note this part:

 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1

The file /usr/lib/rpm/redhat/redhat-annobin-cc1 contains:

*cc1_options:
+ %{!-fno-use-annobin:%{!iplugindir*:%:find-plugindir()} -fplugin=gcc-annobin}

Note the use of -fplugin=gcc-annobin

This works for GCC 11 as 

$ rpm -ql gcc-plugin-annobin | tail -3
/usr/lib/gcc/x86_64-redhat-linux/11/plugin/gcc-annobin.so
/usr/lib/gcc/x86_64-redhat-linux/11/plugin/gcc-annobin.so.0
/usr/lib/gcc/x86_64-redhat-linux/11/plugin/gcc-annobin.so.0.0.0

However, for GCC 12 there are no gcc-annobin.so*:

$ rpm -ql gcc-toolset-12-annobin-plugin-gcc
/opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/plugin/annobin-plugin-version-info
/opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/plugin/annobin.so
/opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/plugin/annobin.so.0
/opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/plugin/annobin.so.0.0.0

This means we can't mix default rpmbuild %optflags and GCC 12, which make usefulness of GCC 12 very small,
it can't be used to build rpms.

Can the gcc-annobin.so files required via rpmbuild's %optflags please be added to gcc-toolset-12?

Comment 1 Marek Polacek 2022-12-02 21:53:22 UTC
It looks like this is essentially a dup of bug 2107575.

Comment 2 Marek Polacek 2023-07-17 16:35:53 UTC

*** This bug has been marked as a duplicate of bug 2107575 ***


Note You need to log in before you can comment on or make changes to this bug.