From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id IJ77BO7DLWMg0z4AWB0awg (envelope-from ) for ; Fri, 23 Sep 2022 10:34:22 -0400 Received: by simark.ca (Postfix, from userid 112) id 08CF01E112; Fri, 23 Sep 2022 10:34:22 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=WapkLTvG; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 3FEF61E0D3 for ; Fri, 23 Sep 2022 10:34:19 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C25F73857378 for ; Fri, 23 Sep 2022 14:34:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C25F73857378 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1663943657; bh=IXbVI1dHBjC7Qmc4qbccZ26r6wAemU6OJdth/7hpeAU=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=WapkLTvGhWwPAGOVyy48hqz+R8nr4YsWH+3DGCapdAtaXm6X52IV+aGgc17XR6lAw nY/q+W+T2SjDXcTie6hSyVgsqDXzS+FmVd3tizG0mykdxyzO9uT4lunGIq2aAF8zuT amOpmFPQQD1gX01RIXxTleey9GgZRrIHpxvuCjJg= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 92C1F38560A9; Fri, 23 Sep 2022 14:32:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 92C1F38560A9 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 28NEWipA013263 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 23 Sep 2022 10:32:48 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 28NEWipA013263 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 0B6F91E0D3; Fri, 23 Sep 2022 10:32:44 -0400 (EDT) Message-ID: <7eadf897-9370-5a00-ae57-8e07251b8702@polymtl.ca> Date: Fri, 23 Sep 2022 10:32:43 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH v3] binutils, gdb: support zstd compressed debug sections Content-Language: en-US To: Fangrui Song , Alan Modra , Jan Beulich , Nick Clifton References: <20220923040837.550160-1-maskray@google.com> In-Reply-To: <20220923040837.550160-1-maskray@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Fri, 23 Sep 2022 14:32:44 +0000 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: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Cc: binutils@sourceware.org, gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 2022-09-23 00:08, Fangrui Song wrote: > PR29397 PR29563: The new configure option --with-zstd defaults to auto. > If pkgconfig/libzstd.pc is found, define HAVE_ZSTD and support zstd > compressed debug sections for most tools. > > * bfd: for addr2line, objdump --dwarf, gdb, etc > * gas: support --compress-debug-sections=zstd > * ld: support ELFCOMPRESS_ZSTD input and --compress-debug-sections=zstd > * objcopy: support ELFCOMPRESS_ZSTD input for > --decompress-debug-sections and --compress-debug-sections=zstd > * gdb: support ELFCOMPRESS_ZSTD input. The bfd change references zstd > symbols, so gdb has to link against -lzstd in this patch. > > If zstd is not supported, ELFCOMPRESS_ZSTD input triggers an error. We > can avoid HAVE_ZSTD if binutils-gdb imports zstd/ like zlib/, but this > is too heavyweight, so don't do it for now. > > ``` > % ld/ld-new a.o > ld/ld-new: a.o: section .debug_abbrev is compressed with zstd, but BFD is not built with zstd support > ... > > % ld/ld-new a.o --compress-debug-sections=zstd > ld/ld-new: --compress-debug-sections=zstd: ld is not built with zstd support > > % binutils/objcopy --compress-debug-sections=zstd a.o b.o > binutils/objcopy: --compress-debug-sections=zstd: binutils is not built with zstd support > > % binutils/objcopy b.o --decompress-debug-sections > binutils/objcopy: zstd.o: section .debug_abbrev is compressed with zstd, but BFD is not built with zstd support > ... > ``` > --- > Changes from v1: > * use PKG_CHECK_MODULES to check libzstd.pc > > Changes from v2: > * Improve PKG_CHECK_MODULES, autoreconf -vf > * objcopy: check --compress-debug-sections=zstd in a !HAVE_ZSTD build Just one question: you moved PKG_PROG_PKG_CONFIG up in ld/configure.ac, which I think is ok. But what about the other configure.ac files, don't they need PKG_PROG_PKG_CONFIG too? gdb/configure.ac, for instance, uses pkg-config for debuginfod. So if the user passes --without-debuginfod --with-zstd, I expect things to fail, as the pkg-config will be skipped. binutils/configure.ac probably has the same problem, since it uses PKG_CHECK_MODULES for msgpack. I would suggest using PKG_PROG_PKG_CONFIG at the top of all configure.ac that use AM_ZSTD, out of precaution. Simon