All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] linux: don't override HOSTCC for kconfig
@ 2018-05-17 12:39 Arnout Vandecappelle
  2018-05-17 13:24 ` Matthew Weber
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Arnout Vandecappelle @ 2018-05-17 12:39 UTC (permalink / raw)
  To: buildroot

Kconfig uses either pkg-config or hard-coded /usr/include paths to find
the ncurses or ncursesw library. If ncursesw is found, it will include
<ncursesw.h>. Since Buildroot's host-ncurses doesn't install a .pc file,
and linux.mk anyway doesn't pass the pkg-config options to find the host
pkg-config files, Kconfig will always find the system's ncursesw.h.

However, since commit dde090c299 (linux: fix passing of host CFLAGS and
LDFLAGS) HOST_LDFLAGS is passed to the linux build system. Thus, if
host-ncurses was already built before 'make linux-menuconfig' is called,
the build will pick up libncurses from the host directory, which is NOT
widechar. Thus, two different ncurses configurations are mixed into the
final mconf program. This will result in serious breakage in the
rendering of the menus (lots of @ and question mark characters).

As a workaround (suggested by Yann), don't pass HOST_CFLAGS and
HOST_LDFLAGS when running kconfig commands. For kconfig, we should never
need host packages anyway. This way, the kconfig calls will always use
the system's ncurses and never our host-ncurses.

Note that the same problem could pop up for other kconfig packages as
well if we ever pass HOST_CFLAGS/HOST_LDFLAGS to them. We could force
HOSTCC=$(HOSTCC) directly in kconfig-package. However, for now there
are no other packages that exhibit this problem, so this can be
revisited when they do.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Cc: David De Grave <david.degrave@essensium.com>
Cc: Scott Fan <fancp2007@gmail.com>
Cc: Yann E. MORIN <yann.morin.1998@free.fr>
---
v3: override LINUX_KCONFIG_OPTS instead of building host-ncurses with
    wchar
---
 linux/linux.mk | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/linux/linux.mk b/linux/linux.mk
index b6b91391b6..6b5f5344ed 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -235,7 +235,14 @@ LINUX_KCONFIG_FILE = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE))
 endif
 LINUX_KCONFIG_FRAGMENT_FILES = $(call qstrip,$(BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES))
 LINUX_KCONFIG_EDITORS = menuconfig xconfig gconfig nconfig
-LINUX_KCONFIG_OPTS = $(LINUX_MAKE_FLAGS)
+
+# 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)"
 
 # If no package has yet set it, set it from the Kconfig option
 LINUX_NEEDS_MODULES ?= $(BR2_LINUX_NEEDS_MODULES)
-- 
2.17.0

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

* [Buildroot] [PATCH] linux: don't override HOSTCC for kconfig
  2018-05-17 12:39 [Buildroot] [PATCH] linux: don't override HOSTCC for kconfig Arnout Vandecappelle
@ 2018-05-17 13:24 ` Matthew Weber
  2018-05-17 18:54 ` Thomas Petazzoni
  2018-06-11 21:12 ` Peter Korsgaard
  2 siblings, 0 replies; 4+ messages in thread
From: Matthew Weber @ 2018-05-17 13:24 UTC (permalink / raw)
  To: buildroot

All,

On Thu, May 17, 2018 at 7:39 AM, Arnout Vandecappelle (Essensium/Mind)
<arnout@mind.be> wrote:
> Kconfig uses either pkg-config or hard-coded /usr/include paths to find
> the ncurses or ncursesw library. If ncursesw is found, it will include
> <ncursesw.h>. Since Buildroot's host-ncurses doesn't install a .pc file,
> and linux.mk anyway doesn't pass the pkg-config options to find the host
> pkg-config files, Kconfig will always find the system's ncursesw.h.
>
> However, since commit dde090c299 (linux: fix passing of host CFLAGS and
> LDFLAGS) HOST_LDFLAGS is passed to the linux build system. Thus, if
> host-ncurses was already built before 'make linux-menuconfig' is called,
> the build will pick up libncurses from the host directory, which is NOT
> widechar. Thus, two different ncurses configurations are mixed into the
> final mconf program. This will result in serious breakage in the
> rendering of the menus (lots of @ and question mark characters).
>
> As a workaround (suggested by Yann), don't pass HOST_CFLAGS and
> HOST_LDFLAGS when running kconfig commands. For kconfig, we should never
> need host packages anyway. This way, the kconfig calls will always use
> the system's ncurses and never our host-ncurses.
>
> Note that the same problem could pop up for other kconfig packages as
> well if we ever pass HOST_CFLAGS/HOST_LDFLAGS to them. We could force
> HOSTCC=$(HOSTCC) directly in kconfig-package. However, for now there
> are no other packages that exhibit this problem, so this can be
> revisited when they do.
>
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> Cc: David De Grave <david.degrave@essensium.com>
> Cc: Scott Fan <fancp2007@gmail.com>
> Cc: Yann E. MORIN <yann.morin.1998@free.fr>
>

Didn't realize this was causing some issues we've been observing on
the LTS tag.  We also noticed the content in the menu was incorrect at
points but it never affected the saved config unless you re-saved.
Thanks for the fix.

