From patchwork Sat Oct 15 21:14:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnout Vandecappelle X-Patchwork-Id: 682620 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 3sxHKb4vqRz9s9x for ; Sun, 16 Oct 2016 08:14:43 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 90ED8313EB; Sat, 15 Oct 2016 21:14:40 +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 ZWSUcKKWh-7S; Sat, 15 Oct 2016 21:14:37 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 94076312D1; Sat, 15 Oct 2016 21:14:37 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 2DED21C16AB for ; Sat, 15 Oct 2016 21:14:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 097C6312D1 for ; Sat, 15 Oct 2016 21:14:36 +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 OeIfNYldDNQu for ; Sat, 15 Oct 2016 21:14:34 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from exchange.essensium.com (220.77.144.195.ipv4.evonet.be [195.144.77.220]) by silver.osuosl.org (Postfix) with ESMTPS id 2799C312BA for ; Sat, 15 Oct 2016 21:14:34 +0000 (UTC) Received: from localhost.localdomain (10.3.7.11) by beleexch01.local.ess-mail.com (10.3.7.8) with Microsoft SMTP Server (TLS) id 15.0.847.32; Sat, 15 Oct 2016 23:14:12 +0200 From: "Arnout Vandecappelle (Essensium/Mind)" To: Date: Sat, 15 Oct 2016 23:14:11 +0200 Message-ID: <20161015211411.810-1-arnout@mind.be> X-Mailer: git-send-email 2.9.3 MIME-Version: 1.0 X-Originating-IP: [10.3.7.11] X-ClientProxiedBy: beleexch01.local.ess-mail.com (10.3.7.8) To beleexch01.local.ess-mail.com (10.3.7.8) Cc: Pascal Speck Subject: [Buildroot] [PATCH] gzip: force shell shebang to /bin/sh 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" gzip's configure uses $SHELL to find a POSIX-compliant shell to put in the shebang of its shell scripts (zcat, gzexe, ...). However, we set $SHELL to /bin/bash in the Makefile, which may not be present on the target. We do make sure that /bin/sh always points to a valid shell on the target so we can use that. The configure discovery is completely broken for cross-compilation. The same $SHELL is used during the build (it is used by make to run the commands in rules) and on the target. Also, the checks for a valid shell use the host shell, not the target shell. We could try to patch gzip to fix that, but the checks can anyway not be run for the target shell, so we'll have to override it with a cache value anyway. So we can just as well do exactly that, without patching. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) Reported-by: Pascal Speck --- package/gzip/gzip.mk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/package/gzip/gzip.mk b/package/gzip/gzip.mk index 6dc910e..c4e91b0 100644 --- a/package/gzip/gzip.mk +++ b/package/gzip/gzip.mk @@ -14,5 +14,12 @@ GZIP_DEPENDENCIES = $(if $(BR2_PACKAGE_BUSYBOX),busybox) GZIP_LICENSE = GPLv3+ GZIP_LICENSE_FILES = COPYING GZIP_CONF_ENV += gl_cv_func_fflush_stdin=yes +# configure substitutes $(SHELL) for the shell shebang in scripts like +# gzexe. Unfortunately, the same $(SHELL) variable will also be used by +# make to run its commands. Fortunately, /bin/sh is always a POSIX shell +# on both the target and host systems that we support. Even with this, +# the configure check is slightly broken and prints a bogus warning: +# "using /bin/sh, even though it may have file descriptor bugs" +GZIP_CONF_ENV += ac_cv_path_shell=/bin/sh $(eval $(autotools-package))