On 03/03/2026 11:02, Jakub Jelinek wrote:
On Tue, Mar 03, 2026 at 10:47:07AM +0000, Richard Earnshaw (foss) wrote:
I expect the problem to be non-gas assemblers. Specifically Sparc/solaris.
I'd code this as minimally as possible, perhaps something like
#ifdef __ELF__
#ifdef __sparc__ // For Solaris assembler -- Check spelling (of __sparc__)
here
#define TYPE_PFX "@"
Actually, the prefix for SPARC is "#" rather than "@".
#else
#define TYPE_PFX "%%"
#endif
And % is only used on arm/aarch64. So I think it should be something like:
#ifdef __sparc__
#define TYPE_PFX "#"
#elif defined (__arm__) || defined (__aarch64__)
#define TYPE_PFX "%%"
#else
#define TYPE_PFX "@"
#endif
That will match what GCC actually emits itself.
Jakub
We're using @ for GCN, but I believe llvm-mc will accept any of #, %, or
" too (except when one of those is the comment character, but GCN is
using ; for comments, so that's irrelevant here).
Andrew