From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id Zvh8DiAFuWp8gwwAWB0awg (envelope-from ) for ; Sun, 27 Sep 2026 07:59:28 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=foss.st.com header.i=@foss.st.com header.a=rsa-sha256 header.s=selector2 header.b=j5V3BzOr; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 283991E033; Sun, 27 Sep 2026 07:59:28 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id B1CE91E033 for ; Sun, 27 Sep 2026 07:59:23 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 833954BA23E2 for ; Sun, 27 Sep 2026 11:59:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 833954BA23E2 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=foss.st.com header.i=@foss.st.com header.a=rsa-sha256 header.s=selector2 header.b=j5V3BzOr Received: from GVXPR05CU001.outbound.protection.outlook.com (mail-swedencentralazlp170130007.outbound.protection.outlook.com [IPv6:2a01:111:f403:c202::7]) by sourceware.org (Postfix) with ESMTPS id 8AA114BA23CD; Sun, 27 Sep 2026 11:57:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8AA114BA23CD Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=foss.st.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8AA114BA23CD Authentication-Results: sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:c202::7 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1790510247; cv=pass; b=eq4Xcj9x06xcsxoaePg7XO8a++mFmxmU3DI4+FmHqgTFEyPf9MfVGOPCTF8tSnu7ORNm37M2ZOScT4shz8lBE7a/H5WLsF0AHjbJPGOsXX5g2RPlIlArHINgVt8SkFlgNGfucMpYHhZ9MgAWuWcMMLHRgZ/OpnH7J0TDtWcN//0= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1790510247; c=relaxed/simple; bh=DFBzAxzj/BfjelfGZr02MDPszuyKVrr9wjqCRrxKgh8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=tLJBfYqKHdeSc2JfY7eaqOFxMBqaDmzK1/vWTobhKyaez0K1zWhP1eUrFD2+jIPjwUByt+qm6zlAr/lzf/gZnwbHDNY93VnryPpCwo6LPsseMr6iW5jG3oZys1lnpa+FxmZ1GqmDwmCcVm/3P/kYTVQPJXoTAFRN9oJ56FvPjew= ARC-Authentication-Results: i=2; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=foss.st.com header.i=@foss.st.com header.a=rsa-sha256 header.s=selector2 header.b=j5V3BzOr DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8AA114BA23CD ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Q1ANbwPP/gU8jLXP0EfAuH39F4+D9nPr84Ad0PMx/jI2x8rSLVlhIjqHUc8HMLWg1NhLKWCVyIWOz8s5ua7ZUdMsDJHnrtANw1Ba5vQlWrOzmCcZD04CUA9EQgafnMgYR6/bdnyGpdqP05mh571xprW1f+KDjTMHi81ovGahLoMuDSaUg/h+d4INsIhkvu5Ejh9fk3kAYipIrEAT1qhe34qgaaHYARNG/pi8BU9gCXdE8mmbTMo9w7lgTTR9fkxPSD0pky5tRPDC6fdg24M7tpcM/82+Px4cU15xR9QFjSRpfBjmbdclzrZb/RAhOna7gC5dLA838vXJPDCEHDB2Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=xNdBvsrqvygd3SZpojkZXpHll2rI9HExdQXkBrWmf7U=; b=oA7l/xsIu3JPQ6xJYX3liBVeVGguvRbhHmK6xRLpWAA7q9MmXYgHRUJwXm15t4HIkBg2GWXHcXpaQbDcz2Tjr9H/7Rcop7vcqAwejW7orsAycJicUNkrDltzsDukCErlH8DQVp9oj9bBUTDGgyTEj/w+kTF8dPLcmtcq2N0xFvbwNF+7G0Dv/clqDHgvmKco9j3wf23XI/Si/xMPFsdRETIo6O288zu5SfqV0O8WvBBh36BXrYF6CQRIEIZCk9Js7z503k8TUgefRa5CrIU/vekiZvvVywycwr2NNrQwUVCn8+Yeec30MZKPKR+fm1rLt/tBq0sd6nx7eVovjiOjwg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 164.130.1.59) smtp.rcpttodomain=sourceware.org smtp.mailfrom=foss.st.com; dmarc=fail (p=none sp=none pct=100) action=none header.from=foss.st.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xNdBvsrqvygd3SZpojkZXpHll2rI9HExdQXkBrWmf7U=; b=j5V3BzOrnaQ+rWolgmxdTtVWwdKWpEoIhINOoKfC/rDxmXvI9Y+2Cy+MoX0JS1o87TE5gBNAqO+bxkfxxRH4T9N9p/946b2aJT6ftc8umgO9e4ZWCdO0UxcoGh7QyTVrZIUGvwhAOtKZIpy5E3BZKyQ3ZrLfs7fC/dTq3+Kn+cahhaVOOy986eMIHW+rWWZhNJH4J9TRmm8hMgSSDbnBBg4LIVozPjkwEF4WRtsD/kckrZsSTwlj/YJT6GIEOt0Nl75eCkbqpoI6xvlwUd9RV4Qz1hEnKxCa3O9pTe9Y7ilxD6cpqcYxd6+WaZrhnHWdRR2JEhqTZiExyBufaMRKag== Received: from DU6P191CA0053.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:53e::23) by DBAPR10MB4009.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:1b6::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.451.23; Sun, 27 Sep 2026 11:57:18 +0000 Received: from MAD0EPF000008B5.eurprd04.prod.outlook.com (2603:10a6:10:53e:cafe::19) by DU6P191CA0053.outlook.office365.com (2603:10a6:10:53e::23) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.451.23 via Frontend Transport; Sun, 27 Sep 2026 11:57:18 +0000 X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; spf=fail (sender IP is 164.130.1.59) smtp.mailfrom=foss.st.com; dkim=none (message not signed) header.d=none;dmarc=fail action=none header.from=foss.st.com; Received-SPF: Fail (protection.outlook.com: domain of foss.st.com does not designate 164.130.1.59 as permitted sender) receiver=protection.outlook.com; client-ip=164.130.1.59; helo=smtpO365.st.com; Received: from smtpO365.st.com (164.130.1.59) by MAD0EPF000008B5.mail.protection.outlook.com (10.167.241.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.472.14 via Frontend Transport; Sun, 27 Sep 2026 11:57:17 +0000 Received: from STKDAG1NODE2.st.com (10.75.128.133) by smtpo365.st.com (10.250.44.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.43; Sun, 27 Sep 2026 14:03:48 +0200 Received: from jkgcxl0012.jkg.st.com (10.74.22.122) by STKDAG1NODE2.st.com (10.75.128.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.43; Sun, 27 Sep 2026 13:57:16 +0200 From: =?UTF-8?q?Torbj=C3=B6rn=20SVENSSON?= To: , CC: =?UTF-8?q?Torbj=C3=B6rn=20SVENSSON?= Subject: [PATCH] configure: Support --with-zstd=PATH Date: Sun, 27 Sep 2026 13:48:30 +0200 Message-ID: <20260927115704.1214794-1-torbjorn.svensson@foss.st.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.74.22.122] X-ClientProxiedBy: STKCAS1NODE1.st.com (10.75.128.134) To STKDAG1NODE2.st.com (10.75.128.133) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MAD0EPF000008B5:EE_|DBAPR10MB4009:EE_ X-MS-Office365-Filtering-Correlation-Id: 5bb06c98-d20d-4ff3-f7c6-08df1c8e7ac9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|36860700016|23010399003|376014|1800799024|42112799006|10067099003|11063799006|18002099003|56012099006; X-Microsoft-Antispam-Message-Info: SNeAlnz+1OSZ0PqLFu8ne4cKvcZ8qt3POY51/ugMyfyIVXOPOGtRxxAyoAPfIJPwYBgT7Oh3RXQTcJoFHaoK7HyVPbtI8cvR9HLDlu384q1k0YHIm2y8OeyL7o98r1B7pZqRN+abZwcvMHYhuXvWrSP93Y90+xeM+5gXSJTFjPSHRrNem0dWHUeHH/9XgEX7wNLLIiTiHHjmzEMa2p3JRpSbGyqE8JCx0yjIvhwaAbCO8PASldgyl0wq2hVCeXq9Z/egqA0TgP1zrXAdByc5r5jV0swyQ+VKSppptZf5xKaeSvk8OB6J2MMkMVJUYz1g9UWAQgDcvWbuWqt5rx7ZcWp5C1Vl+11GKV/qzvMO4gVZepTuM3izVYuJQdh/gdVy7OcemD8BmuwRPBlZOo/RL9A/Ub6pgHDDeqfpGiZiUE28ePlkSkR0bJPNYVqVYa+r6YfCW3w10wkiw/QfgMPzIUQFdIL3mtnboqo19Jv53fFvJN9dHZ8upM7xhzengHlUUIvXK4IeKhanXbn7Os52NP0bWCRZYDsIocGMQqEUGt85Hi9zwe81yLP/sotE1Jlop5+5yhP6JvGKhpZ9Tt0udfJ3Ozh6W6igikn6NO2AwygXLUn5r01NelGV/KAdisxAq8ZPctw/kd1VC60ySx0h0AuyzNntohgQQx2jnPYLm1u6sa1WKsq/5NnXgxc8m4HpEPaKMwdzEWNekszWVLe38A== X-Forefront-Antispam-Report: CIP:164.130.1.59; CTRY:IT; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:smtpO365.st.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(82310400026)(36860700016)(23010399003)(376014)(1800799024)(42112799006)(10067099003)(11063799006)(18002099003)(56012099006); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fOV5anvy0YexYNZY7Hq1rmhoJra39lGPQdII4Muz1g7LRPF84jd2lOrT7/5kqtYWKYKpBkOI329zrkL6wGms4qXddTbYtGaUpD7xsD+sBQgl/Nf5KaSiPiJ3qKmJ/0Gf7t7xX0HUIWcjF2e1EsqJmTsr5z7PsKr10IlAS2TfQyCNI/Lu+BaHvgUIJ55MFBdA5ocL7CT+VbAPUivPAdM0/UPgFOk6XfmslRpRpjFuaCC7MxpdoGwbe/MKsPNkCDHIDWsjOEliyN5/cEHAWaPMskTYHS4JqJUEwrx8SmLbCdShDd2XJp/dbUdJWua4E0LtEcecfSHmhq49j1bxOKlEg35dZ76lJpRzXEON2zgprTJcN89vclX4IYHdtL41FsrEpq+VZ5OBQvuOszTpXo+KS/c9xCRAVQdNc1WuuEW7cUtMb/WJ2riWnLdWJGT9zR9g X-OriginatorOrg: foss.st.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2026 11:57:17.9645 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5bb06c98-d20d-4ff3-f7c6-08df1c8e7ac9 X-MS-Exchange-CrossTenant-Id: 75e027c9-20d5-47d5-b82f-77d7cd041e8f X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=75e027c9-20d5-47d5-b82f-77d7cd041e8f; Ip=[164.130.1.59]; Helo=[smtpO365.st.com] X-MS-Exchange-CrossTenant-AuthSource: MAD0EPF000008B5.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR10MB4009 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Hi, I noticed that the configure scripts in this repository does not use the path given to the --with-zstd option, while for example GCC does. This patch adds the missing logic in config/zstd.m4 and regenerat the configure files with that change. Also worth noting is that I see blocks like below (manually excluded in this patch) when I run autoconf2.69: -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) Is there a reason why the checked in configure files does not align with the tool mentioned in the checked in files? Ok for master? Kind regards, Torbjörn -- Allow --with-zstd to specify an installation prefix. Use the headers and static library under that prefix, and reject it if it does not provide zstd 1.4.0 or newer. Regenerate the affected configure scripts. Signed-off-by: Torbjörn SVENSSON --- bfd/configure | 90 +++++++++++++++++++++++++++++++++++++++++----- binutils/configure | 90 +++++++++++++++++++++++++++++++++++++++++----- config/zstd.m4 | 63 +++++++++++++++++++++++++++----- gas/configure | 90 +++++++++++++++++++++++++++++++++++++++++----- gdb/configure | 90 +++++++++++++++++++++++++++++++++++++++++----- gold/configure | 90 +++++++++++++++++++++++++++++++++++++++++----- ld/configure | 90 +++++++++++++++++++++++++++++++++++++++++----- 7 files changed, 540 insertions(+), 63 deletions(-) diff --git a/bfd/configure b/bfd/configure index a4326160c57..d44e8cfb527 100755 --- a/bfd/configure +++ b/bfd/configure @@ -1540,8 +1540,8 @@ Optional Packages: --without-libintl-prefix don't search for libintl in includedir and libdir --with-libintl-type=TYPE type of library to search for (auto/static/shared) --with-system-zlib use installed libz - --with-zstd support zstd compressed debug sections - (default=auto) + --with-zstd[=PATH] support zstd compressed debug sections, optionally + using zstd installed under PATH (default=auto) Some influential environment variables: CC C compiler command @@ -15423,7 +15423,11 @@ else fi -if test "$with_zstd" != no; then : +case $with_zstd in #( + no) : + ;; #( + yes|auto) : + pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libzstd >= 1.4.0" >&5 @@ -15508,17 +15512,21 @@ fi echo "$ZSTD_PKG_ERRORS" >&5 - if test "$with_zstd" = yes; then - as_fn_error $? "--with-zstd was given, but pkgconfig/libzstd.pc is not found" "$LINENO" 5 - fi + if test "$with_zstd" = yes; then : + + as_fn_error $? "--with-zstd was given, but pkgconfig/libzstd.pc is not found" "$LINENO" 5 + +fi elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - if test "$with_zstd" = yes; then - as_fn_error $? "--with-zstd was given, but pkgconfig/libzstd.pc is not found" "$LINENO" 5 - fi + if test "$with_zstd" = yes; then : + + as_fn_error $? "--with-zstd was given, but pkgconfig/libzstd.pc is not found" "$LINENO" 5 + +fi else ZSTD_CFLAGS=$pkg_cv_ZSTD_CFLAGS @@ -15531,8 +15539,72 @@ $as_echo "#define HAVE_ZSTD 1" >>confdefs.h fi + ;; #( + *) : + + ZSTD_CFLAGS="-I$with_zstd/include" + ZSTD_LIBS="$with_zstd/lib/libzstd.a" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zstd >= 1.4.0 in $with_zstd" >&5 +$as_echo_n "checking for zstd >= 1.4.0 in $with_zstd... " >&6; } + + zstd_save_CPPFLAGS=$CPPFLAGS + zstd_save_LIBS=$LIBS + CPPFLAGS="$CPPFLAGS $ZSTD_CFLAGS" + LIBS="$ZSTD_LIBS $LIBS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#if ZSTD_VERSION_NUMBER < 10400 +# error zstd 1.4.0 or later is required +#endif + +int +main () +{ + + (void) ZSTD_compress(0, 0, 0, 0, 1); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + have_zstd=yes +else + have_zstd=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + CPPFLAGS=$zstd_save_CPPFLAGS + LIBS=$zstd_save_LIBS + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_zstd" >&5 +$as_echo "$have_zstd" >&6; } + + if test "$have_zstd" = yes; then : + + pkg_cv_ZSTD_CFLAGS=$ZSTD_CFLAGS + pkg_cv_ZSTD_LIBS=$ZSTD_LIBS + +$as_echo "#define HAVE_ZSTD 1" >>confdefs.h + + +else + + as_fn_error $? "zstd >= 1.4.0 was not found under $with_zstd" "$LINENO" 5 fi + ;; #( + *) : + ;; +esac + + + save_CFLAGS="$CFLAGS" diff --git a/binutils/configure b/binutils/configure index ea19d09749f..4bae6ae8549 100755 --- a/binutils/configure +++ b/binutils/configure @@ -1540,8 +1540,8 @@ Optional Packages: --without-libintl-prefix don't search for libintl in includedir and libdir --with-libintl-type=TYPE type of library to search for (auto/static/shared) --with-system-zlib use installed libz - --with-zstd support zstd compressed debug sections - (default=auto) + --with-zstd[=PATH] support zstd compressed debug sections, optionally + using zstd installed under PATH (default=auto) --with-msgpack Enable msgpack support (auto/yes/no) Some influential environment variables: @@ -15873,7 +15873,11 @@ else fi -if test "$with_zstd" != no; then : +case $with_zstd in #( + no) : + ;; #( + yes|auto) : + pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libzstd >= 1.4.0" >&5 @@ -15958,17 +15962,21 @@ fi echo "$ZSTD_PKG_ERRORS" >&5 - if test "$with_zstd" = yes; then - as_fn_error $? "--with-zstd was given, but pkgconfig/libzstd.pc is not found" "$LINENO" 5 - fi + if test "$with_zstd" = yes; then : + + as_fn_error $? "--with-zstd was given, but pkgconfig/libzstd.pc is not found" "$LINENO" 5 + +fi elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - if test "$with_zstd" = yes; then - as_fn_error $? "--with-zstd was given, but pkgconfig/libzstd.pc is not found" "$LINENO" 5 - fi + if test "$with_zstd" = yes; then : + + as_fn_error $? "--with-zstd was given, but pkgconfig/libzstd.pc is not found" "$LINENO" 5 + +fi else ZSTD_CFLAGS=$pkg_cv_ZSTD_CFLAGS @@ -15981,8 +15989,72 @@ $as_echo "#define HAVE_ZSTD 1" >>confdefs.h fi + ;; #( + *) : + + ZSTD_CFLAGS="-I$with_zstd/include" + ZSTD_LIBS="$with_zstd/lib/libzstd.a" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zstd >= 1.4.0 in $with_zstd" >&5 +$as_echo_n "checking for zstd >= 1.4.0 in $with_zstd... " >&6; } + + zstd_save_CPPFLAGS=$CPPFLAGS + zstd_save_LIBS=$LIBS + CPPFLAGS="$CPPFLAGS $ZSTD_CFLAGS" + LIBS="$ZSTD_LIBS $LIBS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#if ZSTD_VERSION_NUMBER < 10400 +# error zstd 1.4.0 or later is required +#endif + +int +main () +{ + + (void) ZSTD_compress(0, 0, 0, 0, 1); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + have_zstd=yes +else + have_zstd=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + CPPFLAGS=$zstd_save_CPPFLAGS + LIBS=$zstd_save_LIBS + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_zstd" >&5 +$as_echo "$have_zstd" >&6; } + + if test "$have_zstd" = yes; then : + + pkg_cv_ZSTD_CFLAGS=$ZSTD_CFLAGS + pkg_cv_ZSTD_LIBS=$ZSTD_LIBS + +$as_echo "#define HAVE_ZSTD 1" >>confdefs.h + + +else + + as_fn_error $? "zstd >= 1.4.0 was not found under $with_zstd" "$LINENO" 5 fi + ;; #( + *) : + ;; +esac + + + diff --git a/config/zstd.m4 b/config/zstd.m4 index eb34c0f36d7..f3c25984ba9 100644 --- a/config/zstd.m4 +++ b/config/zstd.m4 @@ -8,16 +8,61 @@ dnl the same distribution terms as the rest of that program. dnl Enable features using the zstd library. AC_DEFUN([AC_ZSTD], [ AC_ARG_WITH(zstd, - [AS_HELP_STRING([--with-zstd], [support zstd compressed debug sections (default=auto)])], + [AS_HELP_STRING([--with-zstd@<:@=PATH@:>@], + [support zstd compressed debug sections, optionally using zstd installed under PATH (default=auto)])], [], [with_zstd=auto]) -AS_IF([test "$with_zstd" != no], - [PKG_CHECK_MODULES(ZSTD, [libzstd >= 1.4.0], [ - AC_DEFINE(HAVE_ZSTD, 1, [Define to 1 if zstd is enabled.]) - ], [ - if test "$with_zstd" = yes; then - AC_MSG_ERROR([--with-zstd was given, but pkgconfig/libzstd.pc is not found]) - fi - ]) +AS_CASE([$with_zstd], + [no], [], + [yes|auto], [ + PKG_CHECK_MODULES([ZSTD], [libzstd >= 1.4.0], [ + AC_DEFINE(HAVE_ZSTD, 1, [Define to 1 if zstd is enabled.]) + ], [ + AS_IF([test "$with_zstd" = yes], [ + AC_MSG_ERROR( + [--with-zstd was given, but pkgconfig/libzstd.pc is not found]) + ]) + ]) + ], + [*], [ + ZSTD_CFLAGS="-I$with_zstd/include" + ZSTD_LIBS="$with_zstd/lib/libzstd.a" + + AC_MSG_CHECKING([for zstd >= 1.4.0 in $with_zstd]) + + zstd_save_CPPFLAGS=$CPPFLAGS + zstd_save_LIBS=$LIBS + CPPFLAGS="$CPPFLAGS $ZSTD_CFLAGS" + LIBS="$ZSTD_LIBS $LIBS" + + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +#if ZSTD_VERSION_NUMBER < 10400 +# error zstd 1.4.0 or later is required +#endif + ]], + [[ + (void) ZSTD_compress(0, 0, 0, 0, 1); + ]])], + [have_zstd=yes], + [have_zstd=no]) + + CPPFLAGS=$zstd_save_CPPFLAGS + LIBS=$zstd_save_LIBS + + AC_MSG_RESULT([$have_zstd]) + + AS_IF([test "$have_zstd" = yes], [ + pkg_cv_ZSTD_CFLAGS=$ZSTD_CFLAGS + pkg_cv_ZSTD_LIBS=$ZSTD_LIBS + AC_DEFINE(HAVE_ZSTD, 1, [Define to 1 if zstd is enabled.]) + ], [ + AC_MSG_ERROR([zstd >= 1.4.0 was not found under $with_zstd]) + ]) ]) + +AC_SUBST([ZSTD_CFLAGS]) +AC_SUBST([ZSTD_LIBS]) ]) diff --git a/gas/configure b/gas/configure index 8afaf2729ed..59272c76117 100755 --- a/gas/configure +++ b/gas/configure @@ -1531,8 +1531,8 @@ Optional Packages: --without-libintl-prefix don't search for libintl in includedir and libdir --with-libintl-type=TYPE type of library to search for (auto/static/shared) --with-system-zlib use installed libz - --with-zstd support zstd compressed debug sections - (default=auto) + --with-zstd[=PATH] support zstd compressed debug sections, optionally + using zstd installed under PATH (default=auto) Some influential environment variables: CC C compiler command @@ -16150,7 +16150,11 @@ else fi -if test "$with_zstd" != no; then : +case $with_zstd in #( + no) : + ;; #( + yes|auto) : + pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libzstd >= 1.4.0" >&5 @@ -16235,17 +16239,21 @@ fi echo "$ZSTD_PKG_ERRORS" >&5 - if test "$with_zstd" = yes; then - as_fn_error $? "--with-zstd was given, but pkgconfig/libzstd.pc is not found" "$LINENO" 5 - fi + if test "$with_zstd" = yes; then : + + as_fn_error $? "--with-zstd was given, but pkgconfig/libzstd.pc is not found" "$LINENO" 5 + +fi elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - if test "$with_zstd" = yes; then - as_fn_error $? "--with-zstd was given, but pkgconfig/libzstd.pc is not found" "$LINENO" 5 - fi + if test "$with_zstd" = yes; then : + + as_fn_error $? "--with-zstd was given, but pkgconfig/libzstd.pc is not found" "$LINENO" 5 + +fi else ZSTD_CFLAGS=$pkg_cv_ZSTD_CFLAGS @@ -16258,8 +16266,72 @@ $as_echo "#define HAVE_ZSTD 1" >>confdefs.h fi + ;; #( + *) : + + ZSTD_CFLAGS="-I$with_zstd/include" + ZSTD_LIBS="$with_zstd/lib/libzstd.a" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zstd >= 1.4.0 in $with_zstd" >&5 +$as_echo_n "checking for zstd >= 1.4.0 in $with_zstd... " >&6; } + + zstd_save_CPPFLAGS=$CPPFLAGS + zstd_save_LIBS=$LIBS + CPPFLAGS="$CPPFLAGS $ZSTD_CFLAGS" + LIBS="$ZSTD_LIBS $LIBS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#if ZSTD_VERSION_NUMBER < 10400 +# error zstd 1.4.0 or later is required +#endif + +int +main () +{ + + (void) ZSTD_compress(0, 0, 0, 0, 1); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + have_zstd=yes +else + have_zstd=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + CPPFLAGS=$zstd_save_CPPFLAGS + LIBS=$zstd_save_LIBS + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_zstd" >&5 +$as_echo "$have_zstd" >&6; } + + if test "$have_zstd" = yes; then : + + pkg_cv_ZSTD_CFLAGS=$ZSTD_CFLAGS + pkg_cv_ZSTD_LIBS=$ZSTD_LIBS + +$as_echo "#define HAVE_ZSTD 1" >>confdefs.h + + +else + + as_fn_error $? "zstd >= 1.4.0 was not found under $with_zstd" "$LINENO" 5 fi + ;; #( + *) : + ;; +esac + + + # Support for VMS timestamps via cross compile diff --git a/gdb/configure b/gdb/configure index 810e9ed7a37..1f1aa5f606a 100755 --- a/gdb/configure +++ b/gdb/configure @@ -1721,8 +1721,8 @@ Optional Packages: --with-pkgversion=PKG Use PKG in the version string in place of "GDB" --with-bugurl=URL Direct users to URL to report a bug --with-system-zlib use installed libz - --with-zstd support zstd compressed debug sections - (default=auto) + --with-zstd[=PATH] support zstd compressed debug sections, optionally + using zstd installed under PATH (default=auto) --with-iconv-bin=PATH specify where to find the iconv program --with-system-readline use installed readline library --with-jit-reader-dir=PATH @@ -26723,7 +26723,11 @@ else fi -if test "$with_zstd" != no; then : +case $with_zstd in #( + no) : + ;; #( + yes|auto) : + pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libzstd >= 1.4.0" >&5 @@ -26808,17 +26812,21 @@ fi echo "$ZSTD_PKG_ERRORS" >&5 - if test "$with_zstd" = yes; then - as_fn_error $? "--with-zstd was given, but pkgconfig/libzstd.pc is not found" "$LINENO" 5 - fi + if test "$with_zstd" = yes; then : + + as_fn_error $? "--with-zstd was given, but pkgconfig/libzstd.pc is not found" "$LINENO" 5 + +fi elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - if test "$with_zstd" = yes; then - as_fn_error $? "--with-zstd was given, but pkgconfig/libzstd.pc is not found" "$LINENO" 5 - fi + if test "$with_zstd" = yes; then : + + as_fn_error $? "--with-zstd was given, but pkgconfig/libzstd.pc is not found" "$LINENO" 5 + +fi else ZSTD_CFLAGS=$pkg_cv_ZSTD_CFLAGS @@ -26831,8 +26839,72 @@ $as_echo "#define HAVE_ZSTD 1" >>confdefs.h fi + ;; #( + *) : + + ZSTD_CFLAGS="-I$with_zstd/include" + ZSTD_LIBS="$with_zstd/lib/libzstd.a" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zstd >= 1.4.0 in $with_zstd" >&5 +$as_echo_n "checking for zstd >= 1.4.0 in $with_zstd... " >&6; } + + zstd_save_CPPFLAGS=$CPPFLAGS + zstd_save_LIBS=$LIBS + CPPFLAGS="$CPPFLAGS $ZSTD_CFLAGS" + LIBS="$ZSTD_LIBS $LIBS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#if ZSTD_VERSION_NUMBER < 10400 +# error zstd 1.4.0 or later is required +#endif + +int +main () +{ + + (void) ZSTD_compress(0, 0, 0, 0, 1); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + have_zstd=yes +else + have_zstd=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + CPPFLAGS=$zstd_save_CPPFLAGS + LIBS=$zstd_save_LIBS + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_zstd" >&5 +$as_echo "$have_zstd" >&6; } + + if test "$have_zstd" = yes; then : + + pkg_cv_ZSTD_CFLAGS=$ZSTD_CFLAGS + pkg_cv_ZSTD_LIBS=$ZSTD_LIBS + +$as_echo "#define HAVE_ZSTD 1" >>confdefs.h + + +else + + as_fn_error $? "zstd >= 1.4.0 was not found under $with_zstd" "$LINENO" 5 fi + ;; #( + *) : + ;; +esac + + + diff --git a/gold/configure b/gold/configure index a81a04f0531..ec755535dff 100755 --- a/gold/configure +++ b/gold/configure @@ -1555,8 +1555,8 @@ Optional Packages: --with-gold-ldflags=FLAGS additional link flags for gold --with-gold-ldadd=LIBS additional libraries for gold --with-system-zlib use installed libz - --with-zstd support zstd compressed debug sections - (default=auto) + --with-zstd[=PATH] support zstd compressed debug sections, optionally + using zstd installed under PATH (default=auto) Some influential environment variables: CC C compiler command @@ -9997,7 +9997,11 @@ else fi -if test "$with_zstd" != no; then : +case $with_zstd in #( + no) : + ;; #( + yes|auto) : + pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libzstd >= 1.4.0" >&5 @@ -10082,17 +10086,21 @@ fi echo "$ZSTD_PKG_ERRORS" >&5 - if test "$with_zstd" = yes; then - as_fn_error $? "--with-zstd was given, but pkgconfig/libzstd.pc is not found" "$LINENO" 5 - fi + if test "$with_zstd" = yes; then : + + as_fn_error $? "--with-zstd was given, but pkgconfig/libzstd.pc is not found" "$LINENO" 5 + +fi elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - if test "$with_zstd" = yes; then - as_fn_error $? "--with-zstd was given, but pkgconfig/libzstd.pc is not found" "$LINENO" 5 - fi + if test "$with_zstd" = yes; then : + + as_fn_error $? "--with-zstd was given, but pkgconfig/libzstd.pc is not found" "$LINENO" 5 + +fi else ZSTD_CFLAGS=$pkg_cv_ZSTD_CFLAGS @@ -10105,8 +10113,72 @@ $as_echo "#define HAVE_ZSTD 1" >>confdefs.h fi + ;; #( + *) : + + ZSTD_CFLAGS="-I$with_zstd/include" + ZSTD_LIBS="$with_zstd/lib/libzstd.a" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zstd >= 1.4.0 in $with_zstd" >&5 +$as_echo_n "checking for zstd >= 1.4.0 in $with_zstd... " >&6; } + + zstd_save_CPPFLAGS=$CPPFLAGS + zstd_save_LIBS=$LIBS + CPPFLAGS="$CPPFLAGS $ZSTD_CFLAGS" + LIBS="$ZSTD_LIBS $LIBS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#if ZSTD_VERSION_NUMBER < 10400 +# error zstd 1.4.0 or later is required +#endif + +int +main () +{ + + (void) ZSTD_compress(0, 0, 0, 0, 1); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + have_zstd=yes +else + have_zstd=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + CPPFLAGS=$zstd_save_CPPFLAGS + LIBS=$zstd_save_LIBS + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_zstd" >&5 +$as_echo "$have_zstd" >&6; } + + if test "$have_zstd" = yes; then : + + pkg_cv_ZSTD_CFLAGS=$ZSTD_CFLAGS + pkg_cv_ZSTD_LIBS=$ZSTD_LIBS + +$as_echo "#define HAVE_ZSTD 1" >>confdefs.h + + +else + + as_fn_error $? "zstd >= 1.4.0 was not found under $with_zstd" "$LINENO" 5 fi + ;; #( + *) : + ;; +esac + + + if test "$pkg_cv_ZSTD_LIBS" != ""; then HAVE_ZSTD_TRUE= diff --git a/ld/configure b/ld/configure index 4d755384c41..c5f7356b275 100755 --- a/ld/configure +++ b/ld/configure @@ -1598,8 +1598,8 @@ Optional Packages: --with-xxhash use inlined libxxhash for hashing (faster) (auto/yes/no) --with-system-zlib use installed libz - --with-zstd support zstd compressed debug sections - (default=auto) + --with-zstd[=PATH] support zstd compressed debug sections, optionally + using zstd installed under PATH (default=auto) Some influential environment variables: CC C compiler command @@ -19088,7 +19088,11 @@ else fi -if test "$with_zstd" != no; then : +case $with_zstd in #( + no) : + ;; #( + yes|auto) : + pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libzstd >= 1.4.0" >&5 @@ -19173,17 +19177,21 @@ fi echo "$ZSTD_PKG_ERRORS" >&5 - if test "$with_zstd" = yes; then - as_fn_error $? "--with-zstd was given, but pkgconfig/libzstd.pc is not found" "$LINENO" 5 - fi + if test "$with_zstd" = yes; then : + + as_fn_error $? "--with-zstd was given, but pkgconfig/libzstd.pc is not found" "$LINENO" 5 + +fi elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - if test "$with_zstd" = yes; then - as_fn_error $? "--with-zstd was given, but pkgconfig/libzstd.pc is not found" "$LINENO" 5 - fi + if test "$with_zstd" = yes; then : + + as_fn_error $? "--with-zstd was given, but pkgconfig/libzstd.pc is not found" "$LINENO" 5 + +fi else ZSTD_CFLAGS=$pkg_cv_ZSTD_CFLAGS @@ -19196,8 +19204,72 @@ $as_echo "#define HAVE_ZSTD 1" >>confdefs.h fi + ;; #( + *) : + + ZSTD_CFLAGS="-I$with_zstd/include" + ZSTD_LIBS="$with_zstd/lib/libzstd.a" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zstd >= 1.4.0 in $with_zstd" >&5 +$as_echo_n "checking for zstd >= 1.4.0 in $with_zstd... " >&6; } + + zstd_save_CPPFLAGS=$CPPFLAGS + zstd_save_LIBS=$LIBS + CPPFLAGS="$CPPFLAGS $ZSTD_CFLAGS" + LIBS="$ZSTD_LIBS $LIBS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#if ZSTD_VERSION_NUMBER < 10400 +# error zstd 1.4.0 or later is required +#endif + +int +main () +{ + + (void) ZSTD_compress(0, 0, 0, 0, 1); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + have_zstd=yes +else + have_zstd=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + CPPFLAGS=$zstd_save_CPPFLAGS + LIBS=$zstd_save_LIBS + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_zstd" >&5 +$as_echo "$have_zstd" >&6; } + + if test "$have_zstd" = yes; then : + + pkg_cv_ZSTD_CFLAGS=$ZSTD_CFLAGS + pkg_cv_ZSTD_LIBS=$ZSTD_LIBS + +$as_echo "#define HAVE_ZSTD 1" >>confdefs.h + + +else + + as_fn_error $? "zstd >= 1.4.0 was not found under $with_zstd" "$LINENO" 5 fi + ;; #( + *) : + ;; +esac + + + # target-specific stuff: -- 2.43.0