Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] linux: simplify LINUX_BUILD_CMDS
Date: Mon, 8 Apr 2019 22:48:32 +0200	[thread overview]
Message-ID: <20190408204832.GD23890@scaer> (raw)
In-Reply-To: <20190408202136.22944-1-thomas.petazzoni@bootlin.com>

On 2019-04-08 22:21 +0200, Thomas Petazzoni spake thusly:
> 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>

While we are at simplifying: do we still need to specify imagename?

Isn't the image name either:
  - implicit for the architecture, or
  - specified as a config option in the linux configuration?

> The "all" target automatically depends on "modules", 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 built 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>

Regards,
Yann E. MORIN.

> ---
>  linux/linux.mk | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/linux/linux.mk b/linux/linux.mk
> index c7081db88f..46645f4780 100644
> --- a/linux/linux.mk
> +++ b/linux/linux.mk
> @@ -438,10 +438,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
> -- 
> 2.20.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

  reply	other threads:[~2019-04-08 20:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-08 20:21 [Buildroot] [PATCH] linux: simplify LINUX_BUILD_CMDS Thomas Petazzoni
2019-04-08 20:48 ` Yann E. MORIN [this message]
2019-04-08 20:56   ` Thomas Petazzoni
2019-04-08 20:58   ` Peter Korsgaard
2019-04-13 15:18 ` Arnout Vandecappelle
2019-04-24 20:05 ` Peter Korsgaard

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=20190408204832.GD23890@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /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