Subject: amdgcn-tools: Please upgrade build-dep to llvm/clang 18 or 19

From: Sylvestre Ledru <[email-masked]>
Date: Fri, 4 Oct 2024 18:50:41 +0200

Source: amdgcn-tools
Severity: important

Dear Maintainer,

We would like to remove llvm-toolchain-17 and this package uses LLVM 17.
Please update to 19 (preferred) or 18

Thanks
Sylvestre

-- System Information:
Debian Release: trixie/sid
APT prefers testing
APT policy: (990, 'testing'), (600, 'unstable'), (500, 'oldstable'), 
(300, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 6.10.9-amd64 (SMP w/20 CPU threads; PREEMPT)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE 
not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

---

From: Bastian Germann <[email-masked]>
Date: Thu, 12 Dec 2024 00:07:55 +0100

> Please update to 19 (preferred) or 18
Please also get rid of the unnecessary llvm-* Build-Dependencies when updating the llvm version.

---

From: Matthias Klose <[email-masked]>
Date: Thu, 12 Dec 2024 12:05:59 +0100

> updating the llvm version.

we can't do that unless we stop shipping GCC 13, or reverting the 
removal of the gcn* targets in LLVM 18.  So probably you should start 
working on getting these targets back into LLVM 18 or LLVM 19.

Matthias

---

From: Emilio Pozuelo Monfort <[email-masked]>
Date: Fri, 10 Jan 2025 12:08:39 +0100

Control: clone -1 -2
Control: reassign -2 src:llvm-toolchain-19
Control: retitle -2 llvm-toolchain-19: readd gcn targets
Control: block -1 with -2

Hi,

> working on getting these targets back into LLVM 18 or LLVM 19.
I don't see in the changelog for llvm 18 or 19 that the targets were removed, so 
perhaps the removal was unintentional? Sylvestre, can those be added back, so 
that amdgcn-tools can move to a newer llvm? This is one of the last blockers for 
the removal of llvm-toolchain-17 from trixie.

Cheers,
Emilio

---

From: Matthias Klose <[email-masked]>
Date: Fri, 10 Jan 2025 12:33:49 +0100

On 10.01.25 12:08, Emilio Pozuelo Monfort wrote:
>> > On Fri, 4 Oct 2024 18:50:41 +0200 Sylvestre Ledru 
>> <[email-masked]> > wrote:
>> > Please also get rid of the unnecessary llvm-* Build-Dependencies 
>> when > updating the llvm version.
>> >
> I don't see in the changelog for llvm 18 or 19 that the targets were 
> removed, so perhaps the removal was unintentional? Sylvestre, can those 
> be added back, so that amdgcn-tools can move to a newer llvm? This is 
> one of the last blockers for the removal of llvm-toolchain-17 from trixie.

why is the removal required? There are no known security issues reported 
(checked with the security team), and after an odyssey of the release 
team blocking both llvm-18 and llvm-19 from testing for a long time, not 
encouraging migration to newer LLVM versions, I don't see any necessity 
to drop LLVM 17. If you want to drop one more version, please consider 
dropping 18 instead.

Matthias

---

From: Sylvestre Ledru <[email-masked]>
Date: Fri, 10 Jan 2025 11:47:11 +0000

Le 10/01/2025 à 12:08, Emilio Pozuelo Monfort a écrit :
> Sylvestre, can those be added back, so
> that amdgcn-tools can move to a newer llvm?

Sure, do you know how to do that?

I don't think it was intentional

Thanks

S

---

From: Sylvestre Ledru <[email-masked]>
Date: Fri, 10 Jan 2025 11:47:16 +0000

> to drop LLVM 17. If you want to drop one more version, please consider

Sorry but I am in favor of the llvm 17 removal. I don't see the point of 
removing 18 and keeping 17.

Thanks

Sylvestre

---

From: Emilio Pozuelo Monfort <[email-masked]>
Date: Fri, 10 Jan 2025 13:21:51 +0100

> I don't think it was intentional

I don't know. I see this in debian/rules for both llvm 18 and 19:

LIBCLC_TARGETS_TO_BUILD=amdgcn--;amdgcn--amdhsa;amdgcn-mesa-mesa3d;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl
LIBCLC_LLVM_SPIRV =
ifeq ($(LLVM_SPIRV_INSTALLED),yes)
	LIBCLC_TARGETS_TO_BUILD := $(LIBCLC_TARGETS_TO_BUILD);spirv-mesa3d-;spirv64-mesa3d-
	LIBCLC_LLVM_SPIRV = -DLLVM_SPIRV=$(LLVM_SPIRV)
endif

Perhaps Matthias can shed some light.

Cheers,
Emilio

---

From: Matthias Klose <[email-masked]>
Date: Fri, 10 Jan 2025 14:19:34 +0100

On 10.01.25 13:21, Emilio Pozuelo Monfort wrote:
> LIBCLC_TARGETS_TO_BUILD=amdgcn--;amdgcn--amdhsa;amdgcn-mesa- 
> mesa3d;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl
> LIBCLC_LLVM_SPIRV =

please try building gcc-13 with amdgcn-tools-18 for enlightenment. 
That's what I would have to do as well.

Matthias

---

From: Kurt Roeckx <[email-masked]>
Date: Sat, 26 Apr 2025 15:51:51 +0200

On Fri, Jan 10, 2025 at 12:08:39PM +0100, Emilio Pozuelo Monfort wrote:
> removed, so perhaps the removal was unintentional? Sylvestre, can those be
> added back, so that amdgcn-tools can move to a newer llvm? This is one of
> the last blockers for the removal of llvm-toolchain-17 from trixie.

Any update on this?

Kurt

---

From: Sylvestre Ledru <[email-masked]>
Date: Sun, 27 Apr 2025 00:07:28 +0200

>> the last blockers for the removal of llvm-toolchain-17 from trixie.

not really.

I had a look and I don't think it is a packaging changes that caused the 
regression. Seems to be upstream.

btw, what would be the best way to verify that it works for you folks ?

clang-17 --print-targets and clang-18 --print-targets have the same output

libclc-17 & libclc-18 have more of less similar files

and what is wrong with amdgcn-tools? I can build with -18

thanks

S

---

From: Matthias Klose <[email-masked]>
Date: Sun, 27 Apr 2025 03:53:48 +0200

> and what is wrong with amdgcn-tools? I can build with -18

sure, you can, it's just a package providing symlinks. and then gcc-13 
ftbfs, because some gcn targets are missing.

---

From: Arnout Vandecappelle <[email-masked]>
Date: Mon, 28 Apr 2025 11:39:20 +0200

On 10/01/2025 14:19, Matthias Klose wrote:
> please try building gcc-13 with amdgcn-tools-18 for enlightenment. That's what I 
> would have to do as well.

  Here is some enlightenment :-)

  I changed the amdgnc-tools dependencies in gcc-13_13.3.0-13 into 
