]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
powerpc: Add option to use thin archives
authorNicholas Piggin <npiggin@gmail.com>
Wed, 19 Oct 2016 03:15:59 +0000 (14:15 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 18 Nov 2016 11:40:42 +0000 (22:40 +1100)
Add an option to use thin archives to build the kernel.
Thin archives are explained in commit a5967db9af51 ("kbuild: allow
architectures to use thin archives instead of ld -r").

This is a gradual way to introduce the option to testers.

Some change to the way we invoke ar is required so it can be used
by scripts/link-vmlinux.sh.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
[mpe: Make it an explicit option not dependant on COMPILE_TEST]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/Kconfig
arch/powerpc/Makefile

index b49062b060d2027d1af658fff0f81e0a8649c697..5ee3dbeab3234cf72644baa14eba227c86992aa6 100644 (file)
@@ -396,6 +396,14 @@ config MPROFILE_KERNEL
        depends on PPC64 && CPU_LITTLE_ENDIAN
        def_bool !DISABLE_MPROFILE_KERNEL
 
+config USE_THIN_ARCHIVES
+       bool "Build the kernel using thin archives"
+       default n
+       select THIN_ARCHIVES
+       help
+         Build the kernel using thin archives.
+         If you're unsure say N.
+
 config IOMMU_HELPER
        def_bool PPC64
 
index 041fda1e2a5db178892ed1effaf3424b62a72824..0ee7be32b112b6f3ca80d2fc8b2cc604f0d75fa8 100644 (file)
@@ -23,7 +23,7 @@ CROSS32AR             := $(CROSS32_COMPILE)ar
 ifeq ($(HAS_BIARCH),y)
 ifeq ($(CROSS32_COMPILE),)
 CROSS32CC      := $(CC) -m32
-CROSS32AR      := GNUTARGET=elf32-powerpc $(AR)
+KBUILD_ARFLAGS += --target=elf32-powerpc
 endif
 endif
 
@@ -85,7 +85,7 @@ ifeq ($(HAS_BIARCH),y)
 override AS    += -a$(BITS)
 override LD    += -m elf$(BITS)$(LDEMULATION)
 override CC    += -m$(BITS)
-override AR    := GNUTARGET=elf$(BITS)-$(GNUTARGET) $(AR)
+KBUILD_ARFLAGS += --target=elf$(BITS)-$(GNUTARGET)
 endif
 
 LDFLAGS_vmlinux-y := -Bstatic