On Wed, Aug 27, 2025 at 10:21:30PM +0200, Tobias Burnus wrote:
> [gcn] gcc/configure.ac + install.texi - changes to detect HAVE_AS_LEB128
> [PR119367]
>
> The llvm-mc linker by default assemblies to another assembly file and not to
> an ELF
> binary; that usually does not matter – but for the LEB128 check,
> additionally, the
> resulting binary is checked. Hence, when using llvm-mc as target linker for
> amdgcn-*-*, we better add the "--filetype=obj -triple=amdgcn--amdhsa" flags.
> The
> current patch does so unconditionally, assuming that always llvm-mc is used.
>
> Additionally, the resulting ELF file is checked, which requires an ELF reader
> such
> as objdump. This commit adds llvm-objdump to the build documentation for
> amdgcn,
> albeit also, e.g., Binutil's 'objdump' would do - as long as either
> amdgcn-amdhsa-objdump or amdgcn-amdhsa/bin/objdump is found during the amdgcn
> cross build.
>
> gcc/ChangeLog:
>
> PR debug/119367
> * acinclude.m4 (gcc_GAS_FLAGS): For gcn, use "--filetype=obj
> -triple=amdgcn--amdhsa", if supported.
> * configure: Regenerate.
> * doc/install.texi (amdgcn-*-*): Also add llvm-objdump to the list of
> to-be-copied files.
LGTM with a small nit.
> gcc/acinclude.m4 | 5 +++++
> gcc/configure | 3 +++
> gcc/doc/install.texi | 1 +
> 3 files changed, 9 insertions(+)
>
> diff --git a/gcc/acinclude.m4 b/gcc/acinclude.m4
> index ca4820221d5..ad8b878e24d 100644
> --- a/gcc/acinclude.m4
> +++ b/gcc/acinclude.m4
> @@ -481,6 +481,11 @@ AC_DEFUN([gcc_GAS_FLAGS],
> dnl Always pass -arch ppc to assembler.
> gcc_cv_as_flags="-arch ppc"
> ;;
> + amdgcn*)
> + dnl Currently, only the llvm-mc assembler is supported.
> + dnl Add flags to ensure an amdgcn ELF file is written
I'd add a full stop after written
Jakub