From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-18ef8aa1576so1278912fac.0 for ; Thu, 27 Apr 2023 04:56:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1682596598; x=1685188598; h=mime-version:user-agent:message-id:date:errors-to:organization :subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=Wt63fn7fiwNx2DnOu3HkgfoUSINBTsrK1tRUMmzVQA8=; b=LUhXYs+Q+CqglKR9kabmqAKbcDksvTT8foFiuhrvvVdHvITYkJdoaTkgNtkHBCDIxa MHKf5gcEupXZimajLwF0aGkuyxzE/iBoBmIrwD90ZFUuI9lZkbyklkvQJB0hSefn+4jr kytBuKnt6tfw5CPQLZbDJ3OYDp1XttSlCEpUVi1XcNMKw8qrXbUKph9cfdjynpYVazYu 8UJZHA91mdcGDvMxngqa8DpkPK8ssd78JLzYJTcRuVCEnc+OmZKljRyMqod3c1wdX05T B2cisSirWA4Xpno7m9ij+IEeMxOAAM0RtiDv6qznMDJxlHV2m13zbLVZmFKjeIi1DaPW aAoQ== 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-Google-Smtp-Source: ACHHUZ4oQefoCKAD86HnR6VrwIZHyo3q+BmGxGuy2PMqZvjMdHiHTCcv496cJw+gnB9HB7fYsKMqQw== 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 From: Alexandre Oliva To: gcc-patches@gcc.gnu.org Subject: [FYI] Use CONFIG_SHELL-/bin/sh in genmultilib Organization: Free thinker, does not speak for AdaCore Errors-To: aoliva@lxoliva.fsfla.org 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 Content-Type: text/plain 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 List-Id: 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 -- Alexandre Oliva, happy hacker https://FSFLA.org/blogs/lxo/ Free Software Activist GNU Toolchain Engineer Disinformation flourishes because many people care deeply about injustice but very few check the facts. Ask me about