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=AWL,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 2F0F61F55B for ; Wed, 3 Jun 2020 12:32:14 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 57C063851C1F; Wed, 3 Jun 2020 12:32:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 57C063851C1F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1591187533; bh=YaIXrhQbCH4bOWY70sdfxk9KltjJZfTXRyPX6JUjwhI=; h=To:Subject:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=RbexjtgWg5gzrVe3uyzligeRCGSKy8PjQgFWSBWfLFHCOJH5L+LBxJLTeZtwxZuAZ tR7oPGGE0Gqaq5gn1C0iqabLn9yhHqv+PplK7R19zKW64ZP0UWllzg4kVkbZOnmwdi jzvs9qIngaHOkMmXIURS668AIuUJjD9emNqesAqI= Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by sourceware.org (Postfix) with ESMTP id 42B703851C12 for ; Wed, 3 Jun 2020 12:32:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 42B703851C12 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-6-ZyHJupl8MjmPPQZToStXDA-1; Wed, 03 Jun 2020 08:32:05 -0400 X-MC-Unique: ZyHJupl8MjmPPQZToStXDA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 757FE9116D; Wed, 3 Jun 2020 12:32:03 +0000 (UTC) Received: from oldenburg2.str.redhat.com (ovpn-112-181.ams2.redhat.com [10.36.112.181]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9E33278EFF; Wed, 3 Jun 2020 12:31:56 +0000 (UTC) To: Mathieu Desnoyers Subject: Re: [PATCH glibc 1/3] glibc: Perform rseq registration at C startup and thread creation (v20) References: <20200527185130.5604-1-mathieu.desnoyers@efficios.com> <20200527185130.5604-2-mathieu.desnoyers@efficios.com> <87d06gxsla.fsf@oldenburg2.str.redhat.com> <1953500643.51064.1591186963416.JavaMail.zimbra@efficios.com> Date: Wed, 03 Jun 2020 14:31:54 +0200 In-Reply-To: <1953500643.51064.1591186963416.JavaMail.zimbra@efficios.com> (Mathieu Desnoyers's message of "Wed, 3 Jun 2020 08:22:43 -0400 (EDT)") Message-ID: <87r1uwwcsl.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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: Florian Weimer via Libc-alpha Reply-To: Florian Weimer 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" * Mathieu Desnoyers: > ----- 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 ? C++ code. CXX was set to this compiler at configure time: gcc version 9.3.1 20200408 (Red Hat 9.3.1-2) (GCC)=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 patch= set, > or should I re-spin another round of the series ? I think the initial commit should mirror the current UAPI header contents. Keep the macros for the UAPI patch though. 8-) We can pick up these changes once they have been merged into Linux. Thanks, Florian