From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id A575E385701B for ; Thu, 15 Sep 2022 08:42:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A575E385701B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663231362; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=tUnaDkjtovMhowSCbYyFck3oK1f4PqzyJGWBJu0aTJE=; b=FzCfTQVK4uLUyOa7fiUImF9SXROXK4tB3+ZiNRRCBCqOg853I6naK8Cd2gPnhZEGUfCaa5 jPuqpdw6GxIJNJk8Or0UxCM5DJ5dNiQYxDe3ttPKUT8PX+B7/XVN7FaE8E2o5b0EKfZPRL Nu+9A0XDAE3UTzprOulf7Xcy2mF0aQw= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-369-39lthCEgNzC40IMSFEpEyw-1; Thu, 15 Sep 2022 04:42:41 -0400 X-MC-Unique: 39lthCEgNzC40IMSFEpEyw-1 Received: by mail-wr1-f72.google.com with SMTP id s1-20020adf9781000000b002286cd81376so4555050wrb.22 for ; Thu, 15 Sep 2022 01:42:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=tUnaDkjtovMhowSCbYyFck3oK1f4PqzyJGWBJu0aTJE=; b=s64QacP3CvqCTuIrxMHoZ/SLSy1sob2ITX0g+7AJBwmECs+OAg8YBvjJdMOBWNmtKL E0tyK0ODcWhvfjwSMVsW76leirzTx5Ai+AO8M44rBw5sIXJ7bPBJcVymgyzYqJJYWpLT cH56LBbVBKC2EBh86JUDmT/lbU26AbCXuzLpKhTvpiK5A2UOTIhFxcbKhRxq2ygJ0xj+ JKpNMKKSAmqlVaiWoccaXayMaNfqimqBx42k49GPnQwD0UWfO00BIQ+0lPG3ZKnkYRNI 7eIjXELajluWIUgTRl9iGs2x6ZgMmmCfZgK8b2lA024Wr1qCQ50KDQSM+IfwJu/oweOh eUrg== X-Gm-Message-State: ACgBeo0TPAdVNKAXY4VPqh0/rfJ3CUTUAgzXVJR80175RbgB6GXh4ias gy5T8FO92FXYLQF3twY097jout3QzLCsfHrLXRiJ++wuuNUXwlUaHvHzZ9neUu5CTsYbSm6hKTe J08CwPAogG0c7Ua2yoA87 X-Received: by 2002:a1c:7315:0:b0:3a5:ff61:4080 with SMTP id d21-20020a1c7315000000b003a5ff614080mr5759603wmb.196.1663231359592; Thu, 15 Sep 2022 01:42:39 -0700 (PDT) X-Google-Smtp-Source: AA6agR4LQjoOttxtWAjMLApvGmeGuK3+L9mWAH1GHX2IQwvBIYOraUwA3MW8tsv1rwDJMtqXUrUkvQ== X-Received: by 2002:a1c:7315:0:b0:3a5:ff61:4080 with SMTP id d21-20020a1c7315000000b003a5ff614080mr5759592wmb.196.1663231359262; Thu, 15 Sep 2022 01:42:39 -0700 (PDT) Received: from fedora ([185.224.112.1]) by smtp.gmail.com with ESMTPSA id u9-20020a05600c00c900b003b47ff307e1sm1907444wmm.31.2022.09.15.01.42.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Sep 2022 01:42:38 -0700 (PDT) Date: Thu, 15 Sep 2022 04:42:36 -0400 From: Carlos O'Donell To: Javier Pello Cc: libc-alpha@sourceware.org Subject: Re: [PATCH 6/6] elf: Simplify output of hwcap subdirectories in ld.so help Message-ID: References: <20220905200652.d69204581d15c64647da5cd2@otheo.eu> <87h71l9crb.fsf@oldenburg.str.redhat.com> <20220906201207.e7b3d08272af5649754e76b1@otheo.eu> <87h71i6rfa.fsf@oldenburg.str.redhat.com> <20220914200724.8e685fbbaf441c96d19011c6@otheo.eu> <20220914201509.1c642836df76f95d3c2a8f28@otheo.eu> MIME-Version: 1.0 In-Reply-To: <20220914201509.1c642836df76f95d3c2a8f28@otheo.eu> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_LOW,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_NONE,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 Wed, Sep 14, 2022 at 08:15:09PM +0200, Javier Pello wrote: > The print_hwcap_1 machinery was useful for the legacy hwcaps > subdirectories, but it is not worth the trouble now that they > are gone. This fails pre-commit CI for i686: https://patchwork.sourceware.org/project/glibc/patch/20220914201509.1c642836df76f95d3c2a8f28@otheo.eu/ Which architectures have you tested this on? > Signed-off-by: Javier Pello > --- > elf/dl-usage.c | 43 +++++++------------------------------------ > 1 file changed, 7 insertions(+), 36 deletions(-) > > diff --git a/elf/dl-usage.c b/elf/dl-usage.c > index efd6c77c..754a6391 100644 > --- a/elf/dl-usage.c > +++ b/elf/dl-usage.c > @@ -104,34 +104,6 @@ print_search_path_for_help (struct dl_main_state *state) > print_search_path_for_help_1 (__rtld_search_dirs.dirs); > } > > -/* Helper function for printing flags associated with a HWCAP name. */ > -static void > -print_hwcap_1 (bool *first, bool active, const char *label) > -{ > - if (active) > - { > - if (*first) > - { > - _dl_printf (" ("); > - *first = false; > - } > - else > - _dl_printf (", "); > - _dl_printf ("%s", label); > - } > -} > - > -/* Called after a series of print_hwcap_1 calls to emit the line > - terminator. */ > -static void > -print_hwcap_1_finish (bool *first) > -{ > - if (*first) > - _dl_printf ("\n"); > - else > - _dl_printf (")\n"); > -} > - > /* Print the header for print_hwcaps_subdirectories. */ > static void > print_hwcaps_subdirectories_header (bool *nothing_printed) > @@ -165,9 +137,7 @@ print_hwcaps_subdirectories (const struct dl_main_state *state) > { > print_hwcaps_subdirectories_header (¬hing_printed); > print_hwcaps_subdirectories_name (&split); > - bool first = true; > - print_hwcap_1 (&first, true, "searched"); > - print_hwcap_1_finish (&first); > + _dl_printf (" (searched)\n"); > } > > /* The built-in glibc-hwcaps subdirectories. Do the filtering > @@ -178,13 +148,14 @@ print_hwcaps_subdirectories (const struct dl_main_state *state) > { > print_hwcaps_subdirectories_header (¬hing_printed); > print_hwcaps_subdirectories_name (&split); > - bool first = true; > - print_hwcap_1 (&first, mask & 1, "supported"); > bool listed = _dl_hwcaps_contains (state->glibc_hwcaps_mask, > split.segment, split.length); > - print_hwcap_1 (&first, !listed, "masked"); > - print_hwcap_1 (&first, (mask & 1) && listed, "searched"); > - print_hwcap_1_finish (&first); > + if (mask & 1) > + _dl_printf (" (supported, %s)\n", listed ? "searched" : "masked"); > + else if (!listed) > + _dl_printf (" (masked)\n"); > + else > + _dl_printf ("\n"); > mask >>= 1; > } > > -- > 2.36.0 >