All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/3] Fix pkg-kconfig packages with ccache enabled
@ 2019-01-10 21:14 Thomas Petazzoni
  2019-01-10 21:14 ` [Buildroot] [PATCH 1/3] package/pkg-kconfig: pass HOSTCC during kconfig steps Thomas Petazzoni
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Thomas Petazzoni @ 2019-01-10 21:14 UTC (permalink / raw)
  To: buildroot

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(-)

-- 
2.20.1

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 1/3] package/pkg-kconfig: pass HOSTCC during kconfig steps
  2019-01-10 21:14 [Buildroot] [PATCH 0/3] Fix pkg-kconfig packages with ccache enabled Thomas Petazzoni
@ 2019-01-10 21:14 ` Thomas Petazzoni
  2019-01-13 21:43   ` Yann E. MORIN
                     ` (2 more replies)
  2019-01-10 21:14 ` [Buildroot] [PATCH 2/3] boot/uboot: use HOSTCC_NOCCACHE as kconfig HOSTCC Thomas Petazzoni
  2019-01-10 21:15 ` [Buildroot] [PATCH 3/3] linux: " Thomas Petazzoni
  2 siblings, 3 replies; 15+ messages in thread
From: Thomas Petazzoni @ 2019-01-10 21:14 UTC (permalink / raw)
  To: buildroot

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.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 package/pkg-kconfig.mk | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/package/pkg-kconfig.mk b/package/pkg-kconfig.mk
index d6c95b897e..ce11e14824 100644
--- a/package/pkg-kconfig.mk
+++ b/package/pkg-kconfig.mk
@@ -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
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 2/3] boot/uboot: use HOSTCC_NOCCACHE as kconfig HOSTCC
  2019-01-10 21:14 [Buildroot] [PATCH 0/3] Fix pkg-kconfig packages with ccache enabled Thomas Petazzoni
  2019-01-10 21:14 ` [Buildroot] [PATCH 1/3] package/pkg-kconfig: pass HOSTCC during kconfig steps Thomas Petazzoni
@ 2019-01-10 21:14 ` Thomas Petazzoni
  2019-01-13 21:47   ` Yann E. MORIN
                     ` (2 more replies)
  2019-01-10 21:15 ` [Buildroot] [PATCH 3/3] linux: " Thomas Petazzoni
  2 siblings, 3 replies; 15+ messages in thread
From: Thomas Petazzoni @ 2019-01-10 21:14 UTC (permalink / raw)
  To: buildroot

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_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.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 boot/uboot/uboot.mk | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index cbdfee6ac3..6977bcc064 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -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'
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 3/3] linux: use HOSTCC_NOCCACHE as kconfig HOSTCC
  2019-01-10 21:14 [Buildroot] [PATCH 0/3] Fix pkg-kconfig packages with ccache enabled Thomas Petazzoni
  2019-01-10 21:14 ` [Buildroot] [PATCH 1/3] package/pkg-kconfig: pass HOSTCC during kconfig steps Thomas Petazzoni
  2019-01-10 21:14 ` [Buildroot] [PATCH 2/3] boot/uboot: use HOSTCC_NOCCACHE as kconfig HOSTCC Thomas Petazzoni
@ 2019-01-10 21:15 ` Thomas Petazzoni
  2019-01-13 21:50   ` Yann E. MORIN
                     ` (2 more replies)
  2 siblings, 3 replies; 15+ messages in thread
From: Thomas Petazzoni @ 2019-01-10 21:15 UTC (permalink / raw)
  To: buildroot

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.

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 <thomas.petazzoni@bootlin.com>
---
 linux/linux.mk | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/linux/linux.mk b/linux/linux.mk
index 6bf2b88038..02def89113 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -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)
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 1/3] package/pkg-kconfig: pass HOSTCC during kconfig steps
  2019-01-10 21:14 ` [Buildroot] [PATCH 1/3] package/pkg-kconfig: pass HOSTCC during kconfig steps Thomas Petazzoni
@ 2019-01-13 21:43   ` Yann E. MORIN
  2019-01-16 22:39   ` Peter Korsgaard
  2019-01-28 17:01   ` Peter Korsgaard
  2 siblings, 0 replies; 15+ messages in thread
From: Yann E. MORIN @ 2019-01-13 21:43 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2019-01-10 22:14 +0100, Thomas Petazzoni spake thusly:
> 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.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

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

Regards,
Yann E. MORIN.

