Bug 2213913

Summary: /usr/bin/ld not present when gcc-toolset-13-binutils is installed first
Product: Red Hat Enterprise Linux 8 Reporter: Marek Polacek <mpolacek>
Component: binutilsAssignee: Nick Clifton <nickc>
binutils sub component: gcc-toolset-13 QA Contact: Miloš Prchlík <mprchlik>
Status: VERIFIED --- Docs Contact:
Severity: unspecified    
Priority: unspecified CC: fweimer, mprchlik, nickc, ohudlick, sipoyare
Version: 8.9Keywords: Bugfix, Triaged
Target Milestone: rc   
Target Release: 8.9   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: gcc-toolset-13-binutils-2.40-11.el8 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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 Marek Polacek 2023-06-09 21:16:36 UTC
# cat /etc/redhat-release 
Red Hat Enterprise Linux release 8.9 Beta (Ootpa)
# rpm -q binutils gcc-toolset-13-binutils
package binutils is not installed
# dnf install -y gcc-toolset-13-binutils
[...]
# ld
-bash: /usr/bin/ld: No such file or directory

That's expected.  But:

# dnf install -y binutils
[...]
the primary link for ld must be /opt/rh/gcc-toolset-13/root/usr/bin/ld
the primary link for ld must be /opt/rh/gcc-toolset-13/root/usr/bin/ld
# ld
-bash: /usr/bin/ld: No such file or directory
is not.

Comment 1 Nick Clifton 2023-06-12 10:36:10 UTC
I think that this is happening because the gcc-toolset-13-binutils spec file is using the system version of the "alternatives" script, rather than the GTS-13 version.  ie https://bugzilla.redhat.com/show_bug.cgi?id=2209148
But that should have been fixed by the gcc-toolset-13-binutils-2.40-8.el9 build, so I need to investigate further.

Comment 3 Nick Clifton 2023-06-12 11:20:23 UTC
OK, so it is the alternatives system which is generating this message, but I am not sure exactly what it means or how to fix it.  

Oh, and the "fixed" binutils build for BZ 2209148 is being used, so it may be that the fix for that BZ is actually wrong...

Comment 4 Nick Clifton 2023-06-12 11:35:44 UTC
The problem exists if you perform the opposite installation sequence too:

  # dnf install -y binutils
  [...]
  # dnf install -y gcc-toolset-13-binutils
  [...]
  the primary link for ld must be /usr/bin/ld
  the primary link for ld must be /usr/bin/ld
  [...]
  # /opt/rh/gcc-toolset-13/root/usr/bin/ld
  sh: /opt/rh/gcc-toolset-13/root/usr/bin/ld: No such file or directory

Still investigating.

Comment 5 Nick Clifton 2023-06-12 14:28:13 UTC
Should be fixed by: gcc-toolset-13-binutils-2.40-11.el8

The problem - I think - is that the gcc-toolset-13-binutils needs to use the alternatives script with the --altdir and --admindir options set to point to the gts-13 equivalents.  Then it will not interfere with the alternatives used by the system binutils.

Comment 7 Miloš Prchlík 2023-06-30 11:59:31 UTC
Verified with gcc-toolset-13-binutils-2.40-11.el8.