All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicholas Piggin <npiggin@gmail.com>
To: linux-kbuild@vger.kernel.org
Cc: linux-arch@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Arnd Bergmann <arnd@arndb.de>, Nicolas Pitre <nico@linaro.org>,
	Segher Boessenkool <segher@kernel.crashing.org>,
	Alan Modra <amodra@gmail.com>
Subject: Re: [RFC][PATCH 0/5] kbuild changes, thin archives, --gc-sections
Date: Fri, 5 Aug 2016 23:32:52 +1000	[thread overview]
Message-ID: <20160805233252.50cb8cce@roar.ozlabs.ibm.com> (raw)
In-Reply-To: <1470399123-8455-1-git-send-email-npiggin@gmail.com>

On Fri,  5 Aug 2016 22:11:58 +1000
Nicholas Piggin <npiggin@gmail.com> wrote:

> Hello,
> 
> I have 3 different things in this patchset. All arch specific, but all
> involve kbuild changes, so I'd like to discuss them with kbuild
> maintainers. The goal has been to improve long standing linking
> difficulties with the powerpc kernel.

Here's a 30 second hack of an x86 patch. It seems to build and
boot defconfig in a really quick kvm test.

For x86-64 machine building x86 target, defconfig,

make -j8 vmlinux time:
              orig      thinarc   thinarc+dce
real     4m58.865s    4m59.747s     5m20.028s
user    15m14.428s   15m13.868s    15m17.012s
sys      0m57.296s    0m55.904s     0m58.416s

build output directory size:
              orig      thinarc   thinarc+dce
              317M         257M          285M

vmlinux size:
    text     data      bss       dec   filename
10192338  4360136  1105920  15658394   vmlinux
10186739  4356040  1105920  15648699   vmlinux.thinarc
 9580486  3759880  1011712  14352078   vmlinux.thinarc+dce

Thanks,
Nick


diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 0a7b885..845069e 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -51,6 +51,8 @@ config X86
 	select ARCH_WANT_IPC_PARSE_VERSION	if X86_32
 	select ARCH_WANT_OPTIONAL_GPIOLIB
 	select BUILDTIME_EXTABLE_SORT
+	select THIN_ARCHIVES
+	select LINKER_DCE
 	select CLKEVT_I8253
 	select CLKSRC_I8253			if X86_32
 	select CLOCKSOURCE_VALIDATE_LAST_CYCLE
diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
index 9297a00..7395dd8 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -92,7 +92,7 @@ SECTIONS
 	.text :  AT(ADDR(.text) - LOAD_OFFSET) {
 		_text = .;
 		/* bootstrapping code */
-		HEAD_TEXT
+		KEEP(HEAD_TEXT)
 		. = ALIGN(8);
 		_stext = .;
 		TEXT_TEXT
@@ -321,7 +321,7 @@ SECTIONS
 	.bss : AT(ADDR(.bss) - LOAD_OFFSET) {
 		__bss_start = .;
 		*(.bss..page_aligned)
-		*(.bss)
+		*(.bss .bss.*)
 		. = ALIGN(PAGE_SIZE);
 		__bss_stop = .;
 	}

WARNING: multiple messages have this Message-ID (diff)
From: Nicholas Piggin <npiggin@gmail.com>
To: linux-kbuild@vger.kernel.org
Cc: linux-arch@vger.kernel.org,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Arnd Bergmann <arnd@arndb.de>, Nicolas Pitre <nico@linaro.org>,
	Alan Modra <amodra@gmail.com>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [RFC][PATCH 0/5] kbuild changes, thin archives, --gc-sections
Date: Fri, 5 Aug 2016 23:32:52 +1000	[thread overview]
Message-ID: <20160805233252.50cb8cce@roar.ozlabs.ibm.com> (raw)
In-Reply-To: <1470399123-8455-1-git-send-email-npiggin@gmail.com>

On Fri,  5 Aug 2016 22:11:58 +1000
Nicholas Piggin <npiggin@gmail.com> wrote:

> Hello,
> 
> I have 3 different things in this patchset. All arch specific, but all
> involve kbuild changes, so I'd like to discuss them with kbuild
> maintainers. The goal has been to improve long standing linking
> difficulties with the powerpc kernel.

Here's a 30 second hack of an x86 patch. It seems to build and
boot defconfig in a really quick kvm test.

For x86-64 machine building x86 target, defconfig,

make -j8 vmlinux time:
              orig      thinarc   thinarc+dce
real     4m58.865s    4m59.747s     5m20.028s
user    15m14.428s   15m13.868s    15m17.012s
sys      0m57.296s    0m55.904s     0m58.416s

build output directory size:
              orig      thinarc   thinarc+dce
              317M         257M          285M

vmlinux size:
    text     data      bss       dec   filename
10192338  4360136  1105920  15658394   vmlinux
10186739  4356040  1105920  15648699   vmlinux.thinarc
 9580486  3759880  1011712  14352078   vmlinux.thinarc+dce

Thanks,
Nick


diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 0a7b885..845069e 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -51,6 +51,8 @@ config X86
 	select ARCH_WANT_IPC_PARSE_VERSION	if X86_32
 	select ARCH_WANT_OPTIONAL_GPIOLIB
 	select BUILDTIME_EXTABLE_SORT
+	select THIN_ARCHIVES
+	select LINKER_DCE
 	select CLKEVT_I8253
 	select CLKSRC_I8253			if X86_32
 	select CLOCKSOURCE_VALIDATE_LAST_CYCLE
diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
index 9297a00..7395dd8 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -92,7 +92,7 @@ SECTIONS
 	.text :  AT(ADDR(.text) - LOAD_OFFSET) {
 		_text = .;
 		/* bootstrapping code */
-		HEAD_TEXT
+		KEEP(HEAD_TEXT)
 		. = ALIGN(8);
 		_stext = .;
 		TEXT_TEXT
@@ -321,7 +321,7 @@ SECTIONS
 	.bss : AT(ADDR(.bss) - LOAD_OFFSET) {
 		__bss_start = .;
 		*(.bss..page_aligned)
-		*(.bss)
+		*(.bss .bss.*)
 		. = ALIGN(PAGE_SIZE);
 		__bss_stop = .;
 	}

  parent reply	other threads:[~2016-08-05 13:48 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-05 12:11 [RFC][PATCH 0/5] kbuild changes, thin archives, --gc-sections Nicholas Piggin
2016-08-05 12:11 ` [PATCH 1/5] kbuild: allow architectures to use thin archives instead of ld -r Nicholas Piggin
2016-08-06  3:50   ` kbuild test robot
2016-08-06  3:50     ` kbuild test robot
2016-08-06  3:50     ` kbuild test robot
2016-08-06 20:10   ` Sam Ravnborg
2016-08-07  1:49     ` Stephen Rothwell
2016-08-07  3:34       ` Alan Modra
2016-08-07  4:17       ` Nicolas Pitre
2016-08-07 14:40       ` Sam Ravnborg
2016-08-08  3:19         ` Nicholas Piggin
2016-08-08  4:46           ` Sam Ravnborg
2016-08-08  3:25     ` Nicholas Piggin
2016-08-08  9:18       ` Arnd Bergmann
2016-08-05 12:12 ` [PATCH 2/5] kbuild: allow archs to select build for link dead code/data elimination Nicholas Piggin
2016-08-06 20:14   ` Sam Ravnborg
2016-08-08  3:29     ` Nicholas Piggin
2016-08-08  4:49       ` Sam Ravnborg
2016-08-07  5:33   ` Nicolas Pitre
2016-08-08  3:42     ` Nicholas Piggin
2016-08-08  4:12       ` Nicolas Pitre
2016-08-08  4:27         ` Nicholas Piggin
2016-08-07  9:57   ` Alan Modra
2016-08-07 11:35     ` Andreas Schwab
2016-08-07 20:26     ` Arnd Bergmann
2016-08-07 23:49       ` Alan Modra
2016-08-08 15:14         ` Arnd Bergmann
2016-08-08 23:50           ` Alan Modra
2016-08-09 22:10             ` Arnd Bergmann
2016-08-09  3:16           ` Andi Kleen
2016-08-09 22:29             ` Arnd Bergmann
2016-08-09 23:08               ` Andi Kleen
2016-08-10  0:37               ` Andi Kleen
2016-08-05 12:12 ` [PATCH 3/5] kbuild: add arch specific post-module-link pass Nicholas Piggin
2016-08-05 13:56   ` Nicholas Piggin
2016-08-06 20:16   ` Sam Ravnborg
2016-08-08  3:30     ` Nicholas Piggin
2016-08-05 12:12 ` [PATCH 4/5] powerpc: switch to using thin archives Nicholas Piggin
2016-08-05 12:12 ` [PATCH 5/5] powerpc/64: use linker dce Nicholas Piggin
2016-08-05 13:32 ` Nicholas Piggin [this message]
2016-08-05 13:32   ` [RFC][PATCH 0/5] kbuild changes, thin archives, --gc-sections Nicholas Piggin
2016-08-07 20:23 ` Arnd Bergmann
2016-08-08  3:53   ` Nicholas Piggin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160805233252.50cb8cce@roar.ozlabs.ibm.com \
    --to=npiggin@gmail.com \
    --cc=amodra@gmail.com \
    --cc=arnd@arndb.de \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=nico@linaro.org \
    --cc=segher@kernel.crashing.org \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.