linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Nicholas Piggin <npiggin@gmail.com>
Cc: linuxppc-dev@lists.ozlabs.org,
	Segher Boessenkool <segher@kernel.crashing.org>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Luis R. Rodriguez" <mcgrof@kernel.org>,
	linux-next@vger.kernel.org, Paul Mackerras <paulus@samba.org>,
	Fengguang Wu <fengguang.wu@intel.com>,
	Guenter Roeck <linux@roeck-us.net>, Alan Modra <amodra@gmail.com>
Subject: [TESTING] kbuild: link drivers subdirectories separately
Date: Thu, 11 Aug 2016 15:49:03 +0200	[thread overview]
Message-ID: <10934898.zRVpW5bs5f@wuerfel> (raw)
In-Reply-To: <20160811231240.4ba73123@roar.ozlabs.ibm.com>

On ARM, relative branches between functions can not span more than 32MB,
which limits the size of an ELF section. In the final link, the linker
will introduce trampolines that perform long calls to avoid the limit,
and during a recursive link, trampolines are added within the section.

However, this does not work for cross-section branches when the source
section is already larger than 32MB because there is no longer space
to put the trampoline.

We are unable to build an allyesconfig kernel on ARM because the
.text section in drivers/built-in.o has that problem.

This patch avoids it by linking drivers/*/built-in.o directly into
vmlinux.o, rather than first linking them into drivers/built-in.o.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
This patch gets allyesconfig to work for me on ARM. We have previously
decided that this is too ugly, but you can use it for comparing the
link times.

diff --git a/Makefile b/Makefile
index 2eae4bab0d9b..091ca3a3015b 100644
--- a/Makefile
+++ b/Makefile
@@ -557,13 +557,6 @@ scripts: scripts_basic include/config/auto.conf include/config/tristate.conf \
 	 asm-generic gcc-plugins
 	$(Q)$(MAKE) $(build)=$(@)
 
-# Objects we will link into vmlinux / subdirs we need to visit
-init-y		:= init/
-drivers-y	:= drivers/ sound/ firmware/
-net-y		:= net/
-libs-y		:= lib/
-core-y		:= usr/
-virt-y		:= virt/
 endif # KBUILD_EXTMOD
 
 ifeq ($(dot-config),1)
@@ -584,6 +577,20 @@ $(KCONFIG_CONFIG) include/config/auto.conf.cmd: ;
 # we execute the config step to be sure to catch updated Kconfig files
 include/config/%.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd
 	$(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig
+
+# Objects we will link into vmlinux / subdirs we need to visit
+init-y		:= init/
+net-y		:= net/
+libs-y		:= lib/
+core-y		:= usr/
+virt-y		:= virt/
+
+# split out objects from drivers to avoid recursively linking large .o files
+include drivers/Makefile
+drivers-y	:= $(addprefix drivers/,$(obj-y) $(obj-m))
+drivers-y	+= sound/ firmware/
+obj-y		:=
+
 else
 # external modules needs include/generated/autoconf.h and include/config/auto.conf
 # but do not care if they are up-to-date. Use auto.conf to trigger the test
diff --git a/drivers/Makefile b/drivers/Makefile
index 9cfa547d67ce..38848742db1f 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -95,10 +95,7 @@ obj-$(CONFIG_ATA_OVER_ETH)	+= block/aoe/
 obj-$(CONFIG_PARIDE) 		+= block/paride/
 obj-$(CONFIG_TC)		+= tc/
 obj-$(CONFIG_UWB)		+= uwb/
-obj-$(CONFIG_USB_PHY)		+= usb/
-obj-$(CONFIG_USB)		+= usb/
-obj-$(CONFIG_PCI)		+= usb/
-obj-$(CONFIG_USB_GADGET)	+= usb/
+obj-y				+= usb/
 obj-$(CONFIG_SERIO)		+= input/serio/
 obj-$(CONFIG_GAMEPORT)		+= input/gameport/
 obj-$(CONFIG_INPUT)		+= input/
@@ -137,7 +134,8 @@ obj-$(CONFIG_PPC_PS3)		+= ps3/
 obj-$(CONFIG_OF)		+= of/
 obj-$(CONFIG_SSB)		+= ssb/
 obj-$(CONFIG_BCMA)		+= bcma/
-obj-y				+= vhost/
+obj-$(CONFIG_VHOST_RING)	+= vhost/
+obj-$(CONFIG_VHOST)		+= vhost/
 obj-$(CONFIG_VLYNQ)		+= vlynq/
 obj-$(CONFIG_STAGING)		+= staging/
 obj-y				+= platform/

  reply	other threads:[~2016-08-11 13:50 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-02 20:07 powerpc allyesconfig / allmodconfig linux-next next-20160729 - next-20160729 build failures Luis R. Rodriguez
2016-08-02 21:58 ` Guenter Roeck
2016-08-02 22:02   ` Luis R. Rodriguez
2016-08-02 22:34     ` Arnd Bergmann
2016-08-03  0:23     ` Stephen Rothwell
2016-08-03  7:52       ` Arnd Bergmann
2016-08-03 12:19         ` Stephen Rothwell
2016-08-03 12:29           ` Arnd Bergmann
2016-08-03 15:37             ` Nicholas Piggin
2016-08-03 18:52               ` Arnd Bergmann
2016-08-03 19:44                 ` Segher Boessenkool
2016-08-03 20:13                   ` Arnd Bergmann
2016-08-11 12:43                     ` Nicholas Piggin
2016-08-11 13:04                       ` Arnd Bergmann
2016-08-11 13:12                         ` Nicholas Piggin
2016-08-11 13:49                           ` Arnd Bergmann [this message]
2016-08-11 15:46                             ` [TESTING] kbuild: link drivers subdirectories separately Arnd Bergmann
2016-08-04  0:10                 ` powerpc allyesconfig / allmodconfig linux-next next-20160729 - next-20160729 build failures Stephen Rothwell
2016-08-04  9:00                   ` Arnd Bergmann
2016-08-04 10:37                     ` Arnd Bergmann
2016-08-04 11:47                       ` Nicholas Piggin
2016-08-04 12:09                         ` Arnd Bergmann
2016-08-04 12:31                           ` Nicholas Piggin
2016-08-04 13:54                             ` Nicholas Piggin
2016-08-04 15:43                               ` Arnd Bergmann
2016-08-04 16:10                         ` Arnd Bergmann
2016-08-04 17:06                           ` Segher Boessenkool
2016-08-05  8:41                             ` Nicholas Piggin
2016-08-05 10:17                               ` Arnd Bergmann
2016-08-05 12:26                                 ` Nicholas Piggin
2016-08-05 16:01                                   ` Arnd Bergmann
2016-08-05 16:16                                     ` Nicholas Piggin
2016-08-05 19:16                                       ` Arnd Bergmann
2016-08-06  4:17                                         ` Nicholas Piggin
2016-08-06 21:13                                           ` Arnd Bergmann
2016-08-03  2:46 ` Michael Ellerman

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=10934898.zRVpW5bs5f@wuerfel \
    --to=arnd@arndb.de \
    --cc=amodra@gmail.com \
    --cc=fengguang.wu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mcgrof@kernel.org \
    --cc=npiggin@gmail.com \
    --cc=paulus@samba.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).