public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Fangrui Song <maskray@google.com>
Cc: Jan Beulich <jbeulich@suse.com>,
	binutils@sourceware.org, gdb-patches@sourceware.org
Subject: Re: [PATCH] binutils, gdb: support zstd compressed debug sections
Date: Mon, 19 Sep 2022 21:11:18 -0400	[thread overview]
Message-ID: <e66d1415-8251-830b-6478-522e85b32fdd@simark.ca> (raw)
In-Reply-To: <20220919164522.qj7uwnbhrc7ogojf@google.com>

On 9/19/22 12:45, Fangrui Song via Gdb-patches wrote:
> 
> On 2022-09-19, Simon Marchi wrote:
>>> 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
>>
>> Thanks, I'll take a proper look when you post a v2.
>>
>>> However, now `make all-gdb` fails to link because gdb/Makefile does not have `ZSTD_LIBS = -lzstd` ...
>>
>> For GDB, you can copy what we do for debuginfod in gdb/Makefile.in,
>> which would mean:
>>
>> ZSTD_CFLAGS = @ZSTD_CFLAGS@
>> ZSTD_LIBS = @ZSTD_LIBS@
>>
>> And use $(ZSTD_CFLAGS) and $(ZSTD_LIBS) where appropriate.
>>
>> Simon
> 
> Thanks, the ZSTD_CFLAGS tip helped.  I inspected jansson and msgpack's
> pkg-config check and get this v2 patch:
> https://sourceware.org/pipermail/binutils/2022-September/122950.html
> 
> Note: For some reasons I have to include PKG_PROG_PKG_CONFIG in
> config/zstd.m4, otherwise pkg-config does not work for some directories.

It's probably because of this (from the documentation of
PKG_CHECK_MODULES):

   dnl Note that if there is a possibility the first call to
   dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
   dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac

I hit that problem when adding another PKG_CHECK_MODULES call in a
downstream port.  The pkg-config tool is probed only by the first
PKG_CHECK_MODULES instance that appears in the source.  So if it's
possible this check does not happen (because of a condition), then
pkg-config is never probed for, so the second instance of
PKG_CHECK_MODULES thinks pkg-config is not available.

In my downstream port, I made each configure.ac call
PKG_PROG_PKG_CONFIG.  But if what you did works, I'm fine with it.

> Note: PKG_CHECK_MODULES(MSGPACK in binutils/configure.ac possibly misses
> AC_MSG_CHECKING/AC_MSG_RESULT, so when msgpack is missing, the log isn't
> clear.

I think they are done by PKG_CHECK_MODULES, aren't they?  I see:

checking for msgpack... no

Simon


  reply	other threads:[~2022-09-20  1:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-19  4:01 Fangrui Song
2022-09-19  6:55 ` Simon Marchi
2022-09-19  8:51   ` Fangrui Song
2022-09-19 10:54     ` Simon Marchi
2022-09-19 16:45       ` Fangrui Song
2022-09-20  1:11         ` Simon Marchi [this message]
2022-09-19  9:13   ` Jan Beulich

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=e66d1415-8251-830b-6478-522e85b32fdd@simark.ca \
    --to=simark@simark.ca \
    --cc=binutils@sourceware.org \
    --cc=gdb-patches@sourceware.org \
    --cc=jbeulich@suse.com \
    --cc=maskray@google.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).