From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by sourceware.org (Postfix) with ESMTPS id 49E4B3858D38 for ; Sat, 1 Oct 2022 07:31:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 49E4B3858D38 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=google.com Received: by mail-pj1-x1036.google.com with SMTP id x1-20020a17090ab00100b001fda21bbc90so11037620pjq.3 for ; Sat, 01 Oct 2022 00:31:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date; bh=yOi9pH54wUWQ7RIQ2g6vgHhQbVAlOeLj4wjm9+CwC4E=; b=XHDxh6+YFe0cJ/52zK4A/1t4LKNqJBgI0HyZmjOw0eQ2l8v06yMjUhgQHUvmIQ/jYO nMP4bfRf/BHLo3TuTjDiSGVa0NizTh7jj1TwI1Enp6oOYjrO46se/cyr5u0WSkOslaNx aK2O4RVgZGnDaPLkbeVQb7i8HUsDo4EDeFygf5ewBwhFlXp0ENzR3Dpdp9+WlasLz4o1 5Zke9fZmzfb0L1s9JK9Wx0H/L1Xm4grTZMPVH9cUytVNZ/8h7AsPqASmbqoOO7tGfJ6X wbMZWd7jXlcpo4W8oU1rC3oCnVfs0ltBZDZUxfxe+d6sgZfMALRHZ/UKthdX6LxFj4r/ igFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date; bh=yOi9pH54wUWQ7RIQ2g6vgHhQbVAlOeLj4wjm9+CwC4E=; b=MV8c/9grfvRloyD6Im68YNMp+MEOSYbS2PZD+pqppE8FCONRdHUeGd/VE+4t+JimDb +yg8N2TURmR6ghhIP8mVcIuWQesD9Xb76p2gPuX9roQ6NijdofGnyDdT9Radr+mMAkt4 FgRgYvtBB3tr4rgjsEC8xu4xDXjbZAk+1k4v0y/EPDTXjQ5TzIbT92sOIY0kFBOjninz E20HIoV3EMFoYi3GDXSo07CxNg3NAgXrx9GX5dyG5PnY/wgwxjBjo4fwGzBBXQYBkRJp 39uxPpJLsVjp3dRmYK5xJDECjFezBAIu3w15IOITOPeEZUdTcFOVdr0KcEB4Ex8N1k7R Y11w== X-Gm-Message-State: ACrzQf1qgYr48+qT5PX91kv5Wr47gM2h2WY7pAsGMvGcnb0GDCH7M2S8 CrKlPLy4cEgBOt520QYxGHGtWw== X-Google-Smtp-Source: AMsMyM4kWSfXo2IHAzvNzQzYVRCU6KUCyLOy9SDOI/Din17jLufPsOpWLpSF5rZSqbQno8kxHok35g== X-Received: by 2002:a17:902:d2ce:b0:178:7b5:c070 with SMTP id n14-20020a170902d2ce00b0017807b5c070mr12416347plc.58.1664609479124; Sat, 01 Oct 2022 00:31:19 -0700 (PDT) Received: from google.com ([2620:15c:2ce:200:3a85:8afb:786d:5a2a]) by smtp.gmail.com with ESMTPSA id g11-20020a63564b000000b0044a4025cea1sm233299pgm.90.2022.10.01.00.31.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Oct 2022 00:31:17 -0700 (PDT) Date: Sat, 1 Oct 2022 00:31:12 -0700 From: Fangrui Song To: Martin =?utf-8?B?TGnFoWth?= Cc: Pedro Alves , binutils@sourceware.org Subject: Re: [PATCH][RFC] add --enable-zstd-compressed-debug-sections configure option Message-ID: <20221001073112.t6aiwxhqoi3d7k5p@google.com> References: <20220929201711.7nz236xraosd76za@google.com> <61355429-24b3-17d0-ab03-6fa57ee861d5@suse.cz> <3d23c527-9090-8c76-bd95-a9cb440fca1d@palves.net> <23b9a92b-be15-a33d-958b-e93db626c1a1@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <23b9a92b-be15-a33d-958b-e93db626c1a1@suse.cz> X-Spam-Status: No, score=-20.0 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 List-Id: On 2022-09-30, Martin Liška wrote: >On 9/30/22 13:25, Pedro Alves wrote: >> On 2022-09-30 10:48 a.m., Martin Liška wrote: >>> Hello. >>> >>> The patch can set up default compression algorithm as zstd instead of the >>> default zlib-gabi. >>> >>> The patch is lightly tested as readelf can't decompress debug sections: >>> https://sourceware.org/bugzilla/show_bug.cgi?id=29640 >>> >>> Thoughts? >>> >>> ChangeLog: >>> >>> * configure.ac: Add --enable-zstd-compressed-debug-sections >>> configure option. >>> * configure: Regenerate. >> >> This may become a bit awkward in the future when other better format appears, and you want to >> switch to use it by default. Like, imagine zstd2 is invented. At that point we'd have to decide >> whether to add code to error out if the user specifies both >> "--enable-zstd-compressed-debug-sections --enable-zstd2-compressed-debug-sections", >> or always pick the latter option, or some such. > >Understood. > >> >> IMHO, it seems cleaner and more future proof to add instead: >> >> --enable-default-compressed-debug-sections=zlib|zlib-gnu|zlib-gabi|zstd >> >> WDYT? > >Yep, it's much nicer. Anyway, lemme try preparing a patch that does a bit of refactoring >before I introduce such a patch. > >Martin Personally I'll prefer that the compiler drivers (GCC and Clang) pass the default options to ld/as, and they have good infrastructure for customization... (Clang recently got better configuration file (https://clang.llvm.org/docs/UsersManual.html#configuration-files) support which enables more convenient default driver options.) Setting default options in ld/as allow very few projects which bypass the compiler driver to use zstd compressed debug sections but the benefit is probably low...