amdgnc-tools-19, and this is the error:

----------- Error message ---------
checking for suffix of object files... configure: error: in 
`/gcc-13-13.3.0/build-gcn/amdgcn-amdhsa/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details
make[3]: *** [Makefile:13642: configure-target-libgcc] Error 1
----------- End error message -----

---------- libgcc config.log ------
configure:3792: checking for suffix of object files
configure:3814: /gcc-13-13.3.0/build-gcn/./gcc/xgcc 
-B/gcc-13-13.3.0/build-gcn/./gcc/ -nostdinc 
-B/gcc-13-13.3.0/build-gcn/amdgcn-amdhsa/newlib/ -isystem 
/gcc-13-13.3.0/build-gcn/amdgcn-amdhsa/newlib/targ-include -isystem 
/gcc-13-13.3.0/src-gcn/newlib/libc/include -B/usr/amdgcn-amdhsa/bin/ 
-B/usr/amdgcn-amdhsa/lib/ -isystem /usr/amdgcn-amdhsa/include -isystem 
/usr/amdgcn-amdhsa/sys-include -isystem /gcc-13-13.3.0/build-gcn/sys-include 
-c -g -O2  conftest.c >&5
LLVM ERROR: Unsupported AMDHSA Code Object Version 3
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and 
include the crash backtrace.
Stack dump:
0.      Program arguments: /gcc-13-13.3.0/bin-gcn/as -triple=amdgcn--amdhsa 
-mcpu=fiji --amdhsa-code-object-version=3 -filetype=obj -o conftest.o 
/tmp/ccr8js5c.s
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or 
set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  libLLVM.so.19.1 0x00007f3604ab06ba 
llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 58
1  libLLVM.so.19.1 0x00007f3604aae264 llvm::sys::RunSignalHandlers() + 84
2  libLLVM.so.19.1 0x00007f3604ab0d7b
3  libc.so.6       0x00007f3603649df0
4  libc.so.6       0x00007f360369e95c
5  libc.so.6       0x00007f3603649cc2 gsignal + 18
6  libc.so.6       0x00007f36036324ac abort + 34
7  libLLVM.so.19.1 0x00007f3604a02e78 llvm::report_fatal_error(llvm::Twine 
const&, bool) + 440
8  libLLVM.so.19.1 0x00007f3606f92a7b
9  libLLVM.so.19.1 0x00007f3606f8b540
10 libLLVM.so.19.1 0x00007f3606253b22 llvm::MCStreamer::finish(llvm::SMLoc) + 82
11 libLLVM.so.19.1 0x00007f360628e37e
12 as              0x000056289fe624ea
13 as              0x000056289fe613d8
14 libc.so.6       0x00007f3603633ca8
15 libc.so.6       0x00007f3603633d65 __libc_start_main + 133
16 as              0x000056289fe5cd11
xgcc: internal compiler error: Aborted signal terminated program as
Please submit a full bug report, with preprocessed source (by using -freport-bug).
See <https://gcc.gnu.org/bugs/> for instructions.
configure:3818: $? = 4
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU C Runtime Library"
| #define PACKAGE_TARNAME "libgcc"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "GNU C Runtime Library 1.0"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL "http://www.gnu.org/software/libgcc/"
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:3832: error: in `/gcc-13-13.3.0/build-gcn/amdgcn-amdhsa/libgcc':
configure:3834: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details
------- end libgcc config.log -----

  So the error is "LLVM ERROR: Unsupported AMDHSA Code Object Version 3"

  This leads to the following bug report in GCC [1] - conclusion is that it's 
