Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc: Add CONFIG_PPC64_ELF_ABI_V1 and CONFIG_PPC64_ELF_ABI_V2

At the time being, we use CONFIG_CPU_LITTLE_ENDIAN and
CONFIG_CPU_BIG_ENDIAN to pass -mabi=elfv1 or elfv2 to
compiler, then define a PPC64_ELF_ABI_v1 or PPC64_ELF_ABI_v2
macro in asm/types.h based on _CALL_ELF define set by the compiler.

Make it more straight forward with a CONFIG option that
is directly usable.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/1eca1addbc550167da9841c7340a010d0c4b2200.1652074503.git.christophe.leroy@csgroup.eu

authored by

Christophe Leroy and committed by
Michael Ellerman
661aa880 bbffdd2f

+13 -5
+5 -5
arch/powerpc/Makefile
··· 89 89 90 90 ifdef CONFIG_PPC64 91 91 ifndef CONFIG_CC_IS_CLANG 92 - cflags-$(CONFIG_CPU_BIG_ENDIAN) += $(call cc-option,-mabi=elfv1) 93 - cflags-$(CONFIG_CPU_BIG_ENDIAN) += $(call cc-option,-mcall-aixdesc) 94 - aflags-$(CONFIG_CPU_BIG_ENDIAN) += $(call cc-option,-mabi=elfv1) 95 - aflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mabi=elfv2 92 + cflags-$(CONFIG_PPC64_ELF_ABI_V1) += $(call cc-option,-mabi=elfv1) 93 + cflags-$(CONFIG_PPC64_ELF_ABI_V1) += $(call cc-option,-mcall-aixdesc) 94 + aflags-$(CONFIG_PPC64_ELF_ABI_V1) += $(call cc-option,-mabi=elfv1) 95 + aflags-$(CONFIG_PPC64_ELF_ABI_V2) += -mabi=elfv2 96 96 endif 97 97 endif 98 98 ··· 141 141 142 142 CFLAGS-$(CONFIG_PPC64) := $(call cc-option,-mtraceback=no) 143 143 ifndef CONFIG_CC_IS_CLANG 144 - ifdef CONFIG_CPU_LITTLE_ENDIAN 144 + ifdef CONFIG_PPC64_ELF_ABI_V2 145 145 CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv2,$(call cc-option,-mcall-aixdesc)) 146 146 AFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv2) 147 147 else
+2
arch/powerpc/boot/Makefile
··· 53 53 BOOTCFLAGS += -mbig-endian 54 54 else 55 55 BOOTCFLAGS += -mlittle-endian 56 + endif 57 + ifdef CONFIG_PPC64_ELF_ABI_V2 56 58 BOOTCFLAGS += $(call cc-option,-mabi=elfv2) 57 59 endif 58 60
+6
arch/powerpc/platforms/Kconfig.cputype
··· 552 552 553 553 endchoice 554 554 555 + config PPC64_ELF_ABI_V1 556 + def_bool PPC64 && CPU_BIG_ENDIAN 557 + 558 + config PPC64_ELF_ABI_V2 559 + def_bool PPC64 && CPU_LITTLE_ENDIAN 560 + 555 561 config PPC64_BOOT_WRAPPER 556 562 def_bool n 557 563 depends on CPU_LITTLE_ENDIAN