diff mbox series

[1/5] linux: split calling "all" and "$(LINUX_TARGET_NAME)" targets

Message ID 20190422200830.2831-2-thomas.petazzoni@bootlin.com
State Accepted
Headers show
Series Fix fallouts from LINUX_BUILD_CMDS simplification | expand

Commit Message

Thomas Petazzoni April 22, 2019, 8:08 p.m. UTC
In commit ffbe46a5295ce4e0442728f2ad3e19afa7eaa8ed ("linux: simplify
LINUX_BUILD_CMDS"), we changed LINUX_BUILD_CMDS to essentially do:

  make all $(LINUX_TARGET_NAME)

Unfortunately, it turns out that it breaks the build of a number of
defconfigs, with errors such as:

  fixdep: error opening file: arch/xtensa/boot/lib/.inftrees.o.d: No such file or directory

Calling "all" and "$(LINUX_TARGET_NAME)" as separate make invocations
avoids this problem, and fixes the build of several defconfigs.

Fixes:

  ts7680_defconfig
  https://gitlab.com/buildroot.org/buildroot/-/jobs/199339583

  qemu_xtensa_lx60_defconfig
  https://gitlab.com/buildroot.org/buildroot/-/jobs/199339553

  roseapplepi_defconfig
  https://gitlab.com/buildroot.org/buildroot/-/jobs/199339564

  qemu_xtensa_lx60_nommu_defconfig
  https://gitlab.com/buildroot.org/buildroot/-/jobs/199339554

  qemu_ppc64_e5500_defconfig
  https://gitlab.com/buildroot.org/buildroot/-/jobs/199339539

  freescale_t2080_qds_rdb_defconfig
  https://gitlab.com/buildroot.org/buildroot/-/jobs/199339455

  arcturus_ucp1020_defconfig
  https://gitlab.com/buildroot.org/buildroot/-/jobs/199339399

Cc: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 linux/linux.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Yann E. MORIN April 22, 2019, 8:30 p.m. UTC | #1
Thomas, All,

On 2019-04-22 22:08 +0200, Thomas Petazzoni spake thusly:
> In commit ffbe46a5295ce4e0442728f2ad3e19afa7eaa8ed ("linux: simplify
> LINUX_BUILD_CMDS"), we changed LINUX_BUILD_CMDS to essentially do:
> 
>   make all $(LINUX_TARGET_NAME)
> 
> Unfortunately, it turns out that it breaks the build of a number of
> defconfigs, with errors such as:
> 
>   fixdep: error opening file: arch/xtensa/boot/lib/.inftrees.o.d: No such file or directory
> 
> Calling "all" and "$(LINUX_TARGET_NAME)" as separate make invocations
> avoids this problem, and fixes the build of several defconfigs.
[--SNIP--]
> diff --git a/linux/linux.mk b/linux/linux.mk
> index 1eac3287ab..dca3d63cd9 100644
> --- a/linux/linux.mk
> +++ b/linux/linux.mk
> @@ -444,7 +444,8 @@ 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) all $(LINUX_TARGET_NAME)
> +	$(LINUX_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) all

Usually, it is not necessary to specify the 'all' target, as this is the
default. So, I would just drop it.

I don't have a striong feeling either way, though, and I can see value
in aving an explicit 'all' call.

However, What I'd like to see added is a comment that states we can't
have a single call:

    # Having 'all' and '$(LINUX_TARGET_NAME)' in the same call is not parallel-safe

(so that we do not try to "simplify" it back in the future.)

Otherwise:

    Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

> +	$(LINUX_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) $(LINUX_TARGET_NAME)
>  	$(LINUX_BUILD_DTB)
>  	$(LINUX_APPEND_DTB)
>  endef
> -- 
> 2.20.1
>
Peter Korsgaard April 26, 2019, 1:01 p.m. UTC | #2
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@bootlin.com> writes:

 > In commit ffbe46a5295ce4e0442728f2ad3e19afa7eaa8ed ("linux: simplify
 > LINUX_BUILD_CMDS"), we changed LINUX_BUILD_CMDS to essentially do:

 >   make all $(LINUX_TARGET_NAME)

 > Unfortunately, it turns out that it breaks the build of a number of
 > defconfigs, with errors such as:

 >   fixdep: error opening file: arch/xtensa/boot/lib/.inftrees.o.d: No such file or directory

 > Calling "all" and "$(LINUX_TARGET_NAME)" as separate make invocations
 > avoids this problem, and fixes the build of several defconfigs.

 > Fixes:

 >   ts7680_defconfig
 >   https://gitlab.com/buildroot.org/buildroot/-/jobs/199339583

 >   qemu_xtensa_lx60_defconfig
 >   https://gitlab.com/buildroot.org/buildroot/-/jobs/199339553

 >   roseapplepi_defconfig
 >   https://gitlab.com/buildroot.org/buildroot/-/jobs/199339564

 >   qemu_xtensa_lx60_nommu_defconfig
 >   https://gitlab.com/buildroot.org/buildroot/-/jobs/199339554

 >   qemu_ppc64_e5500_defconfig
 >   https://gitlab.com/buildroot.org/buildroot/-/jobs/199339539

 >   freescale_t2080_qds_rdb_defconfig
 >   https://gitlab.com/buildroot.org/buildroot/-/jobs/199339455

 >   arcturus_ucp1020_defconfig
 >   https://gitlab.com/buildroot.org/buildroot/-/jobs/199339399

 > Cc: "Yann E. MORIN" <yann.morin.1998@free.fr>
 > Cc: Peter Korsgaard <peter@korsgaard.com>
 > Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
 > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Committed to 2019.02.x, thanks.
diff mbox series

Patch

diff --git a/linux/linux.mk b/linux/linux.mk
index 1eac3287ab..dca3d63cd9 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -444,7 +444,8 @@  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) all $(LINUX_TARGET_NAME)
+	$(LINUX_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) all
+	$(LINUX_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) $(LINUX_TARGET_NAME)
 	$(LINUX_BUILD_DTB)
 	$(LINUX_APPEND_DTB)
 endef