From patchwork Thu Apr 27 11:56:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 88216 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp209930vqo; Thu, 27 Apr 2023 04:57:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5iOnsWbab0JDZzm4Mq3qPkgysxgJiUMUVkj1k+qDMuZ0wxmfyaGY63bjqgcr2/fdQK8iod X-Received: by 2002:a50:e604:0:b0:501:d43e:d1e5 with SMTP id y4-20020a50e604000000b00501d43ed1e5mr1510023edm.2.1682596645414; Thu, 27 Apr 2023 04:57:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682596645; cv=none; d=google.com; s=arc-20160816; b=shT6nJ96LDF1WneH5HuVN0I580VQqbjosCZMaDSHYAMA+zgHW9b9Q2SGAHdhFcKPjf l16nZ9eMPZH+rtYQcl9iNTkZ6Brxa9XYwpSER1E/zPs39HCENDaH5iUnaMwh1d0UBfGM k3O0RpEPmLhTFbP0kaqSXBiGFCdRIxmZ/93cgyc/5jdKnFxGlqJKmla8jPZqtdk3Kt1m OPva9AP1rqWak7aPQA9+MnwLIk+rGKagE0Mx9tEPEde3RKgq8RnKBYDZVDQjYdXW+2x1 JSPSUgasi8pRZ9ZzvSDI7khxysHjHUCId+/9UezdxrLOZBaE+g8ZOrrpjqpHOP8qvomq RbdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:mime-version :user-agent:message-id:date:organization:subject:to:dmarc-filter :delivered-to:dkim-signature:dkim-filter; bh=Wt63fn7fiwNx2DnOu3HkgfoUSINBTsrK1tRUMmzVQA8=; b=cDljhNy2V42jPRYbhRbYdlxOPQnIBvJV16PURScu4pQ50fxq6qbPs3rw1GVjdy5MpS YTHGx2iPFaXDQaQIMmS1L4nJPIoF58TgbiW+HAV1LvavRtUqNHomjDAU2u2HXEcwWCgL rK9c9QSP29G7/J2wd59fRAJcQak0XpI3IwsnKHgWBNbNb3m0QTNc/ZwZxkM7sRtX7Zu9 Jy/iIK4x0rj0YOqw9bU95MzrUWXRgCx5owoOM0uDkh/9fLAIsiUiTQD+OiTt2qCtLan+ 2uJH5/U3bXTY5RsqlaqJ1U9WyzN7pR8xEc6xggUDHfDGzAJVqq1ZZSHSp3zY7GgCtnDA 8veA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=o1cfexuq; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id d14-20020aa7d68e000000b005067c8073casi13205899edr.135.2023.04.27.04.57.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Apr 2023 04:57:25 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=o1cfexuq; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 51B3B3858C66 for ; Thu, 27 Apr 2023 11:57:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 51B3B3858C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682596644; bh=Wt63fn7fiwNx2DnOu3HkgfoUSINBTsrK1tRUMmzVQA8=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=o1cfexuqr2zffLYs1L6j3gisc2YabTkIb+owZUyoiXTt5l6EhBvWq3UO7tTc7XUFH HlSTzZWuubHEEL4QzhqyU25BQ1dakZG1Juzeu9Yzx24z/lxuPlKnGd8LHLQLhazrQp YaWB8e3jAWbJ00QGKMEzqfDZ58WAUhGWtQ+qVMm4= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-oa1-x2d.google.com (mail-oa1-x2d.google.com [IPv6:2001:4860:4864:20::2d]) by sourceware.org (Postfix) with ESMTPS id 02DA33858D33 for ; Thu, 27 Apr 2023 11:56:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 02DA33858D33 Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-18ef8aa1576so1278912fac.0 for ; Thu, 27 Apr 2023 04:56:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682596598; x=1685188598; h=mime-version:user-agent:message-id:date:errors-to:organization :subject:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Wt63fn7fiwNx2DnOu3HkgfoUSINBTsrK1tRUMmzVQA8=; b=T8AGR8JZb5zpWekRa+LMXXIo8eqeNwDplg7hnPJohB34nnHPCtD+3LCh8Iuzu4KXjN mxBYFBBcK9YyjdK5Nnp64jnYQMOd7aqft7qX8BEWQuZHay3v4eVfHtybqGfyarKk+Qg9 JrD3UUVJTAQeW5O1aRG2nLNthKglhFK8ZVDuvCZSX13FtSOLLUY01wxO4Y8B/nKpVpHk 58bvgdlYDcQAifQVpKYWbdJHPme4r4WxK6WpMHtVUjSnbYEJCNOuA6O1d+BD9qwNd6cr D8Jayd3w5woh6z/crAQXOAfyWAwWlR6NXTq4RMeddtzJaVQsY6Q6KdgNcvfX19vi7AyG IFXQ== X-Gm-Message-State: AC+VfDy2WzQ1FEyeJ2DoLZ+k6BtH1qp7EA4xPr5EYahCuNo3pgyjUgtP 8oWUnwutSrzhi2B28S65kbbE4ZknEXJMARRmHas= X-Received: by 2002:a05:6870:c79c:b0:18f:57e:9ef1 with SMTP id dy28-20020a056870c79c00b0018f057e9ef1mr696232oab.56.1682596598209; Thu, 27 Apr 2023 04:56:38 -0700 (PDT) Received: from free.home ([2804:7f1:2080:112e:6b9f:4a49:b083:4727]) by smtp.gmail.com with ESMTPSA id o16-20020a4a2c10000000b0054574f35b8esm8243269ooo.41.2023.04.27.04.56.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Apr 2023 04:56:37 -0700 (PDT) Received: from livre (livre.home [172.31.160.2]) by free.home (8.15.2/8.15.2) with ESMTPS id 33RBuRR02459324 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 27 Apr 2023 08:56:28 -0300 To: gcc-patches@gcc.gnu.org Subject: [FYI] Use CONFIG_SHELL-/bin/sh in genmultilib Organization: Free thinker, does not speak for AdaCore Date: Thu, 27 Apr 2023 08:56:27 -0300 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Alexandre Oliva via Gcc-patches From: Alexandre Oliva Reply-To: Alexandre Oliva Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764330460170230370?= X-GMAIL-MSGID: =?utf-8?q?1764330460170230370?= There are still shells on some systems that lack the ability to start scripts when not using the shell name explicitly. Adjust genmultilib to use ${CONFIG_SHELL-/bin/sh} the same way configure does. Regstrapped on x86_64-linux-gnu. Also built riscv64-elf on an affected platform. I'm checking this in. for gcc/ChangeLog * genmultilib: Use CONFIG_SHELL to run sub-scripts. --- gcc/genmultilib | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/gcc/genmultilib b/gcc/genmultilib index f8bd90b116cd1..6683c3490266f 100644 --- a/gcc/genmultilib +++ b/gcc/genmultilib @@ -170,23 +170,23 @@ if [ "$#" != "0" ]; then all=${initial}`echo $first | sed -e 's_|_/_'g` first=`echo $first | sed -e 's_|_ _'g` echo ${all}/ - initial="${initial}${all}/" ./tmpmultilib $@ - ./tmpmultilib $first $@ | grep -v "^${all}" + initial="${initial}${all}/" ${CONFIG_SHELL-/bin/sh} ./tmpmultilib $@ + ${CONFIG_SHELL-/bin/sh} ./tmpmultilib $first $@ | grep -v "^${all}" ;; *) for opt in `echo $first | sed -e 's|/| |'g`; do echo ${initial}${opt}/ done - ./tmpmultilib $@ + ${CONFIG_SHELL-/bin/sh} ./tmpmultilib $@ for opt in `echo $first | sed -e 's|/| |'g`; do - initial="${initial}${opt}/" ./tmpmultilib $@ + initial="${initial}${opt}/" ${CONFIG_SHELL-/bin/sh} ./tmpmultilib $@ done esac fi EOF chmod +x tmpmultilib -combinations=`initial=/ ./tmpmultilib ${options}` +combinations=`initial=/ ${CONFIG_SHELL-/bin/sh} ./tmpmultilib ${options}` # If there exceptions, weed them out now if [ -n "${exceptions}" ]; then @@ -210,7 +210,7 @@ cat >>tmpmultilib2 <<\EOF done EOF chmod +x tmpmultilib2 - combinations=`./tmpmultilib2 ${combinations}` + combinations=`${CONFIG_SHELL-/bin/sh} ./tmpmultilib2 ${combinations}` fi # If the MULTILIB_REQUIRED list are provided, @@ -236,7 +236,7 @@ cat >>tmpmultilib2 <<\EOF EOF chmod +x tmpmultilib2 - combinations=`./tmpmultilib2 ${combinations}` + combinations=`${CONFIG_SHELL-/bin/sh} ./tmpmultilib2 ${combinations}` fi @@ -348,12 +348,12 @@ if [ "$#" = "0" ]; then else first=$1 shift - dirout="${dirout}" optout="${optout}" ./tmpmultilib2 $@ + dirout="${dirout}" optout="${optout}" ${CONFIG_SHELL-/bin/sh} ./tmpmultilib2 $@ l=`echo ${first} | sed -e 's/=.*$//' -e 's/?/=/g'` r=`echo ${first} | sed -e 's/^.*=//' -e 's/?/=/g'` if expr " ${optout} " : ".* ${l} .*" > /dev/null; then newopt=`echo " ${optout} " | sed -e "s/ ${l} / ${r} /" -e 's/^ //' -e 's/ $//'` - dirout="${dirout}" optout="${newopt}" ./tmpmultilib2 $@ + dirout="${dirout}" optout="${newopt}" ${CONFIG_SHELL-/bin/sh} ./tmpmultilib2 $@ fi fi EOF @@ -453,14 +453,14 @@ chmod +x tmpmultilib4 # correct list of options and negations. for combo in ${combinations}; do # Use the directory names rather than the option names. - dirout=`./tmpmultilib3 "${combo}" "${todirnames}" "${toosdirnames}" "${enable_multilib}"` + dirout=`${CONFIG_SHELL-/bin/sh} ./tmpmultilib3 "${combo}" "${todirnames}" "${toosdirnames}" "${enable_multilib}"` # Look through the options. We must output each option that is # present, and negate each option that is not present. - optout=`./tmpmultilib4 "${combo}" "${options}"` + optout=`${CONFIG_SHELL-/bin/sh} ./tmpmultilib4 "${combo}" "${options}"` # Output the line with all appropriate matches. - dirout="${dirout}" optout="${optout}" ./tmpmultilib2 + dirout="${dirout}" optout="${optout}" ${CONFIG_SHELL-/bin/sh} ./tmpmultilib2 done # Terminate the list of string. @@ -491,11 +491,11 @@ for rrule in ${multilib_reuse}; do if expr "${combinations} " : ".*/${combo}/.*" > /dev/null; then if echo "/${copts}/" | grep -E "${options_re}" > /dev/null; then combo="/${combo}/" - dirout=`./tmpmultilib3 "${combo}" "${todirnames}" "${toosdirnames}" "${enable_multilib}"` + dirout=`${CONFIG_SHELL-/bin/sh} ./tmpmultilib3 "${combo}" "${todirnames}" "${toosdirnames}" "${enable_multilib}"` copts="/${copts}/" - optout=`./tmpmultilib4 "${copts}" "${options}"` + optout=`${CONFIG_SHELL-/bin/sh} ./tmpmultilib4 "${copts}" "${options}"` # Output the line with all appropriate matches. - dirout="${dirout}" optout="${optout}" ./tmpmultilib2 + dirout="${dirout}" optout="${optout}" ${CONFIG_SHELL-/bin/sh} ./tmpmultilib2 else echo "The rule ${rrule} contains an option absent from MULTILIB_OPTIONS." >&2 exit 1