From: Andrew F. Davis <hidden> Date: 2017-03-15 17:55:42
Hello all,
I was building a kernel for x86 and noticed Make still descended into
directories like drivers/gpu/drm/hisilicon, this seems kind of odd given
nothing will be built here. It looks to be due to some directories being
included in obj-y unconditionally instead of only when the relevant
CONFIG_ is set.
These patches are split by subsystem in-case, for some reason, a file in
a directory does need to be built, I believe I have checked for all
instances of this, but a quick review from some maintainers would be nice.
Thanks,
Andrew
Changes from v2:
- Removed patches that would not work
- Rebased on v4.11-rc1 (no changes needed)
Changes from v1:
- Removed patches already taken by maintainers
- Rebased on v4.10-rc1 (no changes needed)
Andrew F. Davis (7):
pwm: Only descend into pwm directory when CONFIG_PWM is set
amba: Only descend into amba directory when CONFIG_ARM_AMBA is set
NFC: Only descend into nfc directory when CONFIG_NFC is set
macintosh: Only descend into directory when CONFIG_MACINTOSH_DRIVERS
is set
auxdisplay: Only descend into directory when CONFIG_AUXDISPLAY is set
lguest: Only descend into lguest directory when CONFIG_LGUEST is set
mmc: Only descend into mmc directory when CONFIG_MMC is set
drivers/Makefile | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
--
2.11.0
From: Andrew F. Davis <hidden> Date: 2017-03-15 16:59:16
When CONFIG_AUXDISPLAY is not set make will still descend into the
auxdisplay directory but nothing will be built. This produces unneeded
build artifacts and messages in addition to slowing the build.
Fix this here.
Signed-off-by: Andrew F. Davis <redacted>
---
drivers/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Andrew F. Davis <hidden> Date: 2017-03-15 16:59:18
When CONFIG_PWM is not set make will still descend into the pwm
directory but nothing will be built. This produces unneeded build
artifacts and messages in addition to slowing the build. Fix this here.
Signed-off-by: Andrew F. Davis <redacted>
---
drivers/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -13,7 +13,7 @@ obj-$(CONFIG_GENERIC_PHY) += phy/# GPIO must come after pinctrl as gpios may need to mux pins etcobj-$(CONFIG_PINCTRL)+=pinctrl/obj-$(CONFIG_GPIOLIB)+=gpio/-obj-y+=pwm/+obj-$(CONFIG_PWM)+=pwm/obj-$(CONFIG_PCI)+=pci/# PCI dwc controller driversobj-y+=pci/dwc/
From: Andrew F. Davis <hidden> Date: 2017-03-15 16:59:19
When CONFIG_ARM_AMBA is not set make will still descend into the amba
directory but nothing will be built. This produces unneeded build
artifacts and messages in addition to slowing the build. Fix this here.
Signed-off-by: Andrew F. Davis <redacted>
---
drivers/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -31,7 +31,7 @@ obj-$(CONFIG_SFI) += sfi/# PnP must come after ACPI since it will eventually need to check if acpi# was used and do nothing if soobj-$(CONFIG_PNP)+=pnp/-obj-y+=amba/+obj-$(CONFIG_ARM_AMBA)+=amba/obj-y+=clk/# Many drivers will want to use DMA so this has to be made available
From: Andrew F. Davis <hidden> Date: 2017-03-15 16:59:21
When CONFIG_NFC is not set make will still descend into the nfc
directory but nothing will be built. This produces unneeded build
artifacts and messages in addition to slowing the build. Fix this here.
Signed-off-by: Andrew F. Davis <redacted>
---
drivers/Makefile | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
From: Andrew F. Davis <hidden> Date: 2017-03-15 17:55:41
When CONFIG_MMC is not set make will still descend into the mmc
directory but nothing will be built. This produces unneeded build
artifacts and messages in addition to slowing the build. Fix this here.
Signed-off-by: Andrew F. Davis <redacted>
---
drivers/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Andrew F. Davis <hidden> Date: 2017-03-15 18:06:03
When CONFIG_LGUEST is not set make will still descend into the lguest
directory but nothing will be built. This produces unneeded build
artifacts and messages in addition to slowing the build. Fix this here.
Signed-off-by: Andrew F. Davis <redacted>
---
drivers/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Andrew F. Davis <hidden> Date: 2017-03-15 18:06:05
When CONFIG_MACINTOSH_DRIVERS is not set make will still descend into the
macintosh directory but nothing will be built. This produces unneeded
build artifacts and messages in addition to slowing the build.
Fix this here.
Signed-off-by: Andrew F. Davis <redacted>
---
drivers/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
On Wed, Mar 15, 2017 at 5:37 PM, Andrew F. Davis [off-list ref] wrote:
Hello all,
I was building a kernel for x86 and noticed Make still descended into
directories like drivers/gpu/drm/hisilicon, this seems kind of odd given
nothing will be built here. It looks to be due to some directories being
included in obj-y unconditionally instead of only when the relevant
CONFIG_ is set.
These patches are split by subsystem in-case, for some reason, a file in
a directory does need to be built, I believe I have checked for all
instances of this, but a quick review from some maintainers would be nice.
I didn't see anything wrong with the patches, and made sure that there
are no tristate symbols controlling the subdirectory for anything that
requires a built-in driver (which would cause a link failure).
I'm not sure about drivers/lguest, which has some special magic
in its Makefile, it's possible that this now fails with CONFIG_LGUEST=m.
Arnd
From: Andrew F. Davis <hidden> Date: 2017-03-15 21:16:21
On 03/15/2017 04:03 PM, Arnd Bergmann wrote:
On Wed, Mar 15, 2017 at 5:37 PM, Andrew F. Davis [off-list ref] wrote:
quoted
Hello all,
I was building a kernel for x86 and noticed Make still descended into
directories like drivers/gpu/drm/hisilicon, this seems kind of odd given
nothing will be built here. It looks to be due to some directories being
included in obj-y unconditionally instead of only when the relevant
CONFIG_ is set.
These patches are split by subsystem in-case, for some reason, a file in
a directory does need to be built, I believe I have checked for all
instances of this, but a quick review from some maintainers would be nice.
I didn't see anything wrong with the patches, and made sure that there
are no tristate symbols controlling the subdirectory for anything that
requires a built-in driver (which would cause a link failure).
I'm not sure about drivers/lguest, which has some special magic
in its Makefile, it's possible that this now fails with CONFIG_LGUEST=m.
lguest and mmc are the strange ones, so I put them last in the series in
case they did need to be dropped.
lguest was supposed to have been taken from v1:
https://lkml.org/lkml/2016/6/20/1086
but it looks like it didn't so I re-introduced it for v3.
mmc caught some 0-day build warnings but I never got to the bottom of them.
Anyway, I have no problem with these two being held back until the magic
in their Makefile is sorted out.
Thanks,
Andrew
On Wed, Mar 15, 2017 at 10:15 PM, Andrew F. Davis [off-list ref] wrote:
On 03/15/2017 04:03 PM, Arnd Bergmann wrote:
quoted
On Wed, Mar 15, 2017 at 5:37 PM, Andrew F. Davis [off-list ref] wrote:
quoted
Hello all,
I was building a kernel for x86 and noticed Make still descended into
directories like drivers/gpu/drm/hisilicon, this seems kind of odd given
nothing will be built here. It looks to be due to some directories being
included in obj-y unconditionally instead of only when the relevant
CONFIG_ is set.
These patches are split by subsystem in-case, for some reason, a file in
a directory does need to be built, I believe I have checked for all
instances of this, but a quick review from some maintainers would be nice.
I didn't see anything wrong with the patches, and made sure that there
are no tristate symbols controlling the subdirectory for anything that
requires a built-in driver (which would cause a link failure).
I'm not sure about drivers/lguest, which has some special magic
in its Makefile, it's possible that this now fails with CONFIG_LGUEST=m.
lguest and mmc are the strange ones, so I put them last in the series in
case they did need to be dropped.
lguest was supposed to have been taken from v1:
https://lkml.org/lkml/2016/6/20/1086
but it looks like it didn't so I re-introduced it for v3.
mmc caught some 0-day build warnings but I never got to the bottom of them.
Ah, I see now what happened to mmc:
obj-$(subst m,y,$(CONFIG_MMC)) += host/
tmio_mmc_core-$(subst m,y,$(CONFIG_MMC_SDHI)) += tmio_mmc_dma.o
obj-$(subst m,y,$(CONFIG_MMC_SDHCI_PCI)) += sdhci-pci-data.o
with CONFIG_MMC=m, this will fail to build the built-in files in
drivers/mmc/host. I suppose this could be expressed in a different
way these days, but dropping the patch would be easier.
Arnd
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2017-03-16 04:39:05
"Andrew F. Davis" [off-list ref] writes:
When CONFIG_MACINTOSH_DRIVERS is not set make will still descend into the
macintosh directory but nothing will be built. This produces unneeded
build artifacts and messages in addition to slowing the build.
Fix this here.
Signed-off-by: Andrew F. Davis <redacted>
---
drivers/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
LGTM.
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
cheersj
From: kbuild test robot <hidden> Date: 2017-03-18 01:07:44
Hi Andrew,
[auto build test ERROR on linus/master]
[also build test ERROR on v4.11-rc2 next-20170310]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Andrew-F-Davis/Remove-unneeded-build-directory-traversals/20170318-040719
config: x86_64-rhel (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
All errors (new ones prefixed by >>):
From: kbuild test robot <hidden> Date: 2017-03-18 02:17:55
Hi Andrew,
[auto build test ERROR on linus/master]
[also build test ERROR on v4.11-rc2 next-20170310]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Andrew-F-Davis/Remove-unneeded-build-directory-traversals/20170318-040719
config: x86_64-allmodconfig (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
All errors (new ones prefixed by >>):
arch/x86/built-in.o: In function `mrfld_sd_init':
quoted
platform_mrfld_sd.c:(.init.text+0x397d5): undefined reference to `sdhci_pci_get_data'
platform_mrfld_sd.c:(.init.text+0x397e3): undefined reference to `sdhci_pci_get_data'
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation