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 565263858D3C; Thu, 10 Nov 2022 17:46:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 565263858D3C 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 [10.0.0.11] (unknown [217.28.27.60]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id BB6CC1E0D3; Thu, 10 Nov 2022 12:46:52 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1668102413; bh=gxfFIU3UgNgawwiar0BsI8iCyHfUSV5aCIuCJpzef70=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=abCVXhWSpBhSOPUX+tns1nq4Azz8ajhGauY/SgHubgixzXFBxBf4eNaPGtcKD9W0N 7mwwVFuxSymFZLb5xmTABIljGmDLLOj8Vc/a3tbixJtYDFpgHMZwI8tgUPFr6SEmzZ 38Ipt717FhYjdRMlNrvF5q+SPHgyhaUUZTsY69DU= Message-ID: <08a946a3-904f-0948-35af-96f77d2e008c@simark.ca> Date: Thu, 10 Nov 2022 12:46:52 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: [PATCH] gdb: use libtool in GDB_AC_CHECK_BFD Content-Language: en-US To: Nick Alcock , "Jose E. Marchesi" Cc: Tom Tromey , gdb-patches@sourceware.org, indu.bhagat@oracle.com, elena.zannoni@oracle.com, binutils@sourceware.org References: <20221107194634.1313150-1-jose.marchesi@oracle.com> <5e940b15-cd5c-83b2-0bdd-9afa27b5f197@simark.ca> <87bkpeuae6.fsf@oracle.com> <875yfmztd6.fsf@tromey.com> <87sfiqsr7m.fsf@oracle.com> <87sfiqwx82.fsf@esperi.org.uk> From: Simon Marchi In-Reply-To: <87sfiqwx82.fsf@esperi.org.uk> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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: On 11/10/22 12:11, Nick Alcock via Gdb-patches wrote: > [Tried to Cc: gdb-patches, but I'm not yet subscribed to it from this > address. Not sure if this is going to work... and libctf is part of > binutils anyway, so I'm Cc:ing binutils@ in so that at least my > response goes somewhere public.] > > On 10 Nov 2022, Jose E. Marchesi said: > >>>>>>>> "Jose" == Jose E Marchesi via Gdb-patches writes: >>> Jose> 1) The calls to AM_ZLIB and AC_ZSTD from gdb/configure.ac. >>> Jose> 2) The definition of ZLIB and ZLIBINC from gdb/Makefile.in >>> Jose> 3) ../config/zlib.m4 from aclocal_m4_deps in gdb/Makefile.in >>> >>> ... however the use in ctf-api.h seems like it would prevent removing >>> some of the configury. gdb includes this header and so it needs the >>> correct -I options to find the in-tree zlib.h. >>> >>> I don't see why ctf-api.h needs this include, but I essentially don't >>> know anything about CTF. >> >> Nick, would it be possible to remove the include of zlib.h from >> ctf-api.h? Even if libctf uses zlib, it would be good to not expose the >> dependency in the API header... > > Yeah, this is an interestingly painful one. I completely agree that it > needs fixing, because it causes problems if you don't have a system > zlib: you end up with a basically unusable ctf-api.h after installation, > which isn't good at all. > > But... this is because of this function in the exported API: > > extern int ctf_gzwrite (ctf_dict_t *fp, gzFile fd); I don't know if this is relevant, maybe this is an API that can't change, but taking a step back, it seems strange in the first place to leak the dependency on zlib through the API. Imagine you wanted to switch to another gz compression library without changing your API. It would be nicer if zlib was just an implementation detail here. For instance, you could take a plain fd and use gzdopen internally to open a gzFile around it. Simon