Tested-by: Matt Weber <matthew.weber@rockwellcollins.com>

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

* [Buildroot] [PATCH] linux: don't override HOSTCC for kconfig
  2018-05-17 12:39 [Buildroot] [PATCH] linux: don't override HOSTCC for kconfig Arnout Vandecappelle
  2018-05-17 13:24 ` Matthew Weber
@ 2018-05-17 18:54 ` Thomas Petazzoni
  2018-06-11 21:12 ` Peter Korsgaard
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2018-05-17 18:54 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu, 17 May 2018 14:39:21 +0200, Arnout Vandecappelle
(Essensium/Mind) wrote:
> Kconfig uses either pkg-config or hard-coded /usr/include paths to find
> the ncurses or ncursesw library. If ncursesw is found, it will include
> <ncursesw.h>. Since Buildroot's host-ncurses doesn't install a .pc file,
> and linux.mk anyway doesn't pass the pkg-config options to find the host
> pkg-config files, Kconfig will always find the system's ncursesw.h.
> 
> However, since commit dde090c299 (linux: fix passing of host CFLAGS and
> LDFLAGS) HOST_LDFLAGS is passed to the linux build system. Thus, if
> host-ncurses was already built before 'make linux-menuconfig' is called,
> the build will pick up libncurses from the host directory, which is NOT
> widechar. Thus, two different ncurses configurations are mixed into the
> final mconf program. This will result in serious breakage in the
> rendering of the menus (lots of @ and question mark characters).
> 
> As a workaround (suggested by Yann), don't pass HOST_CFLAGS and
> HOST_LDFLAGS when running kconfig commands. For kconfig, we should never
> need host packages anyway. This way, the kconfig calls will always use
> the system's ncurses and never our host-ncurses.
> 
> Note that the same problem could pop up for other kconfig packages as
> well if we ever pass HOST_CFLAGS/HOST_LDFLAGS to them. We could force
> HOSTCC=$(HOSTCC) directly in kconfig-package. However, for now there
> are no other packages that exhibit this problem, so this can be
> revisited when they do.
> 
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> Cc: David De Grave <david.degrave@essensium.com>
> Cc: Scott Fan <fancp2007@gmail.com>
> Cc: Yann E. MORIN <yann.morin.1998@free.fr>
> ---
> v3: override LINUX_KCONFIG_OPTS instead of building host-ncurses with
>     wchar
> ---
>  linux/linux.mk | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH] linux: don't override HOSTCC for kconfig
  2018-05-17 12:39 [Buildroot] [PATCH] linux: don't override HOSTCC for kconfig Arnout Vandecappelle
  2018-05-17 13:24 ` Matthew Weber
  2018-05-17 18:54 ` Thomas Petazzoni
@ 2018-06-11 21:12 ` Peter Korsgaard
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Korsgaard @ 2018-06-11 21:12 UTC (permalink / raw)
  To: buildroot

>>>>> "Arnout" == Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> writes:

 > Kconfig uses either pkg-config or hard-coded /usr/include paths to find
 > the ncurses or ncursesw library. If ncursesw is found, it will include
 > <ncursesw.h>. Since Buildroot's host-ncurses doesn't install a .pc file,
 > and linux.mk anyway doesn't pass the pkg-config options to find the host
 > pkg-config files, Kconfig will always find the system's ncursesw.h.

 > However, since commit dde090c299 (linux: fix passing of host CFLAGS and
 > LDFLAGS) HOST_LDFLAGS is passed to the linux build system. Thus, if
 > host-ncurses was already built before 'make linux-menuconfig' is called,
 > the build will pick up libncurses from the host directory, which is NOT
 > widechar. Thus, two different ncurses configurations are mixed into the
 > final mconf program. This will result in serious breakage in the
 > rendering of the menus (lots of @ and question mark characters).

 > As a workaround (suggested by Yann), don't pass HOST_CFLAGS and
 > HOST_LDFLAGS when running kconfig commands. For kconfig, we should never
 > need host packages anyway. This way, the kconfig calls will always use
 > the system's ncurses and never our host-ncurses.

 > Note that the same problem could pop up for other kconfig packages as
 > well if we ever pass HOST_CFLAGS/HOST_LDFLAGS to them. We could force
 > HOSTCC=$(HOSTCC) directly in kconfig-package. However, for now there
 > are no other packages that exhibit this problem, so this can be
 > revisited when they do.

 > Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
 > Cc: David De Grave <david.degrave@essensium.com>
 > Cc: Scott Fan <fancp2007@gmail.com>
 > Cc: Yann E. MORIN <yann.morin.1998@free.fr>
 > ---
 > v3: override LINUX_KCONFIG_OPTS instead of building host-ncurses with
 >     wchar

Committed to 2018.02.x, thanks.

-- 
Bye, Peter Korsgaard

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

end of thread, other threads:[~2018-06-11 21:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-17 12:39 [Buildroot] [PATCH] linux: don't override HOSTCC for kconfig Arnout Vandecappelle
2018-05-17 13:24 ` Matthew Weber
2018-05-17 18:54 ` Thomas Petazzoni
2018-06-11 21:12 ` 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.