From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by sourceware.org (Postfix) with ESMTPS id BEF2E3858D39 for ; Mon, 19 Sep 2022 08:51:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BEF2E3858D39 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=google.com Received: by mail-pf1-x429.google.com with SMTP id c198so27401383pfc.13 for ; Mon, 19 Sep 2022 01:51:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=x31c6CQHYjcNhbbQfMB0Z3abrUwoPfYiPpxF/HIPVXw=; b=qK+XUCpg8rRASD8x7jxCkEFQRi5N9FnWC5s16DigD8DWkSwasnA1nl70wE/4I6+9z+ ry87Zn7qqjH9gxvTnglYUE7/thTAALXqwU/dHkrH3rPbyA6ay4J5+7vArOszEbZQH8eA R1QKQKhRcRkyN0Qj8dcIhL0jE5E/BPZuVR/WAQqzeuKOkKiPk6Ml3KphXfUNQNyZ2DVA 647AXaNJWSmB0cFHAB8EwPGRylVu7uHD9p0Hu5NXj2IQVdS4VlQvUUCtmRhrAhYQOWmE pYos0AR0yfH1t+dX8eWEXu4vJdh6w6y+66qdcNfWvQCDdDY19jf2TBD/vZ2tXpwNA62p qt/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=x31c6CQHYjcNhbbQfMB0Z3abrUwoPfYiPpxF/HIPVXw=; b=OB06cxks5+Ety4GmHs36fI+OMRDBqlx5JyuBLCGBjA+A8XAu+jNS3AEJhigexrUWVY Oy183GofeNK7zt6bQFgmYaAyeB8UxWPf5fxnm3IERUCGTQ6aAZtrm8+/OsmE07gUAkFU XeO90s3/2RGNHQf/gOq8ByF9BNpw7P0Q77ZqJMBR/iM0q1xMKFszSEDJd0eYtDftj0PK +pU3wpNjYbUbKMWbTs8Kui26AAlQVZg89KuNv9BL31h6SJIRTDDdi9FMdiXD+ml58Fbm hhMzSGnr2MkdvXe38KlkgQgKNmRq4XRO9lRKov8/W60IW/OjnbalHGT+0sCr2dARqxhG XrDQ== X-Gm-Message-State: ACrzQf0iJT9T3a9+YAYmuZ2eGGK57rBKEklYUHPGonWoQOwKt5t8V/CP YYL25093o83qMxu0aSrzfDJxHg== X-Google-Smtp-Source: AMsMyM6EEF+ud+xFpwfmBB0/IhaqXXGXep3OowylMIqtlZPn+IGgD6xauNw77SvO/POIsVVqTp7apw== X-Received: by 2002:a62:ce07:0:b0:540:da19:bf6d with SMTP id y7-20020a62ce07000000b00540da19bf6dmr17522205pfg.31.1663577490687; Mon, 19 Sep 2022 01:51:30 -0700 (PDT) Received: from google.com ([2620:15c:2ce:200:6d89:a024:3449:73c8]) by smtp.gmail.com with ESMTPSA id p14-20020a17090a2c4e00b001fa80cde150sm6009648pjm.20.2022.09.19.01.51.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Sep 2022 01:51:29 -0700 (PDT) Date: Mon, 19 Sep 2022 01:51:26 -0700 From: Fangrui Song To: Simon Marchi Cc: binutils@sourceware.org, gdb-patches@sourceware.org Subject: Re: [PATCH] binutils, gdb: support zstd compressed debug sections Message-ID: <20220919085126.5m2keelsz3hzx7xf@google.com> References: <20220919040115.31326-1-maskray@google.com> <15fe4352-79e1-acd5-5a71-fc40e19047a8@simark.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <15fe4352-79e1-acd5-5a71-fc40e19047a8@simark.ca> X-Spam-Status: No, score=-27.4 required=5.0 tests=BAYES_00,DKIMWL_WL_MED,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,ENV_AND_HDR_SPF_MATCH,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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: On 2022-09-19, Simon Marchi wrote: >> 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. Thanks. I see --with-msgpack and --with-jansson, so --with-zstd is probably a good option name. >> 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... I am unfamilir with autotools, but I agree that pkg-config is better. Changed to PKG_CHECK_MODULES and pushed the change to https://gitlab.com/MaskRay/binutils-gdb/-/commits/zstd However, now `make all-gdb` fails to link because gdb/Makefile does not have `ZSTD_LIBS = -lzstd` ... >Simon >