From patchwork Wed Oct 22 09:27:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vicente Olivert Riera X-Patchwork-Id: 401966 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 7C7BC140080 for ; Wed, 22 Oct 2014 20:27:46 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 1A92C336AA; Wed, 22 Oct 2014 09:27:45 +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 O7ZTk7RuSgRv; Wed, 22 Oct 2014 09:27:42 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 73C35336AD; Wed, 22 Oct 2014 09:27:42 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 28FED1C2187 for ; Wed, 22 Oct 2014 09:27:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 25C4A920EA for ; Wed, 22 Oct 2014 09:27:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YC35tMKwObgf for ; Wed, 22 Oct 2014 09:27:32 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mailapp01.imgtec.com (mailapp01.imgtec.com [195.59.15.196]) by whitealder.osuosl.org (Postfix) with ESMTP id 121AE92062 for ; Wed, 22 Oct 2014 09:27:32 +0000 (UTC) Received: from KLMAIL01.kl.imgtec.org (unknown [192.168.5.35]) by Websense Email Security Gateway with ESMTPS id D751DC15B76A3 for ; Wed, 22 Oct 2014 10:27:27 +0100 (IST) Received: from KLMAIL02.kl.imgtec.org (10.40.60.222) by KLMAIL01.kl.imgtec.org (192.168.5.35) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 22 Oct 2014 10:27:29 +0100 Received: from LEMAIL01.le.imgtec.org (192.168.152.62) by klmail02.kl.imgtec.org (10.40.60.222) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 22 Oct 2014 10:27:29 +0100 Received: from localhost.localdomain (192.168.154.104) by LEMAIL01.le.imgtec.org (192.168.152.62) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 22 Oct 2014 10:27:28 +0100 From: Vicente Olivert Riera To: Date: Wed, 22 Oct 2014 10:27:23 +0100 Message-ID: <1413970043-16775-1-git-send-email-Vincent.Riera@imgtec.com> X-Mailer: git-send-email 1.7.1 MIME-Version: 1.0 X-Originating-IP: [192.168.154.104] Subject: [Buildroot] [PATCH v2] bash: fix linking for static builds with uClibc toolchains 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: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" ...and also use configure options instead of environment variables. bash fails to link for static builds with uClibc toolchains due to getenv redefinitions. This is caused because bash is unable to check if getenv is already defined when cross-compiling, so it defaults to 'yes': configure:14438: WARNING: cannot check getenv redefinition if cross compiling -- defaulting to yes We can avoid this redefinition by adding bash_cv_getenv_redef=no to the configure options. At the same time, we use configure options instead of environment variables because there is no need to pass those options to the configure script as environment variables. Doing it in this way we avoid the risk of environment variables leaking into places we don't expect. Related: http://lists.gnu.org/archive/html/bug-bash/2012-03/msg00052.html Fixes: http://autobuild.buildroot.net/results/a20/a2007e6dbcfe53e7cd837ae642869ee26376826a/ Signed-off-by: Vicente Olivert Riera --- package/bash/bash.mk | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/package/bash/bash.mk b/package/bash/bash.mk index 34a3a73..156652f 100644 --- a/package/bash/bash.mk +++ b/package/bash/bash.mk @@ -28,6 +28,13 @@ BASH_MAKE = $(MAKE1) # The static build needs some trickery ifeq ($(BR2_PREFER_STATIC_LIB),y) BASH_CONF_OPTS += --enable-static-link --without-bash-malloc +# Static builds with uClibc fail due to getenv redefinitions +# http://lists.gnu.org/archive/html/bug-bash/2012-03/msg00052.html +ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y) +BASH_CONF_ENV += bash_cv_getenv_redef=no +else +BASH_CONF_ENV += bash_cv_getenv_redef=yes +endif endif # Make /bin/sh -> bash (no other shell, better than busybox shells)