Bug 2213913 - /usr/bin/ld not present when gcc-toolset-13-binutils is installed first
Summary: /usr/bin/ld not present when gcc-toolset-13-binutils is installed first
Keywords:
Status: VERIFIED
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: binutils
Version: 8.9
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.9
Assignee: Nick Clifton
QA Contact: Miloš Prchlík
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-06-09 21:16 UTC by Marek Polacek
Modified: 2023-08-01 13:54 UTC (History)
5 users (show)

Fixed In Version: gcc-toolset-13-binutils-2.40-11.el8
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-159424 0 None None None 2023-06-09 21:22:53 UTC

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.


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