From patchwork Tue Oct 24 15:53:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 157608 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp2037785vqx; Tue, 24 Oct 2023 08:53:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGT9+ZINb1s02BUyXYoJKAX3kpLJiE7fj2623Yb4PQ6Xy9vFqdyT2gRg1aG7wGb5wHRyHDs X-Received: by 2002:a05:622a:134c:b0:41c:c5bd:724 with SMTP id w12-20020a05622a134c00b0041cc5bd0724mr14920545qtk.13.1698162824886; Tue, 24 Oct 2023 08:53:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698162824; cv=pass; d=google.com; s=arc-20160816; b=iPUQ/W/78sLVp9m1KCc2lqlNY4sW95c14V8TDXbj7gk4AhDHBzZKAnWywPVH2aQCxb ZgORbfZR6v1LSHccUOt7NsMBQ1WoABJTj4frrM0FPFjYmilYaDDsUYspa6ELhEqEeUqt ovb33WAaF5VWXnN0Iwce807bpPqDFtcR9SMGM8zG4Tj1i0emsDRRUy6tPqsmNDTGUpZV NEDaRus2jOYwDK7Y7rdSQ1il0S43UwJtGcjft/XQmsdUq+mYj0sQ3p8U5uGCX8vdTacI bTI7Sxa2+Tn8qPyevc0Y2xsYEIELSsFrKfpr30IzOirJLnLhyAvX1QrIKA8KDDrND/um H7Sw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:reply-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=4iYdn4BVazTzb/eWGDIjUFWNQkWkPBom3clcmgASCKk=; fh=3uhICmi/NQp8DF4nv0zQ1qyIFKnLzz9b2x3+J41oxxc=; b=xtqiv0Wnz0VKgFtMhq/Lqp/BsOZyqfGBMAb3S8X/q8J0NgrSIFZ2tbN0I2M5Ck7gAQ kzVu5zpVKKAQX1ho2wRRwKogZ1mJfpS+1tPHTz4XgMIvveFTIFYld7mlTTmyPTObQiUw 0S8nXOr8ak7hpeQD86EbiBZuc3Oddse8WXC4+Sug4opCeMr+rMkXPXcXLgZr8Rl0qfVx Jj9oaPxMInInJaqoBl+AUvapzFf5865KS81b8P+AfDP5EKWohlbZuSP/fBTWJy5dGjXv 7KTbwGWc6OEwEmRfqaeRnrX8HRLCV3IyhtuUDSwQj8liNmZec4TsiJdX11MlasSU0uiq ja0A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=mGd745l8; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id t7-20020a05622a01c700b004198727ea19si7296784qtw.528.2023.10.24.08.53.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 08:53:44 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=mGd745l8; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8D66638582BD for ; Tue, 24 Oct 2023 15:53:44 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by sourceware.org (Postfix) with ESMTPS id 544E73858CDA for ; Tue, 24 Oct 2023 15:53:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 544E73858CDA Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 544E73858CDA Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::332 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698162802; cv=none; b=opnyA7c56b5ocmK3mT6SHoKjkHFHMdLLfZ5I7KU3qFWNXIcplY23DIjKLzpWF+/k1v81266a+g0JkedrKmIClPhUGt46kXyHTkpoJTGO8MvePoCzJ7uFvAkuntJGKtiyeX1BIHrbwQ2zo5LpY6+a/vD3Ea5qHeMVmyjKxCIQVtw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698162802; c=relaxed/simple; bh=HD4WKW19jE1Ay4QcwLMc7u/6c9IWzJy99LHalXwhHQw=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=KSmCqZwjI1Iv60lBcvJ8INj/i5u3z1F4WorpSa7aGci2nx79BAiQd8RkpD5uROQtFjfn924bjyBAHr+i4ath+3xqYiGhiZT59Qy1Uk4dsfR6KwS5DY+lsX9EXg1VF6cpQ1beArJqt+0bSAdYdQccNfsCBmF2PrNgcDbD0FaPsig= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-40859c464daso27433295e9.1 for ; Tue, 24 Oct 2023 08:53:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698162800; x=1698767600; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:reply-to:message-id:date :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=4iYdn4BVazTzb/eWGDIjUFWNQkWkPBom3clcmgASCKk=; b=mGd745l8G2Hu7RcwTd54N34mCiXnpA82qDtIaDxkrgI7zGR9SBGOSz07/9qUxhMuOO 9wJekyVIPU0b/gJZs1m7bByP9zg6s0T1t8xvd+zrtO79w49CkFAMgv1wMUZ60e4fkiNn xMaEZNE53OwZ/VWUuAllmtlpDYXEohOkkEWpKWYdjdhKXrhYiBUP5H+jtN+CeSFZn79A A2l7g8+bhwxuydFnjkKYnZm78UhNRHZ5g4T3XTQgcJViP0YuTgBvjClKF04kljpJLlJb QedfTLgUbYJXLb+rZ7P1NFjFFWY4ZazHVdXPRJjl0UzAlxwbOOqP7WhDt3cZdpzH3CJ9 J2+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698162800; x=1698767600; h=content-transfer-encoding:mime-version:reply-to:message-id:date :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=4iYdn4BVazTzb/eWGDIjUFWNQkWkPBom3clcmgASCKk=; b=DhRD0GYHkrszmHoFGO8W2gFtxbXQKRgpX/uN45ofHpNMZ9kLumGKVWOLLkH0oWM1ja kckaGWdNl8hv4IQSKN2Ff358yfZjw0qBZfPHDjAHoV3sKzxEi+/PEnqMRskaSHrseVpB r0CBXNDiZhUv89O7a/CIiJMiGPIXwMQ6ByceGZJVUBDvr334FZwNMOMC2XmbdfHpuMjG ECh/pIaqTUABG/uI8b6t46buDNKNCApCRylq0VEDhcCWQHr+Jvs3+aUitbL/bCb1y07L i9qaJ0Oqwczw3vL2P2EFTB4F4Llq+qgUYun3WrIqWxPrW1zZYRQhhtJDAcD/RZ3m4gTt 1Ydg== X-Gm-Message-State: AOJu0YxEifirci4nSGVnRJliWpPxMw3k1uwtRc7JmswqaGzeF4qMirnf Eb2satnf7qYiTKV63eZhusiFTS80e04= X-Received: by 2002:a05:600c:3594:b0:408:59d4:f3d8 with SMTP id p20-20020a05600c359400b0040859d4f3d8mr8013370wmq.18.1698162799418; Tue, 24 Oct 2023 08:53:19 -0700 (PDT) Received: from localhost.localdomain (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.gmail.com with ESMTPSA id v21-20020a05600c12d500b004081a011c0esm16760272wmd.12.2023.10.24.08.53.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 24 Oct 2023 08:53:19 -0700 (PDT) From: Iain Sandoe X-Google-Original-From: Iain Sandoe To: gcc-patches@gcc.gnu.org Cc: Richard.Earnshaw@foss.arm.com Subject: [PATCH] config, aarch64: Use a more compatible sed invocation. Date: Tue, 24 Oct 2023 16:53:18 +0100 Message-Id: <20231024155318.65081-1-iain@sandoe.co.uk> X-Mailer: git-send-email 2.39.2 (Apple Git-143) MIME-Version: 1.0 X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: iain@sandoe.co.uk Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780652782407702765 X-GMAIL-MSGID: 1780652782407702765 Although this came up initially when working on the Darwin Arm64 port, it also breaks cross-compilers on platforms with non-GNU sed. Tested on x86_64-darwin X aarch64-linux-gnu, aarch64-darwin, aarch64-linux-gnu and x86_64-linux-gnu. OK for master? thanks, Iain --- 8< --- Currently, the sed command used to parse --with-{cpu,tune,arch} are using GNU-specific extension to the -e (recognising extended regex). This is failing on Darwin, which defaults to Posix behaviour for -e. However '-E' is accepted to indicate an extended RE. Strictly, this is also not really sufficient, since we should only require a Posix sed (but it seems supported for BSD-derivatives). gcc/ChangeLog: * config.gcc: Use -E to to sed to indicate that we are using extended REs. Signed-off-by: Iain Sandoe --- gcc/config.gcc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gcc/config.gcc b/gcc/config.gcc index 606d3a8513e..a7216907261 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -4199,8 +4199,8 @@ case "${target}" in fi for which in cpu arch tune; do eval "val=\$with_$which" - base_val=`echo $val | sed -e 's/\+.*//'` - ext_val=`echo $val | sed -e 's/[a-z0-9.-]\+//'` + base_val=`echo $val | sed -E 's/\+.*//'` + ext_val=`echo $val | sed -E 's/[a-z0-9.-]+//'` if [ $which = arch ]; then def=aarch64-arches.def @@ -4232,9 +4232,9 @@ case "${target}" in while [ x"$ext_val" != x ] do - ext_val=`echo $ext_val | sed -e 's/\+//'` - ext=`echo $ext_val | sed -e 's/\+.*//'` - base_ext=`echo $ext | sed -e 's/^no//'` + ext_val=`echo $ext_val | sed -E 's/\+//'` + ext=`echo $ext_val | sed -E 's/\+.*//'` + base_ext=`echo $ext | sed -E 's/^no//'` opt_line=`echo -e "$options_parsed" | \ grep "^\"$base_ext\""` @@ -4245,7 +4245,7 @@ case "${target}" in echo "Unknown extension used in --with-$which=$val" 1>&2 exit 1 fi - ext_val=`echo $ext_val | sed -e 's/[a-z0-9]\+//'` + ext_val=`echo $ext_val | sed -E 's/[a-z0-9]+//'` done true