]> git.ipfire.org Git - thirdparty/gcc.git/commit
[gcn] mkoffload.cc: Print fatal error if -march has no multilib but generic has
authorTobias Burnus <tburnus@baylibre.com>
Mon, 10 Feb 2025 17:24:34 +0000 (18:24 +0100)
committerTobias Burnus <tburnus@baylibre.com>
Mon, 10 Feb 2025 17:24:34 +0000 (18:24 +0100)
commit4ce8ad684b90606a74f0cccfd9455184046c6c4e
tree525f5a4fb6b5f965d7d29da0931716c09a5cc44c
parent7037fdf6bd0a4eea4a436b432265d6b7cc481737
[gcn] mkoffload.cc: Print fatal error if -march has no multilib but generic has

Assume that a distro has configured, e.g., a gfx9-generic multilib but not
for gfx902. In that case, mkoffload would fail to link with "error:
incompatible mach".  With this commit, an error is printed suggesting to try
the associated generic architecture instead.  The behavior is unchanged if
there is a multilib available for the specific ISA or when there is also no
multilib for the generic ICA.

Note: The build of generic multilibs are currently not enabled by default;
they also require the linker/assembler of LLVM 19 or newer and, in particular,
for the execution a future ROCm release. (The next one? In any case, 6.3.2
does not support generic ISAs, yet.)

gcc/ChangeLog:

* config/gcn/mkoffload.cc (enum elf_arch_code): Add
EF_AMDGPU_MACH_AMDGCN_NONE.
(elf_arch): Use enum elf_arch_code as type.
(tool_cleanup): Silence warning by removing tailing '.' from error.
(get_arch_name): Return enum elf_arch_code.
(check_for_missing_lib): New; print fatal error if the multilib
is not available but it is for the associate generic ISA.
(main): Call it.
gcc/config/gcn/mkoffload.cc