aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Thomas Petazzoni <thomas.petazzoni@bootlin.com>2019-04-08 22:21:35 +0200
committerGravatar Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>2019-04-13 17:15:19 +0200
commitffbe46a5295ce4e0442728f2ad3e19afa7eaa8ed (patch)
treef7c8aa7f136c2e198fa4ef98bf9a902afb05aa44
parent615e2edc2ae8351519448d1965f0c4eec4e793b1 (diff)
downloadbuildroot-ffbe46a5295ce4e0442728f2ad3e19afa7eaa8ed.tar.gz
buildroot-ffbe46a5295ce4e0442728f2ad3e19afa7eaa8ed.tar.bz2
linux: simplify LINUX_BUILD_CMDS
We currently do the Linux build as follows: make <imagename> if modules enabled; make modules; fi However, Clement Léger recently reported that due to us not using the "all" target, the GDB scripts that the kernel can build when CONFIG_GDB_SCRIPTS is enabled are not built, since upstream kernel commit 67274c083438340ad16c1437caebc84e1253b224 (merged in v5.1) moved that logic to a separate scripts_gdb target, which is a dependency of the "all" target. While we could add some more logic to explicit generate the "scripts_gdb" target, this logic would fail on Linux < 5.1 for which this make target doesn't exist. So instead, let's simplify the build logic, and use: make all <imagename> The "all" target automatically depends on "modules" if CONFIG_MODULES is set, so we no longer need to explicit generate the "modules" target separately. As a result of this change, we may generate additional kernel images compared to what was done previously, but such images would anyway not be installed, and the additional build time is minimal. We did some research as to why the kernel build was done like this in Buildroot, and it's been like that since linux/linux.mk was added back in 2010 by commit 487e21cff69b30b404146b2ffb46959a728a4002 ("New, simpler, infrastructure for building the Linux kernel"). Reported-by: Clément Leger <cleger@kalray.eu> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Reviewed-by: Peter Korsgaard <peter@korsgaard.com> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
-rw-r--r--linux/linux.mk5
1 files changed, 1 insertions, 4 deletions
diff --git a/linux/linux.mk b/linux/linux.mk
index 304fce21d0..1eac3287ab 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -444,10 +444,7 @@ define LINUX_BUILD_CMDS
$(foreach dts,$(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH)), \
cp -f $(dts) $(LINUX_ARCH_PATH)/boot/dts/
)
- $(LINUX_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) $(LINUX_TARGET_NAME)
- @if grep -q "CONFIG_MODULES=y" $(@D)/.config; then \
- $(LINUX_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) modules ; \
- fi
+ $(LINUX_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) all $(LINUX_TARGET_NAME)
$(LINUX_BUILD_DTB)
$(LINUX_APPEND_DTB)
endef