From patchwork Tue Dec 3 00:14:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Santos X-Patchwork-Id: 1203378 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="l78BrNVA"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47RjCP1ztqz9sPT for ; Tue, 3 Dec 2019 11:14:24 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 5660B86499; Tue, 3 Dec 2019 00:14:20 +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 WwKMei8v7l+z; Tue, 3 Dec 2019 00:14:18 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 22DD386B3C; Tue, 3 Dec 2019 00:14:18 +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 954F71BF38D for ; Tue, 3 Dec 2019 00:14:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 916B722053 for ; Tue, 3 Dec 2019 00:14:17 +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 WZkwih1F1HlU for ; Tue, 3 Dec 2019 00:14:16 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qt1-f195.google.com (mail-qt1-f195.google.com [209.85.160.195]) by silver.osuosl.org (Postfix) with ESMTPS id 5F218203D2 for ; Tue, 3 Dec 2019 00:14:16 +0000 (UTC) Received: by mail-qt1-f195.google.com with SMTP id g1so1827982qtj.6 for ; Mon, 02 Dec 2019 16:14:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=iQ/+DszTUCSxypPRi0Lb+GeK7B7NfHLA58Mjzy4UynI=; b=l78BrNVAb8u7rELRkwaaMhxXuYXd43wCYPWZnVI5EDV9p1MF6KNdl2oNbrwv/AB6sV anxOxwjDWamaICb8/CtlYqTNFCRxjPpAAB/UKfR7h3vWQ30HUh81QNo15+c16PIUA4Bu 2wb+DiZwVHGLx/FPB6CzZNAClJPhbh9ILZP2uHUjKltmgcOd+4IvC+CxSf1WoQkAxGRW XnOYhEb4+x4Gjx3sviqDfOeq6SgPJmUH0fyLVI/MUza784FyUD5PBJCHhBO+1jfBz+cw /L67noDeld3Solp05HiuPxxTJxd9xXtkhE6z61yqZZr7ZCO/liXF1WVRgmp4Cdfp00Lp w7Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=iQ/+DszTUCSxypPRi0Lb+GeK7B7NfHLA58Mjzy4UynI=; b=ugiX4iaAA3brFX/uCf3lLM5ysqGbxldDm8kQ3gflhadwc2iasCXrausZTsXiu7nmbB aJrYIu6jPV/wIPnxQCmVLdnAgpGMAWjxB02P+8c5JFyjdE871kgcjRzLHs4N1XWSrm3x EAVHowCfSRAoJLoyiS2xHxCOoK21MmTs8wZtfKg83G3WLwKTMdXsQyf3JY24RuFXGTW5 1IRy+d6He09IzA9o+U7CakgFw2USMkFfTCsFjfXeS6hcuwENzyE9Ud5jW4aUU5Zym5+n e6XTTs/UIrRT2efUe3HmbK0nYESnoYtIN2uspxTT/ZMYeyfUqpBjAIpZa9tLGI/ojJjo Q8qg== X-Gm-Message-State: APjAAAW5bq4UITWKOQSsTL9xPotEHlgH/f79wubPmtop0DI9cAyLJwgm e499V9Xis217sd5NCsu8rZe5ZL+3 X-Google-Smtp-Source: APXvYqzX8EEJEXdrRLAvs2zlq7pxjIDaId6LprRBtWkdznS9nI0pe64EjZbANME56s+x0r3FRKVdTA== X-Received: by 2002:ac8:104:: with SMTP id e4mr2402063qtg.37.1575332054979; Mon, 02 Dec 2019 16:14:14 -0800 (PST) Received: from casantos.remote.csb (179.187.78.17.dynamic.adsl.gvt.net.br. [179.187.78.17]) by smtp.gmail.com with ESMTPSA id m29sm740123qtf.1.2019.12.02.16.14.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 16:14:14 -0800 (PST) From: unixmania@gmail.com To: buildroot@buildroot.org Date: Mon, 2 Dec 2019 21:14:05 -0300 Message-Id: <20191203001405.12984-1-unixmania@gmail.com> X-Mailer: git-send-email 2.18.1 Subject: [Buildroot] [PATCH] package/glibc: drop dependency of utilities on bash X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Carlos Santos , Romain Naour MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Carlos Santos The dependency was added because ldd uses bash-specific syntax to localize messages. Add a post-patch hook, instead, to replace the occurrences of $"foo" by "foo", simply, so the code becomes POSIX sh compliant if bash is not selected. Also set the configuration environment accordingly to replace the /bin/bash hashbang by /bin/sh. Signed-off-by: Carlos Santos --- package/glibc/Config.in | 4 ---- package/glibc/glibc.mk | 11 ++++++++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/package/glibc/Config.in b/package/glibc/Config.in index b8c2573d96..7b2f246947 100644 --- a/package/glibc/Config.in +++ b/package/glibc/Config.in @@ -11,10 +11,6 @@ endif config BR2_PACKAGE_GLIBC_UTILS bool "Install glibc utilities" - depends on BR2_PACKAGE_BASH help Enabling this option will compile and install the getconf, ldconfig, ldd and locale glibc utilities for the target. - -comment "glibc utilities need bash" - depends on !BR2_PACKAGE_BASH diff --git a/package/glibc/glibc.mk b/package/glibc/glibc.mk index 8eafa55ae1..1b38f8aedb 100644 --- a/package/glibc/glibc.mk +++ b/package/glibc/glibc.mk @@ -74,10 +74,19 @@ endef endif GLIBC_CONF_ENV = \ - ac_cv_path_BASH_SHELL=/bin/bash \ + ac_cv_path_BASH_SHELL=/bin/$(if $(BR2_PACKAGE_BASH),bash,sh) \ libc_cv_forced_unwind=yes \ libc_cv_ssp=no +# POSIX shell does not support localization, so remove the corresponding +# syntax from ldd if bash is not selected. +ifeq ($(BR2_PACKAGE_BASH),) +define GLIBC_LDD_NO_BASH + $(SED) 's/$$"/"/g' $(@D)/elf/ldd.bash.in +endef +GLIBC_POST_PATCH_HOOKS += GLIBC_LDD_NO_BASH +endif + # Override the default library locations of /lib64/ and # /usr/lib64// for RISC-V. ifeq ($(BR2_riscv),y)