Bug 1217450 - cross-amdgcn-gcc13 – broken link for accel/amdgcn-amdhsa/as
Summary: cross-amdgcn-gcc13 – broken link for accel/amdgcn-amdhsa/as
Status: RESOLVED FIXED
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Development (show other bugs)
Version: Current
Hardware: Other Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Richard Biener
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-23 13:46 UTC by Tobias Burnus
Modified: 2024-06-20 12:39 UTC (History)
3 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Burnus 2023-11-23 13:46:14 UTC
cross-amdgcn-gcc13-13.2.1+git7813-3.1.x86_64 in Tumbleweed contains
("rpm -ql"):

/usr/lib64/gcc/x86_64-suse-linux/13/accel/amdgcn-amdhsa/as


But that's a broken link:

# file /usr/lib64/gcc/x86_64-suse-linux/13/accel/amdgcn-amdhsa/as 

/usr/lib64/gcc/x86_64-suse-linux/13/accel/amdgcn-amdhsa/as: broken symbolic link to ../../../../../../amdgcn-amdhsa/bin/as


This then fails for any offloading hello-world program with:

as: unrecognized option '-triple=amdgcn--amdhsa'
gcn mkoffload: fatal error: x86_64-suse-linux-accel-amdgcn-amdhsa-gcc-13 returned 1 exit status
compilation terminated.
lto-wrapper: fatal error: /usr/lib64/gcc/x86_64-suse-linux/13//accel/amdgcn-amdhsa/mkoffload returned 1 exit status

 * * *

The problem is in /usr/amdgcn-amdhsa/bin:

ar:     broken symbolic link to ../../bin/llvm-ar-17.0.4
as:     broken symbolic link to ../../bin/llvm-mc-17.0.4
ld:     symbolic link to ../../bin/lld
nm:     broken symbolic link to ../../bin/llvm-nm-17.0.4
ranlib: broken symbolic link to ../../bin/llvm-ar-17.0.4

as there is only:

  /usr/bin/llvm-as-17.0.5

with a symbolic link to this from

  /usr/bin/llvm-as

created by llvm's /usr/sbin/update-alternatives.

* * *

THUS:

* Either GCC needs to have some LLVM dependency to get updated when LLVM's minor version changes

OR

* Using /usr/bin/llvm-{as,nm,ar} instead of their minor-version variant.

OR

?
Comment 1 Richard Biener 2023-11-24 07:17:59 UTC
Hmm, I think GCC usually has a hard requirement on a minimal LLVM version (and might not work with newer ones either), so I'm not sure using /usr/bin/llvm-as is really better (and that would require installing 'llvm', since that provides those links?).

But it would be nice if the versioned names didn't contain the minor/patchlevel
versions since IIRC you can't install llvm-17.0.1 and llvm-17.0.3 besides each
other anyway?  So, have llvm-ar-17 instead of llvm-ar-17.0.4?

Note GCC does indeed use 'llvm' on openSUSE Tumbleweed but follows the link
and it Requires that at install time.  That means at least as far as OBS
scheduling is concerned there's no obvious dependence to llvm17.  I guess
for openSUSE Tumbleweed I'd ideally change the Requires to use
llvm%product_libs_llvm_ver (I don't need the symlink package, neither at
build nor at install time).  But then I'd have to use globs to find the
name of the tools, so I wonder if we can shorten their names?
Comment 2 Richard Biener 2023-11-24 09:02:30 UTC
Another possibility would be to replace the symlink with a script trying
to auto-discover the current minor/patchlevel version and thus the name
of the binaries to execute ...

I've pushed a change to devel:gcc that fixes the dependence part, OBS
should now see the dependence on llvm17 and thus when that changes might
want to consider a re-build.

