Fix pkg-kconfig packages with ccache enabled
cover Fix pkg-kconfig packages with ccache enabled
Hello,
This series addresses a problem that has been reported several times:
if you have BR2_CCACHE=y and run "make uboot-menuconfig" from a clean tree, it fails because U-Boot tries to build the kconfig code with ccache, but ccache has not been built yet.
To address this, we:
- Make sure to pass HOSTCC=$(HOSTCC_NOCCACHE) in the kconfig steps of kconfig packages. This has in fact no real effect, because linux and u-boot were overriding HOSTCC, and other packages were not passing HOSTCC, so plain "gcc" was used.
- Fix the U-Boot case by passing HOSTCC=$(HOSTCC_NOCCACHE)
- Make the Linux case consistent with other kconfig packages by also passing HOSTCC=$(HOSTCC_NOCCACHE)
Thanks,
Thomas
Thomas Petazzoni (3):
package/pkg-kconfig: pass HOSTCC during kconfig steps boot/uboot: use HOSTCC_NOCCACHE as kconfig HOSTCC
linux: use HOSTCC_NOCCACHE as kconfig HOSTCC
boot/uboot/uboot.mk | 5 +++-- linux/linux.mk | 17 ++++++++++------- package/pkg-kconfig.mk | 10 +++++++--- 3 files changed, 20 insertions(+), 12 deletions(-)
Signature · 1 line
2.20.1
PATCH 1/3 package/pkg-kconfig: pass HOSTCC during kconfig steps
The kconfig build logic uses the HOSTCC variable to find the host compiler. It makes sense to explicitly pass a value to this variable, pointing to the host compiler used by Buildroot.
During the kconfig step, host-ccache is not ready (host-ccache is only a dependency to the configure step of packages), so we use $(HOSTCC_NOCCACHE).
Packages currently using the kconfig-package fell into two categories:
- Those not passing any HOSTCC value. For such packages, it was the default host compiler detected by the kconfig build logic that was used. ccache was therefore never used. With this commit, those packages will now be using the host compiler detected by Buildroot. Packages in this situation: at91bootstrap3, barebox, busybox, swupdate, uclibc, xvisor.
- Those passing a HOSTCC value. Such packages were passing $(HOSTCC), which doesn't work as host-ccache will not be ready. This commit does not fix them, as they still override HOSTCC. It will be fixed in followup commits. Packages in this situation: uboot and linux. Note that linux was a bit special, because it has a KCONFIG_DEPENDENCIES on the toolchain package, so in fact host-ccache was ready.
So practically speaking, this commit does not fix anything, as the two only problematic packages that use $(HOSTCC) are not fixed. However, it makes things more correct by explicitly telling kconfig which compiler to use.
--- package/pkg-kconfig.mk | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
package/pkg-kconfig.mk +7 -3
@@ -27,6 +27,9 @@ define kconfig-package-update-config $(Q)touch --reference $($(PKG)_DIR)/$($(PKG)_KCONFIG_DOTCONFIG) $($(PKG)_KCONFIG_FILE) endef +PKG_KCONFIG_COMMON_OPTS = \ + HOSTCC=$(HOSTCC_NOCCACHE) + ################################################################################ # inner-kconfig-package -- generates the make targets needed to support a # kconfig package
@@ -79,7 +82,8 @@ $$($(2)_KCONFIG_FILE) $$($(2)_KCONFIG_FRAGMENT_FILES): | $(1)-patch done $(2)_KCONFIG_MAKE = \ - $$($(2)_MAKE_ENV) $$(MAKE) -C $$($(2)_DIR) $$($(2)_KCONFIG_OPTS) + $$($(2)_MAKE_ENV) $$(MAKE) -C $$($(2)_DIR) \ + $$(PKG_KCONFIG_COMMON_OPTS) $$($(2)_KCONFIG_OPTS) # $(2)_KCONFIG_MAKE may already rely on shell expansion. As the $() syntax # of the shell conflicts with Make's own syntax, this means that backticks
@@ -195,7 +199,7 @@ $(2)_CONFIGURATOR_MAKE_ENV = \ $$(addprefix $(1)-,$$($(2)_KCONFIG_EDITORS)): $(1)-%: $$($(2)_DIR)/.kconfig_editor_% $$($(2)_DIR)/.kconfig_editor_%: $$($(2)_DIR)/.stamp_kconfig_fixup_done $$($(2)_CONFIGURATOR_MAKE_ENV) $$(MAKE) -C $$($(2)_DIR) \ - $$($(2)_KCONFIG_OPTS) $$(*) + $$(PKG_KCONFIG_COMMON_OPTS) $$($(2)_KCONFIG_OPTS) $$(*) rm -f $$($(2)_DIR)/.stamp_{kconfig_fixup_done,configured,built} rm -f $$($(2)_DIR)/.stamp_{target,staging,images}_installed $$($(2)_FIXUP_DOT_CONFIG)
@@ -224,7 +228,7 @@ $(1)-check-configuration-done: $(1)-savedefconfig: $(1)-check-configuration-done $$($(2)_MAKE_ENV) $$(MAKE) -C $$($(2)_DIR) \ - $$($(2)_KCONFIG_OPTS) savedefconfig + $$(PKG_KCONFIG_COMMON_OPTS) $$($(2)_KCONFIG_OPTS) savedefconfig # Target to copy back the configuration to the source configuration file # Even though we could use 'cp --preserve-timestamps' here, the separate
Signature · 1 line
2.20.1
PATCH 1/3 package/pkg-kconfig: pass HOSTCC during kconfig steps
Thomas, All,
On 2019-01-10 22:14 +0100, Thomas Petazzoni spake thusly:
Quoted 25 lines
The kconfig build logic uses the HOSTCC variable to find the host compiler. It makes sense to explicitly pass a value to this variable, pointing to the host compiler used by Buildroot.
During the kconfig step, host-ccache is not ready (host-ccache is only a dependency to the configure step of packages), so we use $(HOSTCC_NOCCACHE).
Packages currently using the kconfig-package fell into two categories:
- Those not passing any HOSTCC value. For such packages, it was the default host compiler detected by the kconfig build logic that was used. ccache was therefore never used. With this commit, those packages will now be using the host compiler detected by Buildroot. Packages in this situation: at91bootstrap3, barebox, busybox, swupdate, uclibc, xvisor.
- Those passing a HOSTCC value. Such packages were passing $(HOSTCC), which doesn't work as host-ccache will not be ready. This commit does not fix them, as they still override HOSTCC. It will be fixed in followup commits. Packages in this situation: uboot and linux. Note that linux was a bit special, because it has a
KCONFIG_DEPENDENCIESon the toolchain package, so in fact host-ccache was ready.
Quoted 6 lines
So practically speaking, this commit does not fix anything, as the two only problematic packages that use $(HOSTCC) are not fixed. However, it makes things more correct by explicitly telling kconfig which compiler to use.
Signed-off-by Thomas Petazzoni <[email protected]>
Regards,
Yann E. MORIN.
Quoted 53 lines
--- package/pkg-kconfig.mk | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)package/pkg-kconfig.mk +7
-3@@ -27,6 +27,9 @@ define kconfig-package-update-config $(Q)touch --reference $($(PKG)_DIR)/$($(PKG)_KCONFIG_DOTCONFIG) $($(PKG)_KCONFIG_FILE) endef +PKG_KCONFIG_COMMON_OPTS = \ + HOSTCC=$(HOSTCC_NOCCACHE) + ################################################################################ # inner-kconfig-package -- generates the make targets needed to support a # kconfig package@@ -79,7 +82,8 @@ $$($(2)_KCONFIG_FILE) $$($(2)_KCONFIG_FRAGMENT_FILES): | $(1)-patch done $(2)_KCONFIG_MAKE = \ - $$($(2)_MAKE_ENV) $$(MAKE) -C $$($(2)_DIR) $$($(2)_KCONFIG_OPTS) + $$($(2)_MAKE_ENV) $$(MAKE) -C $$($(2)_DIR) \ + $$(PKG_KCONFIG_COMMON_OPTS) $$($(2)_KCONFIG_OPTS) # $(2)_KCONFIG_MAKE may already rely on shell expansion. As the $() syntax # of the shell conflicts with Make's own syntax, this means that backticks@@ -195,7 +199,7 @@ $(2)_CONFIGURATOR_MAKE_ENV = \ $$(addprefix $(1)-,$$($(2)_KCONFIG_EDITORS)): $(1)-%: $$($(2)_DIR)/.kconfig_editor_% $$($(2)_DIR)/.kconfig_editor_%: $$($(2)_DIR)/.stamp_kconfig_fixup_done $$($(2)_CONFIGURATOR_MAKE_ENV) $$(MAKE) -C $$($(2)_DIR) \ - $$($(2)_KCONFIG_OPTS) $$(*) + $$(PKG_KCONFIG_COMMON_OPTS) $$($(2)_KCONFIG_OPTS) $$(*) rm -f $$($(2)_DIR)/.stamp_{kconfig_fixup_done,configured,built} rm -f $$($(2)_DIR)/.stamp_{target,staging,images}_installed $$($(2)_FIXUP_DOT_CONFIG)@@ -224,7 +228,7 @@ $(1)-check-configuration-done: $(1)-savedefconfig: $(1)-check-configuration-done $$($(2)_MAKE_ENV) $$(MAKE) -C $$($(2)_DIR) \ - $$($(2)_KCONFIG_OPTS) savedefconfig + $$(PKG_KCONFIG_COMMON_OPTS) $$($(2)_KCONFIG_OPTS) savedefconfig # Target to copy back the configuration to the source configuration file # Even though we could use 'cp --preserve-timestamps' here, the separateSignature · 6 lines
2.20.1 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH 1/3 package/pkg-kconfig: pass HOSTCC during kconfig steps
In reply to Thomas PetazzoniQuoted 27 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
The kconfig build logic uses the HOSTCC variable to find the host compiler. It makes sense to explicitly pass a value to this variable, pointing to the host compiler used by Buildroot.
During the kconfig step, host-ccache is not ready (host-ccache is only a dependency to the configure step of packages), so we use $(HOSTCC_NOCCACHE).
Packages currently using the kconfig-package fell into two categories:
- Those not passing any HOSTCC value. For such packages, it was the default host compiler detected by the kconfig build logic that was used. ccache was therefore never used. With this commit, those packages will now be using the host compiler detected by Buildroot. Packages in this situation: at91bootstrap3, barebox, busybox, swupdate, uclibc, xvisor.
- Those passing a HOSTCC value. Such packages were passing $(HOSTCC), which doesn't work as host-ccache will not be ready. This commit does not fix them, as they still override HOSTCC. It will be fixed in followup commits. Packages in this situation: uboot and linux. Note that linux was a bit special, because it has a
KCONFIG_DEPENDENCIESon the toolchain package, so in fact host-ccache was ready.
Quoted 6 lines
So practically speaking, this commit does not fix anything, as the two only problematic packages that use $(HOSTCC) are not fixed. However, it makes things more correct by explicitly telling kconfig which compiler to use.
Signed-off-by Thomas Petazzoni <[email protected]>
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 1/3 package/pkg-kconfig: pass HOSTCC during kconfig steps
In reply to Thomas PetazzoniQuoted 27 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
The kconfig build logic uses the HOSTCC variable to find the host compiler. It makes sense to explicitly pass a value to this variable, pointing to the host compiler used by Buildroot.
During the kconfig step, host-ccache is not ready (host-ccache is only a dependency to the configure step of packages), so we use $(HOSTCC_NOCCACHE).
Packages currently using the kconfig-package fell into two categories:
- Those not passing any HOSTCC value. For such packages, it was the default host compiler detected by the kconfig build logic that was used. ccache was therefore never used. With this commit, those packages will now be using the host compiler detected by Buildroot. Packages in this situation: at91bootstrap3, barebox, busybox, swupdate, uclibc, xvisor.
- Those passing a HOSTCC value. Such packages were passing $(HOSTCC), which doesn't work as host-ccache will not be ready. This commit does not fix them, as they still override HOSTCC. It will be fixed in followup commits. Packages in this situation: uboot and linux. Note that linux was a bit special, because it has a
KCONFIG_DEPENDENCIESon the toolchain package, so in fact host-ccache was ready.
Quoted 6 lines
So practically speaking, this commit does not fix anything, as the two only problematic packages that use $(HOSTCC) are not fixed. However, it makes things more correct by explicitly telling kconfig which compiler to use.
Signed-off-by Thomas Petazzoni <[email protected]>
Committed to 2018.11.x, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 2/3 boot/uboot: use HOSTCC_NOCCACHE as kconfig HOSTCC
In reply to Thomas PetazzoniAt kconfig time, dependencies are not built, and therefore host-ccache is not ready. Due to this, using $(HOSTCC) as the host compiler in KCONFIG_OPTS does not work: a "make uboot-menuconfig" invocation from a clean tree with ccache enabled fails.
This commit fixes this by using $(HOSTCC_NOCCACHE). We cannot rely on the default value of HOSTCC passed by the kconfig-package infrastructure, because $(UBOOT_MAKE_OPTS) also contains a HOSTCC definition that would override the one passed by the kconfig-package infrastructure.
--- boot/uboot/uboot.mk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
boot/uboot/uboot.mk +3 -2
@@ -227,8 +227,9 @@ UBOOT_KCONFIG_EDITORS = menuconfig xconfig gconfig nconfig # (which is typically wchar) but link with # $(HOST_DIR)/lib/libncurses.so (which is not). We don't actually # need any host-package for kconfig, so remove the HOSTCC/HOSTLDFLAGS -# override again. -UBOOT_KCONFIG_OPTS = $(UBOOT_MAKE_OPTS) HOSTCC="$(HOSTCC)" HOSTLDFLAGS="" +# override again. In addition, host-ccache is not ready at kconfig +# time, so use HOSTCC_NOCCACHE. +UBOOT_KCONFIG_OPTS = $(UBOOT_MAKE_OPTS) HOSTCC="$(HOSTCC_NOCCACHE)" HOSTLDFLAGS="" define UBOOT_HELP_CMDS @echo ' uboot-menuconfig - Run U-Boot menuconfig' @echo ' uboot-savedefconfig - Run U-Boot savedefconfig'
Signature · 1 line
2.20.1
PATCH 2/3 boot/uboot: use HOSTCC_NOCCACHE as kconfig HOSTCC
Thomas, All,
On 2019-01-10 22:14 +0100, Thomas Petazzoni spake thusly:
Quoted 21 lines
At kconfig time, dependencies are not built, and therefore host-ccache is not ready. Due to this, using $(HOSTCC) as the host compiler in
KCONFIG_OPTSdoes not work: a "make uboot-menuconfig" invocation from a clean tree with ccache enabled fails.This commit fixes this by using $(HOSTCC_NOCCACHE). We cannot rely on the default value of HOSTCC passed by the kconfig-package infrastructure, because $(UBOOT_MAKE_OPTS) also contains a HOSTCC definition that would override the one passed by the kconfig-package infrastructure.
Signed-off-by Thomas Petazzoni <[email protected]>--- boot/uboot/uboot.mk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)boot/uboot/uboot.mk +0
-0
boot/uboot/uboot.mk UBOOT_KCONFIG_EDITORS = menuconfig xconfig gconfig nconfig · line 232
Quoted 8 lines
boot/uboot/uboot.mk +3
-2@@ -227,8 +227,9 @@ UBOOT_KCONFIG_EDITORS = menuconfig xconfig gconfig nconfig # (which is typically wchar) but link with # $(HOST_DIR)/lib/libncurses.so (which is not). We don't actually # need any host-package for kconfig, so remove the HOSTCC/HOSTLDFLAGS -# override again. -UBOOT_KCONFIG_OPTS = $(UBOOT_MAKE_OPTS) HOSTCC="$(HOSTCC)" HOSTLDFLAGS="" +# override again. In addition, host-ccache is not ready at kconfig +# time, so use HOSTCC_NOCCACHE. +UBOOT_KCONFIG_OPTS = $(UBOOT_MAKE_OPTS) HOSTCC="$(HOSTCC_NOCCACHE)" HOSTLDFLAGS=""
Since you're just switching over to the no-ccache variant:
However, I wonder if we would not be better off if we had written something like;
UBOOT_KCONFIG_OPTS = $(filter-out HOSTCC=% HOSTLDFLAGS=%, $(UBOOT_MAKE_OPTS))
But this is another story. ;-)
Regards,
Yann E. MORIN.
Quoted 10 lines
boot/uboot/uboot.mk +0
-0define UBOOT_HELP_CMDS @echo ' uboot-menuconfig - Run U-Boot menuconfig' @echo ' uboot-savedefconfig - Run U-Boot savedefconfig'Signature · 6 lines
2.20.1 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH 2/3 boot/uboot: use HOSTCC_NOCCACHE as kconfig HOSTCC
Thomas, All,
On 2019-01-13 22:47 +0100, Yann E. MORIN spake thusly:
Quoted 33 lines
On 2019-01-10 22:14 +0100, Thomas Petazzoni spake thusly:
Quoted 21 lines
At kconfig time, dependencies are not built, and therefore host-ccache is not ready. Due to this, using $(HOSTCC) as the host compiler in
KCONFIG_OPTSdoes not work: a "make uboot-menuconfig" invocation from a clean tree with ccache enabled fails.This commit fixes this by using $(HOSTCC_NOCCACHE). We cannot rely on the default value of HOSTCC passed by the kconfig-package infrastructure, because $(UBOOT_MAKE_OPTS) also contains a HOSTCC definition that would override the one passed by the kconfig-package infrastructure.
Signed-off-by Thomas Petazzoni <[email protected]>--- boot/uboot/uboot.mk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)boot/uboot/uboot.mk +0
-0boot/uboot/uboot.mk UBOOT_KCONFIG_EDITORS = menuconfig xconfig gconfig nconfig · line 232
Quoted 8 lines
boot/uboot/uboot.mk +3
-2@@ -227,8 +227,9 @@ UBOOT_KCONFIG_EDITORS = menuconfig xconfig gconfig nconfig # (which is typically wchar) but link with # $(HOST_DIR)/lib/libncurses.so (which is not). We don't actually # need any host-package for kconfig, so remove the HOSTCC/HOSTLDFLAGS -# override again. -UBOOT_KCONFIG_OPTS = $(UBOOT_MAKE_OPTS) HOSTCC="$(HOSTCC)" HOSTLDFLAGS="" +# override again. In addition, host-ccache is not ready at kconfig +# time, so use HOSTCC_NOCCACHE. +UBOOT_KCONFIG_OPTS = $(UBOOT_MAKE_OPTS) HOSTCC="$(HOSTCC_NOCCACHE)" HOSTLDFLAGS=""Since you're just switching over to the no-ccache variant:
Quoted 6 lines
Acked-by "Yann E. MORIN" <[email protected]>However, I wonder if we would not be better off if we had written something like;
UBOOT_KCONFIG_OPTS = $(filter-out HOSTCC=% HOSTLDFLAGS=%, $(UBOOT_MAKE_OPTS))
No, no, we can't, because there might be spaces in the previous HOSTCC="..." definition, so we really need to over-override it.
Regards,
Yann E. MORIN.
Quoted 27 lines
But this is another story. ;-)
Regards,
Yann E. MORIN.Quoted 10 lines
boot/uboot/uboot.mk +0
-0define UBOOT_HELP_CMDS @echo ' uboot-menuconfig - Run U-Boot menuconfig' @echo ' uboot-savedefconfig - Run U-Boot savedefconfig'Signature · 6 lines
2.20.1 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildrootSignature · 10 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------' _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH 2/3 boot/uboot: use HOSTCC_NOCCACHE as kconfig HOSTCC
Quoted 38 lines · Yann E. MORIN
Thomas, All,
On 2019-01-13 22:47 +0100, Yann E. MORIN spake thusly:
Quoted 35 lines
On 2019-01-10 22:14 +0100, Thomas Petazzoni spake thusly:
Quoted 21 lines
At kconfig time, dependencies are not built, and therefore host-ccache is not ready. Due to this, using $(HOSTCC) as the host compiler in
KCONFIG_OPTSdoes not work: a "make uboot-menuconfig" invocation from a clean tree with ccache enabled fails.This commit fixes this by using $(HOSTCC_NOCCACHE). We cannot rely on the default value of HOSTCC passed by the kconfig-package infrastructure, because $(UBOOT_MAKE_OPTS) also contains a HOSTCC definition that would override the one passed by the kconfig-package infrastructure.
Signed-off-by Thomas Petazzoni <[email protected]>--- boot/uboot/uboot.mk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)boot/uboot/uboot.mk +0
-0boot/uboot/uboot.mk UBOOT_KCONFIG_EDITORS = menuconfig xconfig gconfig nconfig · line 232
Quoted 8 lines
boot/uboot/uboot.mk +3
-2@@ -227,8 +227,9 @@ UBOOT_KCONFIG_EDITORS = menuconfig xconfig gconfig nconfig # (which is typically wchar) but link with # $(HOST_DIR)/lib/libncurses.so (which is not). We don't actually # need any host-package for kconfig, so remove the HOSTCC/HOSTLDFLAGS -# override again. -UBOOT_KCONFIG_OPTS = $(UBOOT_MAKE_OPTS) HOSTCC="$(HOSTCC)" HOSTLDFLAGS="" +# override again. In addition, host-ccache is not ready at kconfig +# time, so use HOSTCC_NOCCACHE. +UBOOT_KCONFIG_OPTS = $(UBOOT_MAKE_OPTS) HOSTCC="$(HOSTCC_NOCCACHE)" HOSTLDFLAGS=""Since you're just switching over to the no-ccache variant:
Acked-by "Yann E. MORIN" <[email protected]>
Quoted 7 lines
Quoted 4 lines
However, I wonder if we would not be better off if we had written something like;
UBOOT_KCONFIG_OPTS = $(filter-out HOSTCC=% HOSTLDFLAGS=%, $(UBOOT_MAKE_OPTS))No, no, we can't, because there might be spaces in the previous HOSTCC="..." definition, so we really need to over-override it.
Maybe, instead of over-overriding HOSTCC, we can just avoid usingUBOOT_MAKE_OPTS in UBOOT_KCONFIG_OPTS, instead passing the ARCH= and CROSS_COMPILE= explicitly. And we probably don't even need CROSS_COMPILE for configuring.
Regards,
Arnout
PATCH 2/3 boot/uboot: use HOSTCC_NOCCACHE as kconfig HOSTCC
In reply to Thomas PetazzoniQuoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
At kconfig time, dependencies are not built, and therefore host-ccache is not ready. Due to this, using $(HOSTCC) as the host compiler in
KCONFIG_OPTSdoes not work: a "make uboot-menuconfig" invocation from a clean tree with ccache enabled fails.
Quoted 7 lines
This commit fixes this by using $(HOSTCC_NOCCACHE). We cannot rely on the default value of HOSTCC passed by the kconfig-package infrastructure, because $(UBOOT_MAKE_OPTS) also contains a HOSTCC definition that would override the one passed by the kconfig-package infrastructure.
Signed-off-by Thomas Petazzoni <[email protected]>
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 2/3 boot/uboot: use HOSTCC_NOCCACHE as kconfig HOSTCC
In reply to Thomas PetazzoniQuoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
At kconfig time, dependencies are not built, and therefore host-ccache is not ready. Due to this, using $(HOSTCC) as the host compiler in
KCONFIG_OPTSdoes not work: a "make uboot-menuconfig" invocation from a clean tree with ccache enabled fails.
Quoted 7 lines
This commit fixes this by using $(HOSTCC_NOCCACHE). We cannot rely on the default value of HOSTCC passed by the kconfig-package infrastructure, because $(UBOOT_MAKE_OPTS) also contains a HOSTCC definition that would override the one passed by the kconfig-package infrastructure.
Signed-off-by Thomas Petazzoni <[email protected]>
Committed to 2018.11.x, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 3/3 linux: use HOSTCC_NOCCACHE as kconfig HOSTCC
In reply to Thomas Petazzonilinux is a bit different than other kconfig-package, because it has "toolchain" in KCONFIG_DEPENDENCIES. Thanks to this, host-ccache *is* ready by the time kconfig invocations are made, so we could use $(HOSTCC) as the host compiler for kconfig related operations.
However, for consistency with other kconfig-package packages, we chose to use $(HOSTCC_NOCCACHE) as well.
We cannot rely on the default value of HOSTCC passed by the kconfig-package infrastructure, because $(LINUX_MAKE_FLAGS) also contains a HOSTCC definition that would override the one passed by the kconfig-package infrastructure.
--- linux/linux.mk | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
linux/linux.mk +10 -7
@@ -269,13 +269,16 @@ endif LINUX_KCONFIG_FRAGMENT_FILES = $(call qstrip,$(BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES)) LINUX_KCONFIG_EDITORS = menuconfig xconfig gconfig nconfig -# LINUX_MAKE_FLAGS overrides HOSTCC to allow the kernel build to find our -# host-openssl and host-libelf. However, this triggers a bug in the kconfig -# build script that causes it to build with /usr/include/ncurses.h (which is -# typically wchar) but link with $(HOST_DIR)/lib/libncurses.so (which is not). -# We don't actually need any host-package for kconfig, so remove the HOSTCC -# override again. -LINUX_KCONFIG_OPTS = $(LINUX_MAKE_FLAGS) HOSTCC="$(HOSTCC)" +# LINUX_MAKE_FLAGS overrides HOSTCC to allow the kernel build to find +# our host-openssl and host-libelf. However, this triggers a bug in +# the kconfig build script that causes it to build with +# /usr/include/ncurses.h (which is typically wchar) but link with +# $(HOST_DIR)/lib/libncurses.so (which is not). We don't actually +# need any host-package for kconfig, so remove the HOSTCC override +# again. In addition, even though linux depends on the toolchain and +# therefore host-ccache would be ready, we use HOSTCC_NOCCACHE for +# consistency with other kconfig packages. +LINUX_KCONFIG_OPTS = $(LINUX_MAKE_FLAGS) HOSTCC="$(HOSTCC_NOCCACHE)" # If no package has yet set it, set it from the Kconfig option LINUX_NEEDS_MODULES ?= $(BR2_LINUX_NEEDS_MODULES)
Signature · 1 line
2.20.1
PATCH 3/3 linux: use HOSTCC_NOCCACHE as kconfig HOSTCC
Thomas, All,
On 2019-01-10 22:15 +0100, Thomas Petazzoni spake thusly:
Quoted 8 lines
linux is a bit different than other kconfig-package, because it has "toolchain" in
KCONFIG_DEPENDENCIES. Thanks to this, host-ccache *is* ready by the time kconfig invocations are made, so we could use $(HOSTCC) as the host compiler for kconfig related operations.However, for consistency with other kconfig-package packages, we chose to use $(HOSTCC_NOCCACHE) as well.
Quoted 6 lines
We cannot rely on the default value of HOSTCC passed by the kconfig-package infrastructure, because $(LINUX_MAKE_FLAGS) also contains a HOSTCC definition that would override the one passed by the kconfig-package infrastructure.
Signed-off-by Thomas Petazzoni <[email protected]>
Regards,
Yann E. MORIN.
Quoted 39 lines
--- linux/linux.mk | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)linux/linux.mk +10
-7@@ -269,13 +269,16 @@ endif LINUX_KCONFIG_FRAGMENT_FILES = $(call qstrip,$(BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES)) LINUX_KCONFIG_EDITORS = menuconfig xconfig gconfig nconfig -# LINUX_MAKE_FLAGS overrides HOSTCC to allow the kernel build to find our -# host-openssl and host-libelf. However, this triggers a bug in the kconfig -# build script that causes it to build with /usr/include/ncurses.h (which is -# typically wchar) but link with $(HOST_DIR)/lib/libncurses.so (which is not). -# We don't actually need any host-package for kconfig, so remove the HOSTCC -# override again. -LINUX_KCONFIG_OPTS = $(LINUX_MAKE_FLAGS) HOSTCC="$(HOSTCC)" +# LINUX_MAKE_FLAGS overrides HOSTCC to allow the kernel build to find +# our host-openssl and host-libelf. However, this triggers a bug in +# the kconfig build script that causes it to build with +# /usr/include/ncurses.h (which is typically wchar) but link with +# $(HOST_DIR)/lib/libncurses.so (which is not). We don't actually +# need any host-package for kconfig, so remove the HOSTCC override +# again. In addition, even though linux depends on the toolchain and +# therefore host-ccache would be ready, we use HOSTCC_NOCCACHE for +# consistency with other kconfig packages. +LINUX_KCONFIG_OPTS = $(LINUX_MAKE_FLAGS) HOSTCC="$(HOSTCC_NOCCACHE)" # If no package has yet set it, set it from the Kconfig option LINUX_NEEDS_MODULES ?= $(BR2_LINUX_NEEDS_MODULES)Signature · 6 lines
2.20.1 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH 3/3 linux: use HOSTCC_NOCCACHE as kconfig HOSTCC
In reply to Thomas PetazzoniQuoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
linux is a bit different than other kconfig-package, because it has "toolchain" in
KCONFIG_DEPENDENCIES. Thanks to this, host-ccache *is* ready by the time kconfig invocations are made, so we could use $(HOSTCC) as the host compiler for kconfig related operations.However, for consistency with other kconfig-package packages, we chose to use $(HOSTCC_NOCCACHE) as well.
Quoted 6 lines
We cannot rely on the default value of HOSTCC passed by the kconfig-package infrastructure, because $(LINUX_MAKE_FLAGS) also contains a HOSTCC definition that would override the one passed by the kconfig-package infrastructure.
Signed-off-by Thomas Petazzoni <[email protected]>
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 3/3 linux: use HOSTCC_NOCCACHE as kconfig HOSTCC
In reply to Thomas PetazzoniQuoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
linux is a bit different than other kconfig-package, because it has "toolchain" in
KCONFIG_DEPENDENCIES. Thanks to this, host-ccache *is* ready by the time kconfig invocations are made, so we could use $(HOSTCC) as the host compiler for kconfig related operations.However, for consistency with other kconfig-package packages, we chose to use $(HOSTCC_NOCCACHE) as well.
Quoted 6 lines
We cannot rely on the default value of HOSTCC passed by the kconfig-package infrastructure, because $(LINUX_MAKE_FLAGS) also contains a HOSTCC definition that would override the one passed by the kconfig-package infrastructure.
Signed-off-by Thomas Petazzoni <[email protected]>
Committed to 2018.11.x, thanks.
Signature · 1 line
Bye, Peter Korsgaard