> ---
>  package/pkg-kconfig.mk | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/package/pkg-kconfig.mk b/package/pkg-kconfig.mk
> index d6c95b897e..ce11e14824 100644
> --- a/package/pkg-kconfig.mk
> +++ b/package/pkg-kconfig.mk
> @@ -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
> -- 
> 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 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 2/3] boot/uboot: use HOSTCC_NOCCACHE as kconfig HOSTCC
  2019-01-10 21:14 ` [Buildroot] [PATCH 2/3] boot/uboot: use HOSTCC_NOCCACHE as kconfig HOSTCC Thomas Petazzoni
@ 2019-01-13 21:47   ` Yann E. MORIN
  2019-01-13 21:51     ` Yann E. MORIN
  2019-01-16 22:39   ` Peter Korsgaard
  2019-01-28 17:01   ` Peter Korsgaard
  2 siblings, 1 reply; 15+ messages in thread
From: Yann E. MORIN @ 2019-01-13 21:47 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2019-01-10 22:14 +0100, Thomas Petazzoni spake thusly:
> 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_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.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ---
>  boot/uboot/uboot.mk | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
> index cbdfee6ac3..6977bcc064 100644
> --- a/boot/uboot/uboot.mk
> +++ b/boot/uboot/uboot.mk
> @@ -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" <yann.morin.1998@free.fr>

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.

>  define UBOOT_HELP_CMDS
>  	@echo '  uboot-menuconfig       - Run U-Boot menuconfig'
>  	@echo '  uboot-savedefconfig    - Run U-Boot savedefconfig'
> -- 
> 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 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 3/3] linux: use HOSTCC_NOCCACHE as kconfig HOSTCC
  2019-01-10 21:15 ` [Buildroot] [PATCH 3/3] linux: " Thomas Petazzoni
@ 2019-01-13 21:50   ` Yann E. MORIN
  2019-01-16 22:40   ` Peter Korsgaard
  2019-01-28 17:01   ` Peter Korsgaard
  2 siblings, 0 replies; 15+ messages in thread
From: Yann E. MORIN @ 2019-01-13 21:50 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2019-01-10 22:15 +0100, Thomas Petazzoni spake thusly:
> 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.
> 
> 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 <thomas.petazzoni@bootlin.com>

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

Regards,
Yann E. MORIN.

> ---
>  linux/linux.mk | 17 ++++++++++-------
>  1 file changed, 10 insertions(+), 7 deletions(-)
> 
> diff --git a/linux/linux.mk b/linux/linux.mk
> index 6bf2b88038..02def89113 100644
> --- a/linux/linux.mk
> +++ b/linux/linux.mk
> @@ -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)
> -- 
> 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 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 2/3] boot/uboot: use HOSTCC_NOCCACHE as kconfig HOSTCC
  2019-01-13 21:47   ` Yann E. MORIN
@ 2019-01-13 21:51     ` Yann E. MORIN
  2019-01-24 16:12       ` Arnout Vandecappelle
  0 siblings, 1 reply; 15+ messages in thread
From: Yann E. MORIN @ 2019-01-13 21:51 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2019-01-13 22:47 +0100, Yann E. MORIN spake thusly:
> On 2019-01-10 22:14 +0100, Thomas Petazzoni spake thusly:
> > 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_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.
> > 
> > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> > ---
> >  boot/uboot/uboot.mk | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
> > index cbdfee6ac3..6977bcc064 100644
> > --- a/boot/uboot/uboot.mk
> > +++ b/boot/uboot/uboot.mk
> > @@ -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" <yann.morin.1998@free.fr>
> 
> 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.

> But this is another story. ;-)
> 
> Regards,
> Yann E. MORIN.
> 
> >  define UBOOT_HELP_CMDS
> >  	@echo '  uboot-menuconfig       - Run U-Boot menuconfig'
> >  	@echo '  uboot-savedefconfig    - Run U-Boot savedefconfig'
> > -- 
> > 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 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

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 1/3] package/pkg-kconfig: pass HOSTCC during kconfig steps
  2019-01-10 21:14 ` [Buildroot] [PATCH 1/3] package/pkg-kconfig: pass HOSTCC during kconfig steps Thomas Petazzoni
  2019-01-13 21:43   ` Yann E. MORIN
@ 2019-01-16 22:39   ` Peter Korsgaard
  2019-01-28 17:01   ` Peter Korsgaard
  2 siblings, 0 replies; 15+ messages in thread
From: Peter Korsgaard @ 2019-01-16 22:39 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@bootlin.com> 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_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.

 > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 2/3] boot/uboot: use HOSTCC_NOCCACHE as kconfig HOSTCC
  2019-01-10 21:14 ` [Buildroot] [PATCH 2/3] boot/uboot: use HOSTCC_NOCCACHE as kconfig HOSTCC Thomas Petazzoni
  2019-01-13 21:47   ` Yann E. MORIN
@ 2019-01-16 22:39   ` Peter Korsgaard
  2019-01-28 17:01   ` Peter Korsgaard
  2 siblings, 0 replies; 15+ messages in thread
From: Peter Korsgaard @ 2019-01-16 22:39 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@bootlin.com> 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_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.

 > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 3/3] linux: use HOSTCC_NOCCACHE as kconfig HOSTCC
  2019-01-10 21:15 ` [Buildroot] [PATCH 3/3] linux: " Thomas Petazzoni
  2019-01-13 21:50   ` Yann E. MORIN
