From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by sourceware.org (Postfix) with ESMTPS id CFBE83858C52 for ; Tue, 27 Sep 2022 18:53:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CFBE83858C52 Received: by mail-lj1-x232.google.com with SMTP id s10so11936411ljp.5 for ; Tue, 27 Sep 2022 11:53:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=u/UT2eEvxBf2uvwmr1+VFcF2M+VB2qVRedyumgLK874=; b=ItXP3rUtm36DNN6C71PrDy4WlG7Mq3Ajt/ke9MfMUAZgnDAiMXX89gZ8LB9exIYkLM HoRsbuNqmMm1K/QHtNFGXc63MpboOxXBgh60kS093qex3BAbwkBu5v3Fz6eZpx4gDlKd WDF8XF6PoVEj/OYsaG57H1Yim6Z5eFLKLCAgJYkiJf0LxbE3OtJIYvBX178AQl8gHjDL hvI9j0b5GHK7oQ/V+DZ5xphbIDrhMoC2jXCq4brE2VWWBS0Va/d5kTvJjSAVQdvJtUf+ aORk1/wCQs0+HWZvsoPWuv+5mYKKq306p7rHVtZd6oQkXNVWot4iNhP4hm7Fvgt7KI5g Io2g== X-Gm-Message-State: ACrzQf3mZ49IJvUK4/B2LNJSq2KBEmHWpi2GU3LR71kIPn8xsHu/MyoJ DRFpGJJrhOD86YwHESJ/nnmJ1BxUhZBkGlh12ufgzQ== X-Google-Smtp-Source: AMsMyM7gC8NQuFB+DJyB6r2QEnXSpVvRleDtlXDN4I7YsNJjDM8lu9s0YMc4tO74w6mpK7gZe7//ch2L9y8YN7g3yGk= X-Received: by 2002:a05:651c:1112:b0:26c:7323:3f2c with SMTP id e18-20020a05651c111200b0026c73233f2cmr10259819ljo.4.1664304803199; Tue, 27 Sep 2022 11:53:23 -0700 (PDT) MIME-Version: 1.0 References: <20220923040837.550160-1-maskray@google.com> <87o7v0zo4b.fsf@tromey.com> In-Reply-To: <87o7v0zo4b.fsf@tromey.com> From: Fangrui Song Date: Tue, 27 Sep 2022 11:53:10 -0700 Message-ID: Subject: Re: [PATCH v3] binutils, gdb: support zstd compressed debug sections To: Tom Tromey Cc: Fangrui Song via Gdb-patches , Alan Modra , Jan Beulich , Nick Clifton , Simon Marchi , binutils@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-18.2 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-List-Received-Date: Tue, 27 Sep 2022 18:53:26 -0000 On Tue, Sep 27, 2022 at 11:08 AM Tom Tromey wrote: > > >>>>> Fangrui Song via Gdb-patches writes: > > > 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. > > This also needs some change to the sims. > I see failures like this with git master: > > make[4]: Entering directory '/home/tromey/gdb/build/sim/bpf' > CCLD run > ../../bfd/libbfd.a(compress.o):compress.c:function decompress_contents: error: undefined reference to 'ZSTD_decompress' > ../../bfd/libbfd.a(compress.o):compress.c:function decompress_contents: error: undefined reference to 'ZSTD_isError' > (unknown):176: error: undefined reference to 'ZSTD_compress' > (unknown):179: error: undefined reference to 'ZSTD_isError' > collect2: error: ld returned 1 exit status > > You'll see them all if you do a build with all sims enabled. > > thanks, > Tom Thanks for the report and Tom's IRC chat with me about the `../../configure --enable-targets --enable-sim; make all-gdb` build. Tom confirmed that the latest commit `sim: Link ZSTD_LIBS` has fixed the problem.