fixed in GCC 14 by commits [2] and [3].

  So it seems to me that the options for trixie are:

- Keep LLVM 17 supported.
- Backport those two commits to GCC 13.

  Of course it's hard to say up front what the chance of success is of 
backporting those two patches. I'm not sure if the risk is worth it at this 
point in the release cycle.

  (As an aside, I don't think an ICE is the proper way to deal with an 
unsupported code object, but OK.)

  Regards,
  Arnout

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114419
[2] https://gcc.gnu.org/cgit/gcc/commit/?id=56ed1055b2f40ac162ae8d382280ac07a33f789f
[3] https://gcc.gnu.org/cgit/gcc/commit/?id=4b5650acb3107239867830dc1214b31bdbe3cacd

---

From: Matthias Klose <[email-masked]>
Date: Wed, 30 Apr 2025 08:46:31 +0200

On 28.04.25 11:39, Arnout Vandecappelle wrote:
>   This leads to the following bug report in GCC [1] - conclusion is that 
> it's fixed in GCC 14 by commits [2] and [3].

the "fixes" are the removal to support this hardware.

> - Keep LLVM 17 supported.

yes, that's my preferred solution.

> - Backport those two commits to GCC 13.

it's not a backport, it's removal of a feature.

---

From: Sylvestre Ledru <[email-masked]>
Date: Wed, 30 Apr 2025 21:44:40 +0200

> ftbfs, because some gcn targets are missing.

Sorry but the dumb question but how these gcn targets can be used ?

or how can I see them with 17 and missing in 18?

Thanks

S