diff mbox

[6/7] powerpc: switch to using thin archives if COMPILE_TEST is set

Message ID 20161019031600.17933-7-npiggin@gmail.com (mailing list archive)
State Accepted
Headers show

Commit Message

Nicholas Piggin Oct. 19, 2016, 3:15 a.m. UTC
Enable thin archives build for powerpc when COMPILE_TEST is set.
Thin archives are explained in this commit:

  a5967db9af51a84f5e181600954714a9e4c69f1f

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>
---
 arch/powerpc/Kconfig  | 1 +
 arch/powerpc/Makefile | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

Comments

Stephen Rothwell Oct. 19, 2016, 5:57 a.m. UTC | #1
Hi Nick,

On Wed, 19 Oct 2016 14:15:59 +1100 Nicholas Piggin <npiggin@gmail.com> wrote:
>
> Enable thin archives build for powerpc when COMPILE_TEST is set.
> Thin archives are explained in this commit:
> 
>   a5967db9af51a84f5e181600954714a9e4c69f1f

This reference should be like this:

  a5967db9af51 ("kbuild: allow architectures to use thin archives instead of ld -r")
Nicholas Piggin Oct. 19, 2016, 9:26 a.m. UTC | #2
On Wed, 19 Oct 2016 16:57:23 +1100
Stephen Rothwell <sfr@canb.auug.org.au> wrote:

> Hi Nick,
> 
> On Wed, 19 Oct 2016 14:15:59 +1100 Nicholas Piggin <npiggin@gmail.com> wrote:
> >
> > Enable thin archives build for powerpc when COMPILE_TEST is set.
> > Thin archives are explained in this commit:
> > 
> >   a5967db9af51a84f5e181600954714a9e4c69f1f  
> 
> This reference should be like this:
> 
>   a5967db9af51 ("kbuild: allow architectures to use thin archives instead of ld -r")
> 

Hi Stephen,

Good point, I'll change it.

Thanks,
Nick
Michael Ellerman Oct. 19, 2016, 11 a.m. UTC | #3
Nicholas Piggin <npiggin@gmail.com> writes:

> Enable thin archives build for powerpc when COMPILE_TEST is set.
> Thin archives are explained in this commit:
>
>   a5967db9af51a84f5e181600954714a9e4c69f1f
>
> This is a gradual way to introduce the option to testers.

I think I'd rather this was actually a user-selectable option, eg.

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.


cheers
Nicholas Piggin Oct. 20, 2016, 3:48 a.m. UTC | #4
On Wed, 19 Oct 2016 22:00:06 +1100
Michael Ellerman <mpe@ellerman.id.au> wrote:

> Nicholas Piggin <npiggin@gmail.com> writes:
> 
> > Enable thin archives build for powerpc when COMPILE_TEST is set.
> > Thin archives are explained in this commit:
> >
> >   a5967db9af51a84f5e181600954714a9e4c69f1f
> >
> > This is a gradual way to introduce the option to testers.  
> 
> I think I'd rather this was actually a user-selectable option, eg.
> 
> 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.

Okay, that should be easy. I'll respin the series.

Thanks,
Nick
Michael Ellerman Nov. 22, 2016, 12:34 a.m. UTC | #5
On Wed, 2016-10-19 at 03:15:59 UTC, Nicholas Piggin wrote:
> Enable thin archives build for powerpc when COMPILE_TEST is set.
> Thin archives are explained in this commit:
> 
>   a5967db9af51a84f5e181600954714a9e4c69f1f
> 
> 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>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/43c9127d94d62a232ed33ed2eab8a0

cheers
diff mbox

Patch

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 65fba4c..00d9e31 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -80,6 +80,7 @@  config ARCH_HAS_DMA_SET_COHERENT_MASK
 config PPC
 	bool
 	default y
+	select THIN_ARCHIVES if COMPILE_TEST
 	select ARCH_MIGHT_HAVE_PC_PARPORT
 	select ARCH_MIGHT_HAVE_PC_SERIO
 	select BINFMT_ELF
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 0fcb47c..fe76cfe 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -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