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 8AE92384AB5A for ; Mon, 22 Apr 2024 15:42:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8AE92384AB5A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8AE92384AB5A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713800538; cv=none; b=luqJgXrH796ay2AMFloWOXQ5dZtVd09I25GBowx75ANRBOx3Q1ZM07yD1t6XPW7YL4XC2kXEk7G3UCSVeQcZHZWp2dkeI+eubbBslEJQovK6PLcDqpmp/y/RHJoXgtvDqDFpXHtkXzVlphGZo0EIn2p0UmFb5HabHCFgJEbNnl4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713800538; c=relaxed/simple; bh=JNdYd2IjSdcA3AvJtGhqaioQlfMCtky7Ga6muki8GIU=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=BOt5MebYbLTSmbW9BtIWuP5fQhXfFP3rHTrxH4DpnxcgwgW7mJn4krOIr+0JRPOyliqoilCLBWmQ8jfyNghMH+bYudd4xdZVxZlpKsxVZ2EB/J8V48oCvl8YpWFvANtJBb5oRRUYRYVTqbwKp/kZsaPR4YvG3XI8BcdhmgF+5gQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713800535; 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=sV5KJJJi40SxtOinPH2kBVu7osPNULqoQxiIZDZjqM4=; b=VOlrg4G95oh+8AzWD9fKund/rq5QU/17Piu2cSpJlO6A+iIhHh9kNLaLYgOs1PVEQJJfw0 GNrK9/PTl85S7VL9THZrK47gjy+AZnQCgHB+5XHyhLan1t/wqWGSJCo7Q7mJzkL9WEtS7T 82hFDI/arVJ77sQs6raZUEebYgBgUWU= Received: from mail-yw1-f200.google.com (mail-yw1-f200.google.com [209.85.128.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-634-qu7_P1vQMi-jBIHIwxr5_w-1; Mon, 22 Apr 2024 11:42:13 -0400 X-MC-Unique: qu7_P1vQMi-jBIHIwxr5_w-1 Received: by mail-yw1-f200.google.com with SMTP id 00721157ae682-61b3b02f691so53449137b3.2 for ; Mon, 22 Apr 2024 08:42:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713800533; x=1714405333; 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=sV5KJJJi40SxtOinPH2kBVu7osPNULqoQxiIZDZjqM4=; b=WkXhiS/GsoiB8masCU6AIwq2XLb3KByRAjFkAZR3yHO3ERNGryj/VC1VX+38rgEQ3C MyGTUd5ehc+nfda7F7xLzyym99vewWcv1sJR+dpS/VDR7mPb8IKzmvd9bH427a2YXZjx crzkjRp0wetQ5lM6tPT16KxXDDowLZNS0Jr3IOjh1w3aPDt+femLZeIbmKTbfdsGg+7H l+4CkJU2rxk7YtqK1FuqEBvLE56fWp8pbxNzouB2xV9RN1Y5rKKzcUJbGsMgEqzE03sR JpIy3ib0v64crFyzjCWk1ko1cgLOO3BldBUtQuZvNCfhF5kNa4Nuy8dTbNuxP6myNFHG hxaA== X-Gm-Message-State: AOJu0Yyh+qgsJN3nIyLiiO/MHIq4kAcYC8dOzJC0NgBV2ePe2y6MZSDO kULzZLaUuNbp3I/AhKEveLs1rwmMQYBfp1BGshrzo70LhauTVYHk/v35z47uu6PjUvUohPJFNA4 bJpEDXod+i0EVv268/UsfniaD2FNdpiby335WWncHPK4JzVuM8s23iJR3/X2rywr7vVBznxU63L TwHtl/KCZQpVVyjFkXkvyr24xpefQ= X-Received: by 2002:a25:904:0:b0:dc6:e4f8:7e22 with SMTP id 4-20020a250904000000b00dc6e4f87e22mr10074318ybj.62.1713800532994; Mon, 22 Apr 2024 08:42:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF8jyO2fmpVSpu//a48u61L3dKZi9l3fTdXYkcUhJ4bG9K95xUnOvqz3iKgyHL/fsaXItNwo9LcpeLP3hEo3TE= X-Received: by 2002:a25:904:0:b0:dc6:e4f8:7e22 with SMTP id 4-20020a250904000000b00dc6e4f87e22mr10074294ybj.62.1713800532651; Mon, 22 Apr 2024 08:42:12 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Mon, 22 Apr 2024 16:41:56 +0100 Message-ID: Subject: Re: [PATCH] libstdc++: Workaround kernel-headers on s390x-linux 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.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,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 Mon, 22 Apr 2024 at 16:37, Jakub Jelinek wrote: > > Hi! > > We see > FAIL: 17_intro/headers/c++1998/all_attributes.cc (test for excess errors) > FAIL: 17_intro/headers/c++2011/all_attributes.cc (test for excess errors) > FAIL: 17_intro/headers/c++2014/all_attributes.cc (test for excess errors) > FAIL: 17_intro/headers/c++2017/all_attributes.cc (test for excess errors) > FAIL: 17_intro/headers/c++2020/all_attributes.cc (test for excess errors) > FAIL: 17_intro/names.cc -std=gnu++17 (test for excess errors) > on s390x-linux. > The first 5 are due to kernel-headers not using uglified attribute names, > where contains > __attribute__((packed, aligned(4))) > I've filed a downstream bugreport for this in > https://bugzilla.redhat.com/show_bug.cgi?id=2276084 > (not really sure where to report kernel-headers issues upstream), while the > last one is due to from glibc containing: > #ifdef __USE_MISC > # define __ctx(fld) fld > #else > # define __ctx(fld) __ ## fld > #endif > ... > typedef union > { > double __ctx(d); > float __ctx(f); > } fpreg_t; > and g++ predefining -D_GNU_SOURCE which implies define __USE_MISC. > > The following patch adds a workaround for this on the libstdc++ testsuite > side, ok for trunk? OK, thanks. > > 2024-04-22 Jakub Jelinek > > * testsuite/17_intro/names.cc (d, f): Undefine on s390*-linux*. > * testsuite/17_intro/headers/c++1998/all_attributes.cc (packed): Don't > define on s390. > * testsuite/17_intro/headers/c++2011/all_attributes.cc (packed): > Likewise. > * testsuite/17_intro/headers/c++2014/all_attributes.cc (packed): > Likewise. > * testsuite/17_intro/headers/c++2017/all_attributes.cc (packed): > Likewise. > * testsuite/17_intro/headers/c++2020/all_attributes.cc (packed): > Likewise. > > --- libstdc++-v3/testsuite/17_intro/names.cc.jj 2024-02-02 22:13:29.575359165 +0100 > +++ libstdc++-v3/testsuite/17_intro/names.cc 2024-04-22 16:54:35.696710752 +0200 > @@ -270,6 +270,12 @@ > #undef u > #endif > > +#if defined (__linux__) && defined (__s390__) > +// defines fpreg_t::d and fpreg_t::f > +#undef d > +#undef f > +#endif > + > #if defined (__linux__) && defined (__sparc__) > #undef y > #endif > --- libstdc++-v3/testsuite/17_intro/headers/c++1998/all_attributes.cc.jj 2024-01-03 12:08:09.603789437 +0100 > +++ libstdc++-v3/testsuite/17_intro/headers/c++1998/all_attributes.cc 2024-04-22 17:11:04.734990469 +0200 > @@ -29,7 +29,11 @@ > # define noreturn 1 > # define visibility 1 > #endif > +#ifndef __s390__ > +// kernel-headers uses __attribute__((packed,aligned(4))) on > +// S390. > #define packed 1 > +#endif > #define pure 1 > // glibc's sysdeps/unix/sysv/linux/arm/sys/ucontext.h uses this on ARM. > #ifndef __arm__ > --- libstdc++-v3/testsuite/17_intro/headers/c++2011/all_attributes.cc.jj 2024-04-22 17:11:20.028805205 +0200 > +++ libstdc++-v3/testsuite/17_intro/headers/c++2011/all_attributes.cc 2024-04-22 17:12:01.531302456 +0200 > @@ -29,7 +29,11 @@ > # define visibility 1 > #endif > #define no_unique_address 1 > +#ifndef __s390__ > +// kernel-headers uses __attribute__((packed,aligned(4))) on > +// S390. > #define packed 1 > +#endif > #define pure 1 > // glibc's sysdeps/unix/sysv/linux/arm/sys/ucontext.h uses this on ARM. > #ifndef __arm__ > --- libstdc++-v3/testsuite/17_intro/headers/c++2014/all_attributes.cc.jj 2024-01-03 12:08:09.556790095 +0100 > +++ libstdc++-v3/testsuite/17_intro/headers/c++2014/all_attributes.cc 2024-04-22 17:12:20.630071099 +0200 > @@ -29,7 +29,11 @@ > # define visibility 1 > #endif > #define no_unique_address 1 > +#ifndef __s390__ > +// kernel-headers uses __attribute__((packed,aligned(4))) on > +// S390. > #define packed 1 > +#endif > #define pure 1 > // glibc's sysdeps/unix/sysv/linux/arm/sys/ucontext.h uses this on ARM. > #ifndef __arm__ > --- libstdc++-v3/testsuite/17_intro/headers/c++2017/all_attributes.cc.jj 2024-01-03 12:08:09.506790795 +0100 > +++ libstdc++-v3/testsuite/17_intro/headers/c++2017/all_attributes.cc 2024-04-22 17:12:38.751851577 +0200 > @@ -28,7 +28,11 @@ > # define visibility 1 > #endif > #define no_unique_address 1 > +#ifndef __s390__ > +// kernel-headers uses __attribute__((packed,aligned(4))) on > +// S390. > #define packed 1 > +#endif > #define pure 1 > // glibc's sysdeps/unix/sysv/linux/arm/sys/ucontext.h uses this on ARM. > #ifndef __arm__ > --- libstdc++-v3/testsuite/17_intro/headers/c++2020/all_attributes.cc.jj 2024-01-03 12:08:09.502790851 +0100 > +++ libstdc++-v3/testsuite/17_intro/headers/c++2020/all_attributes.cc 2024-04-22 17:12:56.043642110 +0200 > @@ -27,7 +27,11 @@ > # define cold 1 > # define visibility 1 > #endif > +#ifndef __s390__ > +// kernel-headers uses __attribute__((packed,aligned(4))) on > +// S390. > #define packed 1 > +#endif > #define pure 1 > // glibc's sysdeps/unix/sysv/linux/arm/sys/ucontext.h uses this on ARM. > #ifndef __arm__ > > Jakub >