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.133.124]) by sourceware.org (Postfix) with ESMTPS id 9F8F93858C74 for ; Fri, 27 Jan 2023 10:59:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9F8F93858C74 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=1674817163; 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=6mSwEKAjQNaZkSWFkmSryMQpPi2X3bpZ5yjJGTI8kng=; b=MpO4cNh3N+q3FbpA1PdjyEm0RHCH902Q2NseVUwJ5S03a4UNLBb9B923yN1pwIBAOXp/ti 9hDsTKkTHeRhHrJNgopE3NWSfImKViUU880x28Q7ZsdjxemSMzXbhnIkugzM2LdG5PVlNk WNOo3/R0Fu+hT5A7yDx1WXxRVoVCDYE= Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-520-nQ-mDUHxPwOZRnBFbLqDmg-1; Fri, 27 Jan 2023 05:59:22 -0500 X-MC-Unique: nQ-mDUHxPwOZRnBFbLqDmg-1 Received: by mail-lj1-f200.google.com with SMTP id 17-20020a05651c009100b0028f23beb02bso1209592ljq.13 for ; Fri, 27 Jan 2023 02:59:21 -0800 (PST) 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:message-id :reply-to; bh=6mSwEKAjQNaZkSWFkmSryMQpPi2X3bpZ5yjJGTI8kng=; b=LEvl1e92QXYlgfRd/bl0GenR4TcsV2SdOns2jfkBVqWjorjURvGKZ2wV3gvCjEbkO0 AcKNu8k0ZbjysYUsW6bdNUoNVsStIjv1Fmxdt0QKqkv4+O5p/tuGi5Fst4TEfuiotynh vaUjXEXH5SQ4t7L3huU0yBanO/QF4kaucRD1dk6dQRllj0RdYTmHCvRZNJuLFQbFujFy 4N3P2s7oX32/7WSahdbn8XCtYUdR7XUCuM9voy/xmvGRx1wCcFdw8JV/rfA+A55vBoCh TDs0RXA60nFu8GN0gJ4T5SPEKgfjLeAUkiEjTQKJtggWMiZ6KaP/dfE3rnXpl4KF15W/ S6fg== X-Gm-Message-State: AFqh2kpJa+nwxHXFN7Dz2ZasADFsuWdv0k9OOaR9lu5kmeEmxjauZRFs 8d0ho8o5TeAd1+eoPlyqydaik9YRwLsjaaXq6fvDiBGSW8GB1oCoJr754mP83qEFkHScSWE98R5 fQ/PH4fVvAddlk2Iyy4olPaKERm5+PT4= X-Received: by 2002:a05:6512:4001:b0:4d2:47be:11fe with SMTP id br1-20020a056512400100b004d247be11femr3220532lfb.196.1674817160738; Fri, 27 Jan 2023 02:59:20 -0800 (PST) X-Google-Smtp-Source: AMrXdXsE17qsWyY929EvqK3PUVV8Anua3ImRxlJaZJ5/mURq2LHoy1QKr4HNIB7BNU3DlmBUdI9RIPMARLH/H+g9JzA= X-Received: by 2002:a05:6512:4001:b0:4d2:47be:11fe with SMTP id br1-20020a056512400100b004d247be11femr3220530lfb.196.1674817160467; Fri, 27 Jan 2023 02:59:20 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Fri, 27 Jan 2023 10:59:09 +0000 Message-ID: Subject: Re: [PATCH] libstdc++: Fix up FAIL in 17_intro/names.cc on glibc < 2.19 [PR108568] To: Jakub Jelinek Cc: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,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 Fri, 27 Jan 2023 at 09:29, Jakub Jelinek wrote: > > Hi! > > On gcc112 which has glibc 2.17 I've noticed > FAIL: 17_intro/names.cc (test for excess errors) > FAIL: experimental/names.cc (test for excess errors) > These are because glibc < 2.19 used __unused as field member of various structs, > including mcontext_t in sys/ucontext.h on ppc64le. > This was changed in glibc with > https://gcc.gnu.org/pipermail/libc-alpha/2013-November/045766.html > names.cc even has > #ifdef __GLIBC_PREREQ > #if ! __GLIBC_PREREQ(2, 19) > // Glibc defines this prior to 2.19 > #undef __unused > #endif > #endif > for it, but it doesn't work. The reason is that __GLIBC_PREREQ is defined in > but nothing included that header before this spot (it is included later > from bits/stdc++.h). > > The following patch on Linux/Hurd conditionally includes features.h to get > the needed macros before deciding if __unused should be undefined or not. > If needed, I could use __GLIBC_PREREQ then but would need to check if it is > defined and between 1996 and 1999 it wasn't. > > Tested on powerpc64le-linux with glibc 2.17 (where it fixes the > regressions), on x86_64-linux with glibc 2.35 (where it still PASSes), > plus on the latter with -E -dD on the test to verify __unused is just > defined and not undefined later on, ok for trunk? OK, thanks.