Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2225130

Summary: bytecode stream in file ‘/opt/rh/gcc-toolset-13/root/usr/lib64/libbfd.a’ generated with LTO version 11.3 instead of the expected 13.0
Product: Red Hat Enterprise Linux 9 Reporter: Miloš Prchlík <mprchlik>
Component: gcc-toolset-13-binutilsAssignee: Nick Clifton <nickc>
Status: CLOSED ERRATA QA Contact: Miloš Prchlík <mprchlik>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.3CC: bgollahe, lkuprova, markobri, mcermak, vkadlcik
Target Milestone: rcKeywords: Bugfix, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: gcc-toolset-13-binutils-2.40-13.el9 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-11-07 08:32:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Miloš Prchlík 2023-07-24 11:10:27 UTC
Description of problem:

I'm not sure whether this is a serious issue or not, reporting it anyway, just in case:


[root@vm-10-0-186-49 ~]# cat libbfdtest.h 
extern int libbfdtest (void);
[root@vm-10-0-186-49 ~]# cat libbfdtest.c
#include <bfd.h>

#include "libbfdtest.h"

int
libbfdtest (void)
{
  bfd_set_error (bfd_error_no_error);
  return bfd_get_error () == bfd_error_no_error;
}

[root@vm-10-0-186-49 ~]# gcc -g -Wall -shared -o libbfdtest.so -fPIC libbfdtest.c -lbfd -liberty
lto1: fatal error: bytecode stream in file ‘/opt/rh/gcc-toolset-13/root/usr/lib64/libbfd.a’ generated with LTO version 11.3 instead of the expected 13.0
compilation terminated.
lto-wrapper: fatal error: gcc returned 1 exit status
compilation terminated.
/opt/rh/gcc-toolset-13/root/usr/libexec/gcc/x86_64-redhat-linux/13/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
[root@vm-10-0-186-49 ~]# 


Version-Release number of selected component (if applicable):

gcc-toolset-13-binutils-2.40-9.el9.x86_64
gcc-toolset-13-gcc-13.1.1-4.2.el9.x86_64
gcc-toolset-13-runtime-13.0-1.el9.x86_64


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Nick Clifton 2023-07-24 13:23:02 UTC
Fixed by: gcc-toolset-13-binutils-2.40-12.el9

This is a known issue with the first builds of gcc-toolset-13-binutils.

Until gcc-toolset-13-gcc was available the GTS-13 binutils had be built 
with the system compiler, which meant that the static libraries (libbfd.a,
libibetry.a, libopcodes.a) used the system compiler's version of the LTO
format.

The newer GTS-13 binutils builds were created using the GTS-13 gcc and
so should not have this problem.

Comment 2 Miloš Prchlík 2023-08-02 14:48:20 UTC
I'm afraid gcc-toolset-13-binutils-2.40-12.el9 keeps complaining about the LTO format version:

[root@mprchlik-1mt-rhel-9 ~]# gcc -g -Wall -shared -o libbfdtest.so -fPIC libbfdtest.c -lbfd -liberty
lto1: fatal error: bytecode stream in file ‘/opt/rh/gcc-toolset-13/root/usr/lib64/libbfd.a’ generated with LTO version 11.3 instead of the expected 13.0
compilation terminated.
lto-wrapper: fatal error: gcc returned 1 exit status
compilation terminated.
/opt/rh/gcc-toolset-13/root/usr/libexec/gcc/x86_64-redhat-linux/13/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
[root@mprchlik-1mt-rhel-9 ~]# rpm -qf /opt/rh/gcc-toolset-13/root/usr/lib64/libbfd.a
gcc-toolset-13-binutils-devel-2.40-12.el9.x86_64
[root@mprchlik-1mt-rhel-9 ~]# rpm -qa | grep gcc-toolset | sort
gcc-toolset-13-binutils-2.40-12.el9.x86_64
gcc-toolset-13-binutils-devel-2.40-12.el9.x86_64
gcc-toolset-13-binutils-gold-2.40-12.el9.x86_64
gcc-toolset-13-gcc-13.1.1-4.2.el9.x86_64
gcc-toolset-13-runtime-13.0-1.el9.x86_64
[root@mprchlik-1mt-rhel-9 ~]#

Comment 3 Nick Clifton 2023-08-03 08:28:22 UTC
*sigh*

This was due to a silly typo in the binutils.spec file.  Before the -12 update the spec file contained:

  BuildRequires: gcc
  %define gcc_for_libraries /usr/bin/gcc

After the update it contained:

  BuildRequires: %{?scl_prefix}gcc
  %define gcc_for_libraries %{?_scl_root}/usr/bin/gcc

  BuildRequires: gcc
  %define gcc_for_libraries /usr/bin/gcc

So I had copied and pasted the original lines, changed them to what they should be, and then totally forgot to delete the original lines.  Doh.

Comment 4 Nick Clifton 2023-08-03 13:12:16 UTC
Right - gcc-toolset-13-binutils-2.40-13.el9 - should actually fix the problem.

I looked in the root.log for the build and confirmed that the GTS-13 gcc was loaded and that the system gcc was not loaded, so I am confident that this build should work.

Comment 8 Miloš Prchlík 2023-09-12 12:59:06 UTC
Verified with gcc-toolset-13-binutils-2.40-13.el9:

Comment 13 errata-xmlrpc 2023-11-07 08:32:59 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (gcc-toolset-13-binutils bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:6441