From patchwork Thu May 12 17:19:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Maciej W. Rozycki" X-Patchwork-Id: 53874 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D642D3839C43 for ; Thu, 12 May 2022 17:19:51 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id AB2EF3857433 for ; Thu, 12 May 2022 17:19:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AB2EF3857433 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wr1-x433.google.com with SMTP id d5so8200652wrb.6 for ; Thu, 12 May 2022 10:19:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:message-id:user-agent:mime-version; bh=kNFpNepUxMdVmx8vGjkHAkCGcMSan0CASfDAbbx6P28=; b=ORdf/kUmFaR+YZPIKTxppvTvSUQidYTyy/q/H/0U++9UBO47/BeaJ1drmDWWcBTyVd 9qD4tXcBkYs9J7geiamQkmWh9Nk5Zyl83WRz/JFQjAZ5nUjjPsLGtS5YAdLWubWf2w1f pDEHjY9BpzB8V4Pu4/4XajoY1rx13KQsdMQQdi7HEY1a0P8YwXlUHISueXmsbfwwXRPj rjEZDMO6tUhDF8slgkYgY3BC040oCcI4p0h8kv5HLnfxn752p1FoC384kpRANpC9u8rx 6MOp1tXgNKmw2M8tpU4wjug1gD9s6ci0dK2/mFe6RuF9DcsSt+yzP+kG7FPMJRptkFHl NLHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:user-agent :mime-version; bh=kNFpNepUxMdVmx8vGjkHAkCGcMSan0CASfDAbbx6P28=; b=mCWLDYs2DcrlTSkW7o3YVGg+2DDGumm2Gdb/re8nAP+yUe6dUfLIUJc2drcaUNq2Sk uzbypVQcldxEmCfQvf9GIRID4icyaDAWAVyFlF3OivEDIxBSV2tdPP3earcx/ZgBEeJM nbnHajOtOJ3tBAFqLG6sB5dhXVkQOIujyTLInS/yeDIuDyk5xMxbHtB7HCceuLTEb9+i oEE+OmCBTjGcz+s8LAXsQ41HndaIXtsAlR22glAmCKQ4uLwoax5fEhf6FtvR5LVxYF5E oIMkmsWzu9jR42WrseYicksP+hNWCHwouxJoDBZnHOVStE3sAsDIvek5yoToutEPWrld cJFw== X-Gm-Message-State: AOAM531JapSDEgtDSNzaNSxQDjinFnc9FjahHyjRYALZfWgHXFeEI5SD KZ8nfACkMLGaHh6lcjSa1XeTNy4UpLnRNRbQ X-Google-Smtp-Source: ABdhPJz5tdtcaQncCZ7c0X1oFmZZGM3ALc1kCJYgFmNgjJM0wtGl/zG153yw269dHjGb3+mptJq9nQ== X-Received: by 2002:a5d:4747:0:b0:20a:c40b:1189 with SMTP id o7-20020a5d4747000000b0020ac40b1189mr563872wrs.509.1652375976208; Thu, 12 May 2022 10:19:36 -0700 (PDT) Received: from tpp.orcam.me.uk (tpp.orcam.me.uk. [2001:8b0:154:0:ea6a:64ff:fe24:f2fc]) by smtp.gmail.com with ESMTPSA id n27-20020adf8b1b000000b0020c5253d900sm89183wra.76.2022.05.12.10.19.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 May 2022 10:19:35 -0700 (PDT) Date: Thu, 12 May 2022 18:19:32 +0100 (BST) From: "Maciej W. Rozycki" To: libc-alpha@sourceware.org Subject: [PATCH] RISC-V: Use `as_fn_error' to report errors in `preconfigure' Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Waterman Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Unlike some other `preconfigure' fragments the RISC-V one uses `echo' and `exit' directly for error handling. Owing to the lack of any kind of error annotation it makes it difficult to spot the message in the flood in a parallel build and neither it is logged in `config.log'. Switch to using `as_fn_error' then as the fragment is sourced from the main `configure' script and therefore the function can be used like in other `preconfigure' fragments, so the message printed is such as: configure: error: glibc requires the A extension rather than plain: glibc requires the A extension and one can filter on the "error" part. --- sysdeps/riscv/preconfigure | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) glibc-riscv-preconfigure-as-fn-error.diff Index: glibc/sysdeps/riscv/preconfigure =================================================================== --- glibc.orig/sysdeps/riscv/preconfigure +++ glibc/sysdeps/riscv/preconfigure @@ -9,8 +9,7 @@ riscv*) 64 | 32) ;; *) - echo "Unable to determine XLEN" >&2 - exit 1 + as_fn_error 1 "Unable to determine XLEN" "$LINENO" 5 ;; esac @@ -20,15 +19,13 @@ riscv*) with_fp_cond=1 ;; 32) - echo "glibc does not yet support systems with the F but not D extensions" >&2 - exit 1 + as_fn_error 1 "glibc does not yet support systems with the F but not D extensions" "$LINENO" 5 ;; "") with_fp_cond=0 ;; *) - echo "Unable to determine FLEN" >&2 - exit 1 + as_fn_error 1 "Unable to determine FLEN" "$LINENO" 5 ;; esac @@ -37,15 +34,13 @@ riscv*) abi_flen=0 ;; single) - echo "glibc does not yet support the single floating-point ABI" >&2 - exit 1 + as_fn_error 1 "glibc does not yet support the single floating-point ABI" "$LINENO" 5 ;; double) abi_flen=64 ;; *) - echo "Unable to determine floating-point ABI" >&2 - exit 1 + as_fn_error 1 "Unable to determine floating-point ABI" "$LINENO" 5 ;; esac @@ -53,8 +48,7 @@ riscv*) __riscv_atomic) ;; *) - echo "glibc requires the A extension" >&2 - exit 1 + as_fn_error 1 "glibc requires the A extension" "$LINENO" 5 ;; esac