sparc/build: Put usage of -fcall-used* flags behind cc-option
authorKoakuma <koachan@protonmail.com>
Tue, 29 Oct 2024 14:49:07 +0000 (21:49 +0700)
committerAndreas Larsson <andreas@gaisler.com>
Sat, 16 Nov 2024 08:52:56 +0000 (09:52 +0100)
commit69114be15b35a4d7ff084a6415fad018da648942
tree5c5800fe58057293c9780f7246a10bd3df9f73d9
parent9852d85ec9d492ebef56dc5f229416c925758edc
sparc/build: Put usage of -fcall-used* flags behind cc-option

Place -fcall-used* flags behind cc-option so that clang (which doesn't
support them) can still compile the kernel.

This is a safe change, the reasoning is as follows:

In the (normal) 32-bit ABI, %g5 and %g7 is normally reserved, and in
the 64-bit ABI, %g7 is the reserved one.
Linux turns them into volatile registers by the way of -fcall-used-*,
but on the other hand, omitting the flags shouldn't be harmful;
compilers will now simply refuse to touch them, and any assembly
code that happens to touch them would still work like usual (because
Linux' conventions already treats them as volatile anyway).

Signed-off-by: Koakuma <koachan@protonmail.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Andreas Larsson <andreas@gaisler.com>
Link: https://lore.kernel.org/r/20241029-sparc-cflags-v3-1-b28745a6bd71@protonmail.com
Signed-off-by: Andreas Larsson <andreas@gaisler.com>
arch/sparc/Makefile
arch/sparc/vdso/Makefile