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 8C29E3858D28; Tue, 20 Sep 2022 01:11:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8C29E3858D28 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.155] (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) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id C20A21E07B; Mon, 19 Sep 2022 21:11:20 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1663636281; bh=6WUKklqOLXWRC1EhIXmN3bKEl7d1E1mAKyUetYlKHlU=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=uqDwZG0jfnQhBoK7F+j7UR8UuFq1zkHF9p1xHYhZGLsW8CIYUEo6yijMzL8osOgxs hb4cH8mehtSEVnh4VB9wbNj8efrPkl61P88dOd7SoqqNYVrrcPAsaEnmCxES59UUC3 Na+GdMtjZI1+l+crSaY7sx2XBgzX0k3u0LWwJDaM= Message-ID: Date: Mon, 19 Sep 2022 21:11:18 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [PATCH] binutils, gdb: support zstd compressed debug sections To: Fangrui Song Cc: Jan Beulich , binutils@sourceware.org, gdb-patches@sourceware.org References: <20220919040115.31326-1-maskray@google.com> <15fe4352-79e1-acd5-5a71-fc40e19047a8@simark.ca> <20220919085126.5m2keelsz3hzx7xf@google.com> <78681d27-e5bd-c983-b521-e46af546537e@simark.ca> <20220919164522.qj7uwnbhrc7ogojf@google.com> Content-Language: fr From: Simon Marchi In-Reply-To: <20220919164522.qj7uwnbhrc7ogojf@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.7 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 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