From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 103CC3857B98; Mon, 19 Sep 2022 06:55:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 103CC3857B98 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca Received: from [192.168.11.206] (unknown [185.156.120.200]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 0F8B71E0D5; Mon, 19 Sep 2022 02:55:10 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1663570511; bh=8fCYh6DMUxpbzFCx9/EKf6g85d3nZ8s8BPgg059TzDk=; h=Date:Subject:To:References:From:In-Reply-To:From; b=fUADlma0MnzusidjKGJ/6aaecWIoJCWDegxRYFe0hTQlk5uhAyCZv9x4li04Yk4Ga lp10qkuZvDrtXBPxCi++IFhYl4DQKXQO+sKa4Rxh89AAvvaSAHkh9D5WvhX3e4M/+6 KpfZjF61ESUyOZxZ5O6bUDuhC382AiD7jOCqCxws= Message-ID: <15fe4352-79e1-acd5-5a71-fc40e19047a8@simark.ca> Date: Mon, 19 Sep 2022 02:55:08 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [PATCH] binutils, gdb: support zstd compressed debug sections To: Fangrui Song , binutils@sourceware.org, gdb-patches@sourceware.org References: <20220919040115.31326-1-maskray@google.com> Content-Language: fr From: Simon Marchi In-Reply-To: <20220919040115.31326-1-maskray@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,SPF_HELO_PASS,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 List-Id: > diff --git a/config/zstd.m4 b/config/zstd.m4 > new file mode 100644 > index 00000000000..b8b3a199730 > --- /dev/null > +++ b/config/zstd.m4 > @@ -0,0 +1,12 @@ > +AC_DEFUN([AM_ZSTD], > +[ > + zstdlib= > + AC_ARG_WITH(system-zstd, > + [AS_HELP_STRING([--with-system-zstd], [use installed zstd])], > + if test x$with_system_zstd = xyes ; then > + zstdlib=-lzstd > + AC_DEFINE(HAVE_ZSTD_H) > + fi > + ) > + AC_SUBST(zstdlib) > +]) Hi Fangrui, I understand that you did this by copying zlib here. However, the only reason we have a --use-system-zlib is because the binutils-gdb contains a copy of zlib, which is used by default, and --use-system-zlib can be used to prefer the system version. Since we don't carry a copy of zstd in the tree, I don't think we need --with-system-zstd. However, since zstd ships with a .pc file, my preference would be to use PKG_CHECK_MODULES to have pkg-config find the right flags, and have --with/--without-zstd. Same as I did for the msgpack library here: https://gitlab.com/gnutools/binutils-gdb/-/commit/2952f10cd79af4645222f124f28c7928287d8113 I am not a binutils maintainers though (just GDB), so in the end it's up to the binutils maintainers to decide and GDB will probably follow suit. > diff --git a/configure.ac b/configure.ac > index a5555a9c91b..f7316b24ac6 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -246,6 +246,9 @@ if test x$with_system_zlib = xyes ; then > noconfigdirs="$noconfigdirs zlib" > fi > > +AC_ARG_WITH(system-zstd, > +[AS_HELP_STRING([--with-system-zstd], [use installed zstd])]) > + I don't think you need this change. --with-system-zlib exists here because we need to decide whether or not to build the local zlib. But since we don't have a local zstd... Simon