[PATCH] powerpc/Makefile: Remove bits related to the previous use of -mcmodel=large

Christophe Leroy christophe.leroy at csgroup.eu
Wed Jan 10 02:15:35 AEDT 2024



Le 09/01/2024 à 14:34, Naveen N Rao a écrit :
> All supported compilers today (gcc v5.1+ and clang v11+) have support for
> -mcmodel=medium. As such, NO_MINIMAL_TOC is no longer being set. Remove
> NO_MINIMAL_TOC as well as the fallback to -mminimal-toc.
> 
> Signed-off-by: Naveen N Rao <naveen at kernel.org>

Reviewed-by: Christophe Leroy <christophe.leroy at csgroup.eu>

Small comment below,

> ---
>   arch/powerpc/Makefile                   | 6 +-----
>   arch/powerpc/kernel/Makefile            | 3 ---
>   arch/powerpc/lib/Makefile               | 2 --
>   arch/powerpc/mm/Makefile                | 2 --
>   arch/powerpc/mm/book3s64/Makefile       | 2 --
>   arch/powerpc/mm/nohash/Makefile         | 2 --
>   arch/powerpc/platforms/pseries/Makefile | 1 -
>   arch/powerpc/sysdev/Makefile            | 2 --
>   arch/powerpc/xmon/Makefile              | 2 --
>   9 files changed, 1 insertion(+), 21 deletions(-)
> 
> diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
> index 051247027da0..a0eb0fb1aba8 100644
> --- a/arch/powerpc/Makefile
> +++ b/arch/powerpc/Makefile
> @@ -114,7 +114,6 @@ LDFLAGS_vmlinux	:= $(LDFLAGS_vmlinux-y)
>   
>   ifdef CONFIG_PPC64
>   ifndef CONFIG_PPC_KERNEL_PCREL
> -ifeq ($(call cc-option-yn,-mcmodel=medium),y)
>   	# -mcmodel=medium breaks modules because it uses 32bit offsets from
>   	# the TOC pointer to create pointers where possible. Pointers into the
>   	# percpu data area are created by this method.
> @@ -124,9 +123,6 @@ ifeq ($(call cc-option-yn,-mcmodel=medium),y)
>   	# kernel percpu data space (starting with 0xc...). We need a full
>   	# 64bit relocation for this to work, hence -mcmodel=large.
>   	KBUILD_CFLAGS_MODULE += -mcmodel=large
> -else
> -	export NO_MINIMAL_TOC := -mno-minimal-toc
> -endif
>   endif
>   endif
>   
> @@ -139,7 +135,7 @@ CFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mabi=elfv1)
>   CFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mcall-aixdesc)
>   endif
>   endif
> -CFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mcmodel=medium,$(call cc-option,-mminimal-toc))
> +CFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mcmodel=medium)

Should we still use $(call cc-option  here ?
As we only deal with medium model now, shouldn't we make it such that it 
fails in case the compiler doesn't support -mcmodel=medium ?

>   CFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mno-pointers-to-nested-functions)
>   CFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mlong-double-128)
>   


More information about the Linuxppc-dev mailing list