public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Nick Alcock <nick.alcock@oracle.com>,
	"Jose E. Marchesi" <jose.marchesi@oracle.com>
Cc: Tom Tromey <tom@tromey.com>,
	gdb-patches@sourceware.org, indu.bhagat@oracle.com,
	elena.zannoni@oracle.com, binutils@sourceware.org
Subject: Re: [PATCH] gdb: use libtool in GDB_AC_CHECK_BFD
Date: Thu, 10 Nov 2022 12:46:52 -0500	[thread overview]
Message-ID: <08a946a3-904f-0948-35af-96f77d2e008c@simark.ca> (raw)
In-Reply-To: <87sfiqwx82.fsf@esperi.org.uk>



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 <gdb-patches@sourceware.org> 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

  reply	other threads:[~2022-11-10 17:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20221107194634.1313150-1-jose.marchesi@oracle.com>
     [not found] ` <5e940b15-cd5c-83b2-0bdd-9afa27b5f197@simark.ca>
     [not found]   ` <87bkpeuae6.fsf@oracle.com>
     [not found]     ` <875yfmztd6.fsf@tromey.com>
     [not found]       ` <87sfiqsr7m.fsf@oracle.com>
2022-11-10 17:11         ` Nick Alcock
2022-11-10 17:46           ` Simon Marchi [this message]
2022-11-11 13:17             ` Nix
2022-11-11 13:51               ` Simon Marchi
2022-11-14 13:56                 ` Nick Alcock

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=08a946a3-904f-0948-35af-96f77d2e008c@simark.ca \
    --to=simark@simark.ca \
    --cc=binutils@sourceware.org \
    --cc=elena.zannoni@oracle.com \
    --cc=gdb-patches@sourceware.org \
    --cc=indu.bhagat@oracle.com \
    --cc=jose.marchesi@oracle.com \
    --cc=nick.alcock@oracle.com \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).