Tobias, I've not yet been able to verify whether offloading to AMDGCN
works with the packages due to lack of a supported accelerator.
Comment 3 Aaron Puchert 2023-11-26 18:22:08 UTC
(In reply to Richard Biener from comment #1)
> But it would be nice if the versioned names didn't contain the
> minor/patchlevel versions since IIRC you can't install llvm-17.0.1 and
> llvm-17.0.3 besides each other anyway?  So, have llvm-ar-17 instead of
> llvm-ar-17.0.4?

I agree, and I suggested this some years back in bug 1120098, comment 1. The maintainer at the time was worried that this might break some users. However, I'm not so worried, and I'll try it out.

> Note GCC does indeed use 'llvm' on openSUSE Tumbleweed but follows the link
> and it Requires that at install time.  That means at least as far as OBS
> scheduling is concerned there's no obvious dependence to llvm17.  I guess
> for openSUSE Tumbleweed I'd ideally change the Requires to use
> llvm%product_libs_llvm_ver (I don't need the symlink package, neither at
> build nor at install time).  But then I'd have to use globs to find the
> name of the tools, so I wonder if we can shorten their names?

What do you mean here, apart from the version? Can you give an example?
Comment 4 Richard Biener 2023-11-27 07:32:16 UTC
(In reply to Aaron Puchert from comment #3)
> (In reply to Richard Biener from comment #1)
> > But it would be nice if the versioned names didn't contain the
> > minor/patchlevel versions since IIRC you can't install llvm-17.0.1 and
> > llvm-17.0.3 besides each other anyway?  So, have llvm-ar-17 instead of
> > llvm-ar-17.0.4?
> 
> I agree, and I suggested this some years back in bug 1120098, comment 1. The
> maintainer at the time was worried that this might break some users.
> However, I'm not so worried, and I'll try it out.

One could have both by using an extra set of symlinks ...

> > Note GCC does indeed use 'llvm' on openSUSE Tumbleweed but follows the link
> > and it Requires that at install time.  That means at least as far as OBS
> > scheduling is concerned there's no obvious dependence to llvm17.  I guess
> > for openSUSE Tumbleweed I'd ideally change the Requires to use
> > llvm%product_libs_llvm_ver (I don't need the symlink package, neither at
> > build nor at install time).  But then I'd have to use globs to find the
> > name of the tools, so I wonder if we can shorten their names?
> 
> What do you mean here, apart from the version? Can you give an example?

Really just the version so the binaries are named predictably when you know
%product_libs_llvm_ver, the devel:gcc version now uses a glob (which seems
to work as well, it's just a bit ugly).
Comment 5 OBSbugzilla Bot 2023-12-01 07:55:03 UTC
This is an autogenerated message for OBS integration:
This bug (1217450) was mentioned in
https://build.opensuse.org/request/show/1130160 Factory / gcc13
Comment 6 Richard Biener 2023-12-01 14:23:29 UTC
The GCC side should be fixed/improved to avoid this situation.  It can be further improved by making the binary names more stable.
Comment 7 Aaron Puchert 2023-12-01 21:30:02 UTC
(In reply to Richard Biener from comment #4)
> (In reply to Aaron Puchert from comment #3)
> > (In reply to Richard Biener from comment #1)
> > > But it would be nice if the versioned names didn't contain the
> > > minor/patchlevel versions since IIRC you can't install llvm-17.0.1 and
> > > llvm-17.0.3 besides each other anyway?  So, have llvm-ar-17 instead of
> > > llvm-ar-17.0.4?
> > 
> > I agree, and I suggested this some years back in bug 1120098, comment 1. The
> > maintainer at the time was worried that this might break some users.
> > However, I'm not so worried, and I'll try it out.
> 
> One could have both by using an extra set of symlinks ...

True, but I don't think it makes sense anymore since LLVM 4. The minor version should always be 0 by policy, and we don't support installing multiple patch-level versions of the same major version in parallel anyway. Also, upstream has clang -> clang-<major>, nothing else.
Comment 8 OBSbugzilla Bot 2023-12-02 14:25:02 UTC
This is an autogenerated message for OBS integration:
This bug (1217450) was mentioned in
https://build.opensuse.org/request/show/1130464 Factory / llvm17
Comment 9 Aaron Puchert 2023-12-04 00:34:00 UTC
LLVM 17 will only have the major version as suffix on versioned binaries in the next snapshot. I didn't port this back yet, but it shouldn't be an issue if GCC needs it.
Comment 11 Bruno Pitrus 2024-01-02 11:02:01 UTC
reopened — cross-amdgcn-gcc13-13.2.1+git8109-1.1.x86_64 still has the broken link
Comment 12 Richard Biener 2024-01-09 14:12:05 UTC
(In reply to Bruno Pitrus from comment #11)
> reopened — cross-amdgcn-gcc13-13.2.1+git8109-1.1.x86_64 still has the broken
> link

Yes.  Instead of

ln -s `readlink -f /usr/bin/llvm-ar` $RPM_BUILD_ROOT%{_prefix}/amdgcn-amdhsa/bin/ar

we now package

ln -s /usr/bin/llvm-ar-%{product_libs_llvm_ver}* $RPM_BUILD_ROOT%{_prefix}/amdgcn-amdhsa/bin/ar

expecting that eventually llvm-ar will be llvm-ar-17, but that depends on
llvm being updated.  I guess it should now be, but cross-amdgcn-gcc13
wasn't rebuilt/re-published yet.

Locally re-building it produces the desired links.  I will see to do an update to GCC to have that fixed.
Comment 13 Richard Biener 2024-01-25 07:57:22 UTC
Rebuild is underway now.
Comment 14 OBSbugzilla Bot 2024-03-12 09:55:44 UTC
This is an autogenerated message for OBS integration:
This bug (1217450) was mentioned in
https://build.opensuse.org/request/show/1157115 Backports:SLE-15-SP5 / llvm17
Comment 16 Maintenance Automation 2024-04-12 08:30:09 UTC
SUSE-RU-2024:1253-1: An update that has nine fixes can now be installed.

Category: recommended (moderate)
Bug References: 1210959, 1214934, 1217450, 1217667, 1218492, 1219031, 1219520, 1220724, 1221239
Maintenance Incident: [SUSE:Maintenance:33128](https://smelt.suse.de/incident/33128/)
Sources used:
openSUSE Leap Micro 5.3 (src):
 gcc13-13.2.1+git8285-150000.1.9.1
openSUSE Leap Micro 5.4 (src):
 gcc13-13.2.1+git8285-150000.1.9.1
openSUSE Leap 15.5 (src):
 gcc13-13.2.1+git8285-150000.1.9.1, cross-nvptx-gcc13-13.2.1+git8285-150000.1.9.1
SUSE Linux Enterprise Server 15 SP2 (src):
 gcc13-13.2.1+git8285-150000.1.9.1
SUSE Linux Enterprise Server 15 SP3 (src):
 gcc13-13.2.1+git8285-150000.1.9.1
SUSE Linux Enterprise High Performance Computing 15 SP4 (src):
 gcc13-13.2.1+git8285-150000.1.9.1
SUSE Linux Enterprise Server 15 SP4 (src):
 gcc13-13.2.1+git8285-150000.1.9.1
SUSE Manager Server 4.3 (src):
 gcc13-13.2.1+git8285-150000.1.9.1
SUSE Linux Enterprise Server for SAP Applications 15 SP4 (src):
 gcc13-13.2.1+git8285-150000.1.9.1, cross-nvptx-gcc13-13.2.1+git8285-150000.1.9.1
SUSE Linux Enterprise Desktop 15 SP4 (src):
 gcc13-13.2.1+git8285-150000.1.9.1
SUSE Manager Retail Branch Server 4.3 (src):
 gcc13-13.2.1+git8285-150000.1.9.1
SUSE Manager Proxy 4.3 (src):
 gcc13-13.2.1+git8285-150000.1.9.1
SUSE Linux Enterprise High Performance Computing 15 SP5 (src):
 gcc13-13.2.1+git8285-150000.1.9.1
SUSE Linux Enterprise Server 15 SP5 (src):
 gcc13-13.2.1+git8285-150000.1.9.1
SUSE Linux Enterprise Server for SAP Applications 15 SP5 (src):
 gcc13-13.2.1+git8285-150000.1.9.1
SUSE Linux Enterprise Desktop 15 SP5 (src):
 gcc13-13.2.1+git8285-150000.1.9.1
SUSE Linux Enterprise Micro for Rancher 5.3 (src):
 gcc13-13.2.1+git8285-150000.1.9.1
SUSE Linux Enterprise Micro 5.3 (src):
 gcc13-13.2.1+git8285-150000.1.9.1
SUSE Linux Enterprise Micro for Rancher 5.4 (src):
 gcc13-13.2.1+git8285-150000.1.9.1
SUSE Linux Enterprise Micro 5.4 (src):
 gcc13-13.2.1+git8285-150000.1.9.1
SUSE Linux Enterprise Micro 5.5 (src):
 gcc13-13.2.1+git8285-150000.1.9.1
Basesystem Module 15-SP5 (src):
 gcc13-13.2.1+git8285-150000.1.9.1
Development Tools Module 15-SP5 (src):
 gcc13-13.2.1+git8285-150000.1.9.1, cross-nvptx-gcc13-13.2.1+git8285-150000.1.9.1
SUSE Package Hub 15 15-SP5 (src):
 gcc13-13.2.1+git8285-150000.1.9.1
SUSE Linux Enterprise High Performance Computing 15 SP2 LTSS 15-SP2 (src):
 gcc13-13.2.1+git8285-150000.1.9.1, cross-nvptx-gcc13-13.2.1+git8285-150000.1.9.1
SUSE Linux Enterprise High Performance Computing LTSS 15 SP3 (src):
 gcc13-13.2.1+git8285-150000.1.9.1, cross-nvptx-gcc13-13.2.1+git8285-150000.1.9.1
SUSE Linux Enterprise High Performance Computing ESPOS 15 SP4 (src):
 gcc13-13.2.1+git8285-150000.1.9.1, cross-nvptx-gcc13-13.2.1+git8285-150000.1.9.1
SUSE Linux Enterprise High Performance Computing LTSS 15 SP4 (src):
 gcc13-13.2.1+git8285-150000.1.9.1, cross-nvptx-gcc13-13.2.1+git8285-150000.1.9.1
SUSE Linux Enterprise Desktop 15 SP4 LTSS 15-SP4 (src):
 gcc13-13.2.1+git8285-150000.1.9.1, cross-nvptx-gcc13-13.2.1+git8285-150000.1.9.1
SUSE Linux Enterprise Server 15 SP2 LTSS 15-SP2 (src):
 gcc13-13.2.1+git8285-150000.1.9.1, cross-nvptx-gcc13-13.2.1+git8285-150000.1.9.1
SUSE Linux Enterprise Server 15 SP3 LTSS 15-SP3 (src):
 gcc13-13.2.1+git8285-150000.1.9.1, cross-nvptx-gcc13-13.2.1+git8285-150000.1.9.1
SUSE Linux Enterprise Server 15 SP4 LTSS 15-SP4 (src):
 gcc13-13.2.1+git8285-150000.1.9.1, cross-nvptx-gcc13-13.2.1+git8285-150000.1.9.1
SUSE Linux Enterprise Server for SAP Applications 15 SP2 (src):
 gcc13-13.2.1+git8285-150000.1.9.1, cross-nvptx-gcc13-13.2.1+git8285-150000.1.9.1
SUSE Linux Enterprise Server for SAP Applications 15 SP3 (src):
 gcc13-13.2.1+git8285-150000.1.9.1, cross-nvptx-gcc13-13.2.1+git8285-150000.1.9.1
SUSE Enterprise Storage 7.1 (src):
 gcc13-13.2.1+git8285-150000.1.9.1, cross-nvptx-gcc13-13.2.1+git8285-150000.1.9.1
SUSE Linux Enterprise Micro 5.1 (src):
 gcc13-13.2.1+git8285-150000.1.9.1
SUSE Linux Enterprise Micro 5.2 (src):
 gcc13-13.2.1+git8285-150000.1.9.1
SUSE Linux Enterprise Micro for Rancher 5.2 (src):
 gcc13-13.2.1+git8285-150000.1.9.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 18 Maintenance Automation 2024-06-19 12:30:11 UTC
SUSE-RU-2024:2087-1: An update that has 10 fixes can now be installed.

Category: recommended (moderate)
Bug References: 1188441, 1210959, 1214934, 1217450, 1217667, 1218492, 1219031, 1219520, 1220724, 1221239
Maintenance Incident: [SUSE:Maintenance:34272](https://smelt.suse.de/incident/34272/)
Sources used:
Toolchain Module 12 (src):
 cross-nvptx-gcc13-13.3.0+git8781-1.13.1, gcc13-13.3.0+git8781-1.13.1
SUSE Linux Enterprise High Performance Computing 12 SP5 (src):
 gcc13-13.3.0+git8781-1.13.1
SUSE Linux Enterprise Server 12 SP5 (src):
 gcc13-13.3.0+git8781-1.13.1
SUSE Linux Enterprise Server for SAP Applications 12 SP5 (src):
 gcc13-13.3.0+git8781-1.13.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.