Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp467221ybg; Wed, 3 Jun 2020 05:37:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy75cpdVsMYJafKwc0shEa9BKQ5ZKMgKUJyGZ5r/3gq/L3NAfI1WEE80c8WNnXLFCE/f5ry X-Received: by 2002:a17:906:c952:: with SMTP id fw18mr25339401ejb.505.1591187827054; Wed, 03 Jun 2020 05:37:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591187827; cv=none; d=google.com; s=arc-20160816; b=NteQsEVGerkQWtJjMseVkXGT93/WZyqs2Rly0ziSTIqeX86Vc5qSy2AcV9aFXLFksm Oq3QLOZ8ei6AxCSKgm4aK4rzaSbjCCSht5wp6LdZzCWs+rVgUoat4T8SKOvjyN4inqKw oGxJbi28hJg9ToEb6VVpQc340T4SFnRWD3Uztb2cji/lBLMy3fyzJF/HW0S+84V26rul iaI9OYwH4pJjIl+QyReFreIrUQoXkpELjUT+qksLGJD+9XiT9cMf0ds68jzox3Hgfzby yO6fuO5huduq1Hr9KMri2S4L/jSB/okCX60919lEYH0SudYgjgKu2LRvjthhy+VKyDa2 6JOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from:dkim-signature; bh=YaIXrhQbCH4bOWY70sdfxk9KltjJZfTXRyPX6JUjwhI=; b=Ft0+iKZjhkxK2XPXOEYpVHoud7yeCfimYA23S4eY6Qw22WxV3RnuHykoSkEXlzfIJE 3VUcZ6OPVNYx/vYq31YQEsy1Sl/NneQmBrCgwkVQ0NJP6IeaO+mHlno7u4hHhn8vZOXI qRn+sT1cvHTvNOni5ptcuwF78P2fmyxKgI9Z+4WPujUAC+++/4vlP2MMt9usclNv/1mk FqfmHyumly5DbbnnJNy4e25kC25iFKh6XXVLJrTpeV35n9mXvz72w+BtoQA0xYV8YG6d ZKEw4a2rOAwPcmyhSZ/NJXwSQGQN3KQgl5aplfL5xz1mHyk4Jwy9RHxlB9g1fOzyVxWB F4SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KL8A8kt9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dx2si930061ejb.170.2020.06.03.05.36.44; Wed, 03 Jun 2020 05:37:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KL8A8kt9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726150AbgFCMcM (ORCPT + 99 others); Wed, 3 Jun 2020 08:32:12 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:60198 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725981AbgFCMcL (ORCPT ); Wed, 3 Jun 2020 08:32:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591187530; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YaIXrhQbCH4bOWY70sdfxk9KltjJZfTXRyPX6JUjwhI=; b=KL8A8kt9SUa1Jf95fcNJ3YtEsu57qqs0JpxbOCVOqjB9pJ3cWn51VXwsRbrgnAvw0+XgSw wsycYTobgZL6sWWOZT0CbdruCC9FZ19gBabdkUq4iNnYrifW0nBSpaMvVJsiFHp3+jBnPB ALDsLcj2Lgaam3TxgqG1iGYkQ7Qg+ME= 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) From: Florian Weimer To: Mathieu Desnoyers Cc: carlos , Joseph Myers , Szabolcs Nagy , libc-alpha , Thomas Gleixner , Ben Maurer , Peter Zijlstra , Paul , Boqun Feng , Will Deacon , Dave Watson , Paul Turner , Rich Felker , linux-kernel , linux-api 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * 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