powerpc/Makefile: Remove bits related to the previous use of -mcmodel=large
authorNaveen N Rao <naveen@kernel.org>
Wed, 10 Jan 2024 14:12:37 +0000 (19:42 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 7 May 2024 13:48:45 +0000 (23:48 +1000)
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.

Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Naveen N Rao <naveen@kernel.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20240110141237.3179199-1-naveen@kernel.org
arch/powerpc/Makefile
arch/powerpc/kernel/Makefile
arch/powerpc/lib/Makefile
arch/powerpc/mm/Makefile
arch/powerpc/mm/book3s64/Makefile
arch/powerpc/mm/nohash/Makefile
arch/powerpc/platforms/pseries/Makefile
arch/powerpc/sysdev/Makefile
arch/powerpc/xmon/Makefile

index 65261cbe5bfdbf79c90414a5ba3a158ae58abafe..0a0c57aee1ae04497e739dd92a605f6684eedade 100644 (file)
@@ -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) += -mcmodel=medium
 CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mno-pointers-to-nested-functions)
 CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mlong-double-128)
 
index f5dd2d65cdbea90f3c09557422bba568aa3acd27..8585d03c02d3d51ee5ff6f3d92c5f49c0058d725 100644 (file)
@@ -3,9 +3,6 @@
 # Makefile for the linux kernel.
 #
 
-ifdef CONFIG_PPC64
-CFLAGS_prom_init.o     += $(NO_MINIMAL_TOC)
-endif
 ifdef CONFIG_PPC32
 CFLAGS_prom_init.o      += -fPIC
 CFLAGS_btext.o         += -fPIC
index 0ab65eeb93ee3a73346a2d9e7b4e5617f6b40ed3..f14ecab674a34081785eb995fca045958eca193b 100644 (file)
@@ -3,8 +3,6 @@
 # Makefile for ppc-specific library files..
 #
 
-ccflags-$(CONFIG_PPC64)        := $(NO_MINIMAL_TOC)
-
 CFLAGS_code-patching.o += -fno-stack-protector
 CFLAGS_feature-fixups.o += -fno-stack-protector
 
index 503a6e249940cae8ca431901a735ed4030c194f5..0fe2f085c05ad34e4ce3bac05ca596c053ba664a 100644 (file)
@@ -3,8 +3,6 @@
 # Makefile for the linux ppc-specific parts of the memory manager.
 #
 
-ccflags-$(CONFIG_PPC64)        := $(NO_MINIMAL_TOC)
-
 obj-y                          := fault.o mem.o pgtable.o maccess.o pageattr.o \
                                   init_$(BITS).o pgtable_$(BITS).o \
                                   pgtable-frag.o ioremap.o ioremap_$(BITS).o \
index cad2abc1730fa1b3e32704b7f967e909243c2e3f..33af5795856a7877d77f5921a31d66358f732103 100644 (file)
@@ -1,7 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0
 
-ccflags-y      := $(NO_MINIMAL_TOC)
-
 obj-y                          += mmu_context.o pgtable.o trace.o
 ifdef CONFIG_PPC_64S_HASH_MMU
 CFLAGS_REMOVE_slb.o = $(CC_FLAGS_FTRACE)
index f3894e79d5f700f57d9f7a35e92c030ad1f49f5f..b3f0498dd42f3b095543b9f1e148806c6050ef94 100644 (file)
@@ -1,7 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0
 
-ccflags-$(CONFIG_PPC64)        := $(NO_MINIMAL_TOC)
-
 obj-y                          += mmu_context.o tlb.o tlb_low.o kup.o
 obj-$(CONFIG_PPC_BOOK3E_64)    += tlb_low_64e.o book3e_pgtable.o
 obj-$(CONFIG_40x)              += 40x.o
index f936962a29469c0fc6ee8d362c97a5fb73fbab10..7bf506f6b8c87f6ae29beea443e80ac0b380b6d3 100644 (file)
@@ -1,5 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0
-ccflags-$(CONFIG_PPC64)                        := $(NO_MINIMAL_TOC)
 ccflags-$(CONFIG_PPC_PSERIES_DEBUG)    += -DDEBUG
 
 obj-y                  := lpar.o hvCall.o nvram.o reconfig.o \
index 9cb1d029511a0154b6348f2ab101907d955eee9c..24a177d164f1f575d52bc67f650fc2387f42376d 100644 (file)
@@ -1,7 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0
 
-ccflags-$(CONFIG_PPC64)                := $(NO_MINIMAL_TOC)
-
 mpic-msi-obj-$(CONFIG_PCI_MSI) += mpic_msi.o mpic_u3msi.o
 obj-$(CONFIG_MPIC)             += mpic.o $(mpic-msi-obj-y)
 obj-$(CONFIG_MPIC_TIMER)        += mpic_timer.o
index 682c7c0a6f77d40985bd7d7a17a46a0de62364db..d778011060a8de2327b0d2ba3b3d9fba75627a42 100644 (file)
@@ -10,8 +10,6 @@ KCSAN_SANITIZE := n
 # Disable ftrace for the entire directory
 ccflags-remove-$(CONFIG_FUNCTION_TRACER) += $(CC_FLAGS_FTRACE)
 
-ccflags-$(CONFIG_PPC64) := $(NO_MINIMAL_TOC)
-
 # Clang stores addresses on the stack causing the frame size to blow
 # out. See https://github.com/ClangBuiltLinux/linux/issues/252
 ccflags-$(CONFIG_CC_IS_CLANG) += -Wframe-larger-than=4096