From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 389311F55B for ; Wed, 3 Jun 2020 12:22:48 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 27B4F3851C27; Wed, 3 Jun 2020 12:22:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 27B4F3851C27 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1591186967; bh=rdHO25JTPUux1QRiP8eQL4NjJR+TM6Hs9XXZEI9NbcE=; h=Date:To:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=dxi6d4EyNrWMjNIx1Z1a+JSOXcMybEqMFVAkFgeHmczJyL1dXmgShTmbVrChW+jA1 8iCrpAZnXs967N7e1Zp9rcXdQt0iG37OT65Dd6c0f67ZixlynNQ9jcXnIMO9K8KPIf zTbs/OWWPAsJxWzQEWbOfzsyvR1YIVgojDWU6biw= Received: from mail.efficios.com (mail.efficios.com [167.114.26.124]) by sourceware.org (Postfix) with ESMTPS id 514D73851C1F for ; Wed, 3 Jun 2020 12:22:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 514D73851C1F Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 05EB22BB52D; Wed, 3 Jun 2020 08:22:44 -0400 (EDT) Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id SoAZOJHovtgo; Wed, 3 Jun 2020 08:22:43 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 936A32BB70D; Wed, 3 Jun 2020 08:22:43 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 936A32BB70D X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id mdVrHRNhgPJV; Wed, 3 Jun 2020 08:22:43 -0400 (EDT) Received: from mail03.efficios.com (mail03.efficios.com [167.114.26.124]) by mail.efficios.com (Postfix) with ESMTP id 80AFF2BB70C; Wed, 3 Jun 2020 08:22:43 -0400 (EDT) Date: Wed, 3 Jun 2020 08:22:43 -0400 (EDT) To: Florian Weimer Message-ID: <1953500643.51064.1591186963416.JavaMail.zimbra@efficios.com> In-Reply-To: <87d06gxsla.fsf@oldenburg2.str.redhat.com> References: <20200527185130.5604-1-mathieu.desnoyers@efficios.com> <20200527185130.5604-2-mathieu.desnoyers@efficios.com> <87d06gxsla.fsf@oldenburg2.str.redhat.com> Subject: Re: [PATCH glibc 1/3] glibc: Perform rseq registration at C startup and thread creation (v20) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [167.114.26.124] X-Mailer: Zimbra 8.8.15_GA_3928 (ZimbraWebClient - FF76 (Linux)/8.8.15_GA_3928) Thread-Topic: glibc: Perform rseq registration at C startup and thread creation (v20) Thread-Index: JjnqmhZtAhK7Ohdp5xp6UQAQci2wtA== X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Mathieu Desnoyers via Libc-alpha Reply-To: Mathieu Desnoyers Cc: Rich Felker , libc-alpha , linux-api , Boqun Feng , Will Deacon , linux-kernel , Peter Zijlstra , Ben Maurer , Dave Watson , Thomas Gleixner , Paul , Paul Turner , Joseph Myers Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" ----- On Jun 3, 2020, at 8:05 AM, Florian Weimer fweimer@redhat.com wrote: > * Mathieu Desnoyers: >=20 >> +#ifdef __cplusplus >> +# if __cplusplus >=3D 201103L >> +# define __rseq_static_assert(expr, diagnostic) static_assert (expr, >> diagnostic) >> +# define __rseq_alignof(type) alignof (type) >> +# define __rseq_alignas(x) alignas (x) >> +# define __rseq_tls_storage_class thread_local >> +# endif >> +#elif (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) >=3D 201112L >> +# define __rseq_static_assert(expr, diagnostic) _Static_assert (expr, >> diagnostic) >> +# define __rseq_alignof(type) _Alignof (type) >> +# define __rseq_alignas(x) _Alignas (x) >> +# define __rseq_tls_storage_class _Thread_local >> +#endif >=20 > This does not seem to work. I get this with GCC 9: >=20 > In file included from /tmp/cih_test_gsrKbC.cc:8:0: > ../sysdeps/unix/sysv/linux/sys/rseq.h:42:50: error: attribute ignored > [-Werror=3Dattributes] > # define __rseq_alignas(x) alignas (x) > ^ > ../sysdeps/unix/sysv/linux/sys/rseq.h:122:14: note: in expansion of macro > =E2=80=98__rseq_alignas=E2=80=99 > uint32_t __rseq_alignas (32) version; > ^ Is that when compiling C or C++ code ? If it's C code, I would expect "_Alignas" to be used, not "alignas". Which exact version of gcc do you use ? >=20 > In any case, these changes really have to go into the UAPI header first. > Only the __thread handling should remain. Otherwise, we'll have a tough > situation on our hands changing the UAPI header, without introducing > macro definition conflicts. I'd suggest to stick to the aligned > attribute for the time being, like the current UAPI headers. OK. Should I do that in a separate patch, or you do it on top of my patchse= t, or should I re-spin another round of the series ? >=20 > The resut looks okay to me. >=20 > I'm still waiting for feedback from other maintainers whether the level > of documentation and testing is appropriate. OK. Thanks, Mathieu --=20 Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com