summaryrefslogtreecommitdiff
path: root/arch/sparc/vdso/Makefile
diff options
context:
space:
mode:
authorKoakuma <koachan@protonmail.com>2024-10-29 21:49:07 +0700
committerAndreas Larsson <andreas@gaisler.com>2024-11-16 09:52:56 +0100
commit69114be15b35a4d7ff084a6415fad018da648942 (patch)
tree5c5800fe58057293c9780f7246a10bd3df9f73d9 /arch/sparc/vdso/Makefile
parent9852d85ec9d492ebef56dc5f229416c925758edc (diff)
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>
Diffstat (limited to 'arch/sparc/vdso/Makefile')
-rw-r--r--arch/sparc/vdso/Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/sparc/vdso/Makefile b/arch/sparc/vdso/Makefile
index 243dbfc4609d..50ec2978cda5 100644
--- a/arch/sparc/vdso/Makefile
+++ b/arch/sparc/vdso/Makefile
@@ -46,7 +46,7 @@ CFL := $(PROFILING) -mcmodel=medlow -fPIC -O2 -fasynchronous-unwind-tables -m64
-fno-omit-frame-pointer -foptimize-sibling-calls \
-DDISABLE_BRANCH_PROFILING -DBUILD_VDSO
-SPARC_REG_CFLAGS = -ffixed-g4 -ffixed-g5 -fcall-used-g5 -fcall-used-g7
+SPARC_REG_CFLAGS = -ffixed-g4 -ffixed-g5 $(call cc-option,-fcall-used-g5) $(call cc-option,-fcall-used-g7)
$(vobjs): KBUILD_CFLAGS := $(filter-out $(RANDSTRUCT_CFLAGS) $(GCC_PLUGINS_CFLAGS) $(SPARC_REG_CFLAGS),$(KBUILD_CFLAGS)) $(CFL)