All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Hatle <mark.hatle@windriver.com>
To: <openembedded-core@lists.openembedded.org>
Subject: [PATCH 10/21] ncurses, busybox, cml1.bbclass: Fix menuconfig display corruption
Date: Wed, 29 May 2013 10:09:52 -0500	[thread overview]
Message-ID: <1369840203-21898-11-git-send-email-mark.hatle@windriver.com> (raw)
In-Reply-To: <1369840203-21898-1-git-send-email-mark.hatle@windriver.com>

From: Jason Wessel <jason.wessel@windriver.com>

Previously there was a change to the ncurses compile to make it more
like the typical way it was compiled on a host system.  This fixed a
whole class of host machines, but masked the real underlying problem
with the display corruption issues and menuconfig.

The corner case that led to the discovery that the wrong curses.h file
was getting used was when there was no curses libraries at all on one
of the development hosts.  What had happened before was that
/usr/include/curses.h on the host system had to match closely enough
to the curses.h in the sysroot and then linking against the sysroot
version of curses.so was ok (meaning no display corruption).  But on
some systems with ncurses.h vs curses.h such as SuSE hosts, there were
still issues.

If we fix the root of the problem and force the mconf and lxdialog to
use the correct headers and libraries from the sysroot there is no
further issues and the menuconfig target works properly.  It also
means we can back out the custom compilation flags to the ncurses
recipe because they are no longer needed.

For the kernel part of the menuconfig / nconfig changes it will be
merged separately and this is all based on:

https://lkml.org/lkml/2013/3/3/103

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
---
 meta/classes/cml1.bbclass                          |  5 +-
 .../busybox-1.20.2/busybox-cross-menuconfig.patch  | 69 ++++++++++++++++++++++
 meta/recipes-core/busybox/busybox_1.20.2.bb        |  3 +-
 meta/recipes-core/ncurses/ncurses.inc              | 14 -----
 4 files changed, 74 insertions(+), 17 deletions(-)
 create mode 100644 meta/recipes-core/busybox/busybox-1.20.2/busybox-cross-menuconfig.patch

diff --git a/meta/classes/cml1.bbclass b/meta/classes/cml1.bbclass
index bb95639..cd8e599 100644
--- a/meta/classes/cml1.bbclass
+++ b/meta/classes/cml1.bbclass
@@ -9,10 +9,11 @@ addtask configure after do_unpack do_patch before do_compile
 
 inherit terminal
 
-OE_TERMINAL_EXPORTS += "HOST_EXTRACFLAGS HOSTLDFLAGS HOST_LOADLIBES TERMINFO"
+OE_TERMINAL_EXPORTS += "HOST_EXTRACFLAGS HOSTLDFLAGS TERMINFO CROSS_CURSES_LIB CROSS_CURSES_INC"
 HOST_EXTRACFLAGS = "${BUILD_CFLAGS} ${BUILD_LDFLAGS}"
 HOSTLDFLAGS = "${BUILD_LDFLAGS}"
