From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by sourceware.org (Postfix) with ESMTPS id BE58B3858D32 for ; Mon, 19 Sep 2022 08:51:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BE58B3858D32 Received: by mail-pg1-x52f.google.com with SMTP id bi3so103870pgb.11 for ; Mon, 19 Sep 2022 01:51:31 -0700 (PDT) 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=RGjMX6jiVtRP8yvUTG2glyPK1JoP584moePEgVFX1s8PaKU5Dm64g0/wIDdeD02dZp jncgc7TcvPILmBWqpc5KzMwaMZJsweiwySupLbh7giOASrQo2Wh19k7HcDWjZ+pFW0Ev 1S1y1u1BTtgfZQGIcrkmhqT6UcX56Ru/2aMJaWYxy4P156A90oCNOtmB33/2cmQBmKV+ 16rh5q3sdG2lVWSy03cxkNSmg893wMwETY8NGZV9BkV5FZomes8zs+Ivuig3qWCuUroz 8lELIjIbQZGuv+bRKK2gEew9jcDB9ALfsNlAOHWrs43yARA+n1TDiVGgccO2/U2MU+cc j00g== X-Gm-Message-State: ACrzQf2Etqxx3CGFEuRKX9eotllYceYQQVfw5mV4URozjy4eADFSrpEQ UFUqZ1+xe2keGCvlbiWBtZTJsrAX9VCUfA== 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Sep 2022 08:51:39 -0000 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 >