@ 2019-01-16 22:40   ` Peter Korsgaard
  2019-01-28 17:01   ` Peter Korsgaard
  2 siblings, 0 replies; 15+ messages in thread
From: Peter Korsgaard @ 2019-01-16 22:40 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@bootlin.com> 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.

 > 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 <thomas.petazzoni@bootlin.com>

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 2/3] boot/uboot: use HOSTCC_NOCCACHE as kconfig HOSTCC
  2019-01-13 21:51     ` Yann E. MORIN
@ 2019-01-24 16:12       ` Arnout Vandecappelle
  0 siblings, 0 replies; 15+ messages in thread
From: Arnout Vandecappelle @ 2019-01-24 16:12 UTC (permalink / raw)
  To: buildroot



On 13/01/2019 22:51, Yann E. MORIN wrote:
> Thomas, All,
> 
> On 2019-01-13 22:47 +0100, Yann E. MORIN spake thusly:
>> On 2019-01-10 22:14 +0100, Thomas Petazzoni spake thusly:
>>> 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_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.
>>>
>>> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
>>> ---
>>>  boot/uboot/uboot.mk | 5 +++--
>>>  1 file changed, 3 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
>>> index cbdfee6ac3..6977bcc064 100644
>>> --- a/boot/uboot/uboot.mk
>>> +++ b/boot/uboot/uboot.mk
>>> @@ -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" <yann.morin.1998@free.fr>
>>
>> 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 using
UBOOT_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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 1/3] package/pkg-kconfig: pass HOSTCC during kconfig steps
  2019-01-10 21:14 ` [Buildroot] [PATCH 1/3] package/pkg-kconfig: pass HOSTCC during kconfig steps Thomas Petazzoni
  2019-01-13 21:43   ` Yann E. MORIN
  2019-01-16 22:39   ` Peter Korsgaard
@ 2019-01-28 17:01   ` Peter Korsgaard
  2 siblings, 0 replies; 15+ messages in thread
From: Peter Korsgaard @ 2019-01-28 17:01 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@bootlin.com> 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_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.

 > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Committed to 2018.11.x, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 3/3] linux: use HOSTCC_NOCCACHE as kconfig HOSTCC
  2019-01-10 21:15 ` [Buildroot] [PATCH 3/3] linux: " Thomas Petazzoni
  2019-01-13 21:50   ` Yann E. MORIN
  2019-01-16 22:40   ` Peter Korsgaard
@ 2019-01-28 17:01   ` Peter Korsgaard
  2 siblings, 0 replies; 15+ messages in thread
From: Peter Korsgaard @ 2019-01-28 17:01 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@bootlin.com> 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.

 > 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 <thomas.petazzoni@bootlin.com>

Committed to 2018.11.x, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 2/3] boot/uboot: use HOSTCC_NOCCACHE as kconfig HOSTCC
  2019-01-10 21:14 ` [Buildroot] [PATCH 2/3] boot/uboot: use HOSTCC_NOCCACHE as kconfig HOSTCC Thomas Petazzoni
  2019-01-13 21:47   ` Yann E. MORIN
  2019-01-16 22:39   ` Peter Korsgaard
@ 2019-01-28 17:01   ` Peter Korsgaard
  2 siblings, 0 replies; 15+ messages in thread
From: Peter Korsgaard @ 2019-01-28 17:01 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@bootlin.com> 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_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.

 > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Committed to 2018.11.x, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2019-01-28 17:01 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-10 21:14 [Buildroot] [PATCH 0/3] Fix pkg-kconfig packages with ccache enabled Thomas Petazzoni
2019-01-10 21:14 ` [Buildroot] [PATCH 1/3] package/pkg-kconfig: pass HOSTCC during kconfig steps Thomas Petazzoni
2019-01-13 21:43   ` Yann E. MORIN
2019-01-16 22:39   ` Peter Korsgaard
2019-01-28 17:01   ` Peter Korsgaard
2019-01-10 21:14 ` [Buildroot] [PATCH 2/3] boot/uboot: use HOSTCC_NOCCACHE as kconfig HOSTCC Thomas Petazzoni
2019-01-13 21:47   ` Yann E. MORIN
2019-01-13 21:51     ` Yann E. MORIN
2019-01-24 16:12       ` Arnout Vandecappelle
2019-01-16 22:39   ` Peter Korsgaard
2019-01-28 17:01   ` Peter Korsgaard
2019-01-10 21:15 ` [Buildroot] [PATCH 3/3] linux: " Thomas Petazzoni
2019-01-13 21:50   ` Yann E. MORIN
2019-01-16 22:40   ` Peter Korsgaard
2019-01-28 17:01   ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.