-HOST_LOADLIBES = "-lncurses"
+CROSS_CURSES_LIB = "-lncurses -ltinfo"
+CROSS_CURSES_INC = '-DCURSES_LOC="<curses.h>"'
 TERMINFO = "${STAGING_DATADIR_NATIVE}/terminfo"
 
 python do_menuconfig() {
diff --git a/meta/recipes-core/busybox/busybox-1.20.2/busybox-cross-menuconfig.patch b/meta/recipes-core/busybox/busybox-1.20.2/busybox-cross-menuconfig.patch
new file mode 100644
index 0000000..c0784d5
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox-1.20.2/busybox-cross-menuconfig.patch
@@ -0,0 +1,69 @@
+From: Jason Wessel <jason.wessel@windriver.com>
+Date: Sun, 3 Mar 2013 12:31:40 -0600
+Subject: [PATCH] menuconfig,check-lxdiaglog.sh: Allow specification of ncurses location
+
+[ based on: https://lkml.org/lkml/2013/3/3/103 ]
+
+This patch syncs up with the way the menuconfig ncurses / curses
+is detected and the HOST_EXTRACFLAGS works in the Linux kernel
+and it allows the menuconfig to work with a sysroot version
+of the curses libraries.
+
+---
+
+In some cross build environments such as the Yocto Project build
+environment it provides an ncurses library that is compiled
+differently than the host's version.  This causes display corruption
+problems when the host's curses includes are used instead of the
+includes from the provided compiler are overridden.  There is a second
+case where there is no curses libraries at all on the host system and
+menuconfig will just fail entirely.
+
+The solution is simply to allow an override variable in
+check-lxdialog.sh for environments such as the Yocto Project.  Adding
+a CROSS_CURSES_LIB and CROSS_CURSES_INC solves the issue and allowing
+compiling and linking against the right headers and libraries.
+
+Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
+cc: Michal Marek <mmarek@suse.cz>
+cc: linux-kbuild@vger.kernel.org
+---
+ scripts/kconfig/lxdialog/Makefile          |    2 +-
+ scripts/kconfig/lxdialog/check-lxdialog.sh |    8 ++++++++
+ 2 files changed, 9 insertions(+), 1 deletion(-)
+
+--- a/scripts/kconfig/lxdialog/check-lxdialog.sh
++++ b/scripts/kconfig/lxdialog/check-lxdialog.sh
+@@ -4,6 +4,10 @@
+ # What library to link
+ ldflags()
+ {
++	if [ x"$CROSS_CURSES_LIB" != x ]; then
++		echo "$CROSS_CURSES_LIB"
++		exit
++	fi
+ 	for ext in so a dylib ; do
+ 		for lib in ncursesw ncurses curses ; do
+ 			$cc -print-file-name=lib${lib}.${ext} | grep -q /
+@@ -19,6 +23,10 @@ ldflags()
+ # Where is ncurses.h?
+ ccflags()
+ {
++	if [ x"$CROSS_CURSES_INC" != x ]; then
++		echo "$CROSS_CURSES_INC"
++		exit
++	fi
+ 	if [ -f /usr/include/ncursesw/ncurses.h ]; then
+ 		echo '-I/usr/include/ncursesw -DCURSES_LOC="<ncurses.h>"'
+ 	elif [ -f /usr/include/ncursesw/curses.h ]; then
+--- a/scripts/kconfig/lxdialog/Makefile
++++ b/scripts/kconfig/lxdialog/Makefile
+@@ -5,7 +5,7 @@ check-lxdialog  := $(srctree)/$(src)/che
+ 
+ # Use reursively expanded variables so we do not call gcc unless
+ # we really need to do so. (Do not call gcc as part of make mrproper)
+-HOST_EXTRACFLAGS = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags)
++HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags)
+ HOST_LOADLIBES   = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
+ 
+ HOST_EXTRACFLAGS += -DLOCALE
diff --git a/meta/recipes-core/busybox/busybox_1.20.2.bb b/meta/recipes-core/busybox/busybox_1.20.2.bb
index 07d722d..410c701 100644
--- a/meta/recipes-core/busybox/busybox_1.20.2.bb
+++ b/meta/recipes-core/busybox/busybox_1.20.2.bb
@@ -35,7 +35,8 @@ SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
            file://fail_on_no_media.patch \
            file://busybox-sulogin-empty-root-password.patch \
            file://inetd.conf \
-           file://inetd"
+           file://inetd \
+           file://busybox-cross-menuconfig.patch"
 
 SRC_URI[tarball.md5sum] = "e025414bc6cd79579cc7a32a45d3ae1c"
 SRC_URI[tarball.sha256sum] = "eb13ff01dae5618ead2ef6f92ba879e9e0390f9583bd545d8789d27cf39b6882"
diff --git a/meta/recipes-core/ncurses/ncurses.inc b/meta/recipes-core/ncurses/ncurses.inc
index bcb9c94..8a81381 100644
--- a/meta/recipes-core/ncurses/ncurses.inc
+++ b/meta/recipes-core/ncurses/ncurses.inc
@@ -29,19 +29,6 @@ BUILD_CPPFLAGS += "-D_GNU_SOURCE"
 # natives don't generally look in base_libdir
 base_libdir_class-native = "${libdir}"
 
-# Display corruption occurs on 64 bit hosts without these settings
-# This was derrived from the upstream debian ncurses which uses
-# these settings for 32 and 64 bit hosts.
-EXCONFIG_ARGS = ""
-EXCONFIG_ARGS_virtclass-native = " \
-		--disable-lp64 \
-		--with-chtype='long' \
-		--with-mmask-t='long'"
-EXCONFIG_ARGS_virtclass-nativesdk = " \
-		--disable-lp64 \
-		--with-chtype='long' \
-		--with-mmask-t='long'"
-
 # Fall back to the host termcap / terminfo for -nativesdk and -native
 # The reality is a work around for strange problems with things like
 # "bitbake -c menuconfig busybox" where it cannot find the terminfo
@@ -79,7 +66,6 @@ ncurses_configure() {
 	        --enable-sigwinch \
 	        --enable-pc-files \
 	        --disable-rpath-hack \
-		${EXCONFIG_ARGS} \
 	        --with-manpage-format=normal \
 	        "$@" || return 1
 	cd ..
-- 
1.8.1.2.545.g2f19ada



  parent reply	other threads:[~2013-05-29 15:03 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-29 15:09 [PATCH 0/21] Misc patch set Mark Hatle
2013-05-29 15:09 ` [PATCH 1/21] libxpm: inherit gettext Mark Hatle
2013-05-29 15:09 ` [PATCH 2/21] Add directory information to the pkgdata files Mark Hatle
2013-05-29 15:11   ` Paul Eggleton
2013-05-29 15:23     ` Mark Hatle
2013-05-29 15:59   ` Martin Jansa
2013-05-29 16:30     ` Mark Hatle
2013-05-29 17:36       ` Khem Raj
2013-05-29 19:59       ` Phil Blundell
2013-05-29 20:44         ` Mark Hatle
2013-05-30  8:29           ` Paul Eggleton
2013-05-30  8:33             ` Richard Purdie
2013-05-29 15:09 ` [PATCH 3/21] cmake.bbclass: modify construction of compiler flags Mark Hatle
2013-05-29 15:09 ` [PATCH 4/21] acpid: modify CFLAGS Mark Hatle
2013-05-29 15:09 ` [PATCH 5/21] libpam: Avoid wildcards in the SRC_URI Mark Hatle
2013-05-29 15:09 ` [PATCH 6/21] util-linux: Add ability to compile with nativesdk Mark Hatle
2013-05-29 15:09 ` [PATCH 7/21] dbus-glib: use BPN instead of PN Mark Hatle
2013-05-29 15:09 ` [PATCH 8/21] initscripts: let status return 0 when proc is running well Mark Hatle
2013-05-29 15:09 ` [PATCH 9/21] pull ldlinux.sys and isolinux.bin from correct places Mark Hatle
2013-05-29 15:09 ` Mark Hatle [this message]
2013-05-29 21:15   ` [PATCH 10/21] ncurses, busybox, cml1.bbclass: Fix menuconfig display corruption Richard Purdie
2013-05-29 15:09 ` [PATCH 11/21] guile: don't search for libreadline in host libdir Mark Hatle
2013-05-29 15:09 ` [PATCH 12/21] dpkg-native: Fix native perl path Mark Hatle
2013-05-29 15:09 ` [PATCH 13/21] qmake_base.bbclass:add linux-gnun32-oe-g++ to QMAKESPEC Mark Hatle
2013-05-29 15:09 ` [PATCH 14/21] portmap: /etc/init.d/portmap restart complains "command not found" Mark Hatle
2013-05-29 15:09 ` [PATCH 15/21] fix libnl two parentheses bugs in lib/cache_mngr.c file Mark Hatle
2013-05-29 15:09 ` [PATCH 16/21] bind: add ipv6 support Mark Hatle
2013-05-29 15:09 ` [PATCH 17/21] grep: fix for CVE-2012-5667 Mark Hatle
2013-05-29 21:21   ` Richard Purdie
2013-05-29 15:10 ` [PATCH 18/21] Fix problems expanding the IMAGE_INSTALL package groups Mark Hatle
2013-05-29 21:10   ` Richard Purdie
2013-05-29 21:28     ` Mark Hatle
2013-05-29 21:59       ` Richard Purdie
2013-05-30 10:46         ` Phil Blundell
2013-05-30 12:22           ` Mark Hatle
2013-05-30 20:10             ` Richard Purdie
2013-05-29 15:10 ` [PATCH 19/21] siteinfo.bbclass: Add mips64 common siteinfo Mark Hatle
2013-05-29 15:10 ` [PATCH 20/21] cracklib: Allow byte order patch to work on older Linux hosts Mark Hatle
2013-05-29 15:10 ` [PATCH 21/21] libarchive: Fix build dependencies Mark Hatle
2013-05-30  0:53 ` [PATCH 0/21] Misc patch set Saul Wold
2013-05-30  3:55   ` Mark Hatle

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=1369840203-21898-11-git-send-email-mark.hatle@windriver.com \
    --to=mark.hatle@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    /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 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.