From patchwork Fri Dec 23 13:33:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 708433 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tlTqm1myYz9sfH for ; Sat, 24 Dec 2016 00:33:40 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 623B62DB79; Fri, 23 Dec 2016 13:33:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wUEHfmq3gBms; Fri, 23 Dec 2016 13:33:35 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 4C4A92DA7C; Fri, 23 Dec 2016 13:33:35 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 6BF321C023E for ; Fri, 23 Dec 2016 13:33:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 636C5887D9 for ; Fri, 23 Dec 2016 13:33:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Rel43gYlJ0Ua for ; Fri, 23 Dec 2016 13:33:32 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by hemlock.osuosl.org (Postfix) with ESMTP id 5458A886FF for ; Fri, 23 Dec 2016 13:33:32 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id EAF162070E; Fri, 23 Dec 2016 14:33:31 +0100 (CET) Received: from localhost (LFbn-1-6691-76.w90-120.abo.wanadoo.fr [90.120.129.76]) by mail.free-electrons.com (Postfix) with ESMTPSA id BFD4F206EA; Fri, 23 Dec 2016 14:33:31 +0100 (CET) From: Thomas Petazzoni To: buildroot@buildroot.org Date: Fri, 23 Dec 2016 14:33:30 +0100 Message-Id: <1482500010-17042-1-git-send-email-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 2.7.4 Cc: Thomas Petazzoni Subject: [Buildroot] [PATCH] util-linux: fix ncurses/wchar handling X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Since commit 006a328ad6bed214ec3c4d92120510ea37329dd1 ("util-linux: fix build with ncurses"), we have a build failure that occurs with musl toolchains when wide-char support is not enabled in ncurses. The problem comes from the fact that musl provides wchar support (so it defines wchar_t). But when ncursesw is not available, we currently pass --disable-widechar which tells util-linux that wchar support is not available at all (not only in ncurses). When this gets passed to util-linux configure script, then it defines its own wchar_t, which conflicts with the musl definition. So, we should not pass --disable-widechar when BR2_USE_WCHAR=y, which is what this commit does: it moves the BR2_USE_WCHAR logic outside of the ncurses logic, and passes --enable-widechar/--disable-widechar as appropriate. However, there's a gotcha: util-linux really wants the ncursesw variant of ncurses when the system has wchar support enabled. We take this into account by: - Enabling ncursesw when BR2_PACKAGE_NCURSES_WCHAR=y. In this case, we have ncurses and we have BR2_USE_WCHAR=y, so everything is fine. - Otherwise, enabling ncurses when BR2_PACKAGE_NCURSES=y but BR2_USE_WCHAR is disabled. To make sure that the existing util-linux programs that need ncurses support still build fine, we adjust the Config.in to select BR2_PACKAGE_NCURSES_WCHAR on BR2_USE_WCHAR=y configurations. Fixes: http://autobuild.buildroot.net/results/19de2a0b12380ddc86dbba0dae3a3877b25f83ff/ Signed-off-by: Thomas Petazzoni --- package/util-linux/Config.in | 5 +++++ package/util-linux/util-linux.mk | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/package/util-linux/Config.in b/package/util-linux/Config.in index e957f84..cfb2451 100644 --- a/package/util-linux/Config.in +++ b/package/util-linux/Config.in @@ -207,6 +207,7 @@ config BR2_PACKAGE_UTIL_LINUX_MORE bool "more" depends on BR2_USE_MMU # fork() select BR2_PACKAGE_NCURSES + select BR2_PACKAGE_NCURSES_WCHAR if BR2_USE_WCHAR help File perusal filter for crt viewing @@ -252,6 +253,7 @@ config BR2_PACKAGE_UTIL_LINUX_PG bool "pg" depends on BR2_USE_MMU # fork() select BR2_PACKAGE_NCURSES + select BR2_PACKAGE_NCURSES_WCHAR if BR2_USE_WCHAR help Browse pagewise through text files @@ -298,6 +300,7 @@ config BR2_PACKAGE_UTIL_LINUX_SETPRIV config BR2_PACKAGE_UTIL_LINUX_SETTERM bool "setterm" select BR2_PACKAGE_NCURSES + select BR2_PACKAGE_NCURSES_WCHAR if BR2_USE_WCHAR help Set terminal attributes @@ -310,12 +313,14 @@ config BR2_PACKAGE_UTIL_LINUX_SWITCH_ROOT config BR2_PACKAGE_UTIL_LINUX_TUNELP bool "tunelp" select BR2_PACKAGE_NCURSES + select BR2_PACKAGE_NCURSES_WCHAR if BR2_USE_WCHAR help Set various parameters for the lp device config BR2_PACKAGE_UTIL_LINUX_UL bool "ul" select BR2_PACKAGE_NCURSES + select BR2_PACKAGE_NCURSES_WCHAR if BR2_USE_WCHAR help Do underlining diff --git a/package/util-linux/util-linux.mk b/package/util-linux/util-linux.mk index 51ece90..414465c 100644 --- a/package/util-linux/util-linux.mk +++ b/package/util-linux/util-linux.mk @@ -45,21 +45,21 @@ ifeq ($(BR2_PACKAGE_BUSYBOX),y) UTIL_LINUX_DEPENDENCIES += busybox endif -ifeq ($(BR2_PACKAGE_NCURSES),y) -UTIL_LINUX_DEPENDENCIES += ncurses -ifeq ($(BR2_PACKAGE_NCURSES_WCHAR),y) -UTIL_LINUX_CONF_OPTS += --with-ncursesw -UTIL_LINUX_CONF_ENV += NCURSESW5_CONFIG=$(STAGING_DIR)/usr/bin/$(NCURSES_CONFIG_SCRIPTS) -else -UTIL_LINUX_CONF_OPTS += --without-ncursesw --with-ncurses --disable-widechar -UTIL_LINUX_CONF_ENV += NCURSES5_CONFIG=$(STAGING_DIR)/usr/bin/$(NCURSES_CONFIG_SCRIPTS) -endif -else ifeq ($(BR2_USE_WCHAR),y) UTIL_LINUX_CONF_OPTS += --enable-widechar else UTIL_LINUX_CONF_OPTS += --disable-widechar endif + +ifeq ($(BR2_PACKAGE_NCURSES_WCHAR),y) +UTIL_LINUX_DEPENDENCIES += ncurses +UTIL_LINUX_CONF_OPTS += --with-ncursesw +UTIL_LINUX_CONF_ENV += NCURSESW5_CONFIG=$(STAGING_DIR)/usr/bin/$(NCURSES_CONFIG_SCRIPTS) +else ifeq ($(BR2_PACKAGE_NCURSES):$(BR2_USE_WCHAR),y:) +UTIL_LINUX_DEPENDENCIES += ncurses +UTIL_LINUX_CONF_OPTS += --without-ncursesw --with-ncurses +UTIL_LINUX_CONF_ENV += NCURSES5_CONFIG=$(STAGING_DIR)/usr/bin/$(NCURSES_CONFIG_SCRIPTS) +else UTIL_LINUX_CONF_OPTS += --without-ncursesw --without-ncurses endif