Message ID | 6fb0cc60744e112cd396dc6ca15d8adc9ade39cf.camel@espressif.com |
---|---|
State | New |
Headers |
Return-Path: <newlib-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7892B386103C for <patchwork@sourceware.org>; Mon, 8 Jul 2024 07:38:49 +0000 (GMT) X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on20715.outbound.protection.outlook.com [IPv6:2a01:111:f400:feae::715]) by sourceware.org (Postfix) with ESMTPS id 61EC53860C3F for <newlib@sourceware.org>; Mon, 8 Jul 2024 07:38:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 61EC53860C3F Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=espressif.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=espressif.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 61EC53860C3F Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f400:feae::715 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1720424316; cv=pass; b=htkDDVeeSQkVnt5AUdvtyVWLgNijxFZK8LcMkE98jeFLq1CxqWbe8o1E3Ahdt5Xu4q2m1E4Dj5ChtWXyyYnimbEbFoXPXlWjKe6+yVnoLFnuPymPvEQyQAm9qXRe/RP4UUY8V/sXgRAzZMVe6k3Gyir5aYTZfmEPtpn6FOpKvcQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1720424316; c=relaxed/simple; bh=6c7TS2be87pafpGLrKvv/SPS4n4gYc2yprRMX+vsoA8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=hdm3OvlWt8oqPI+wMZH8DFoqzm/vaWKTu7ohP5sXr7vvz1rVDyuNFEI2CxF6NtwZrN75CtNdgoxlqThv48Yg+oY1w48zV0w1jDweYrGC0480O+lOVmhvBYoSvmZpUNYY89rNv43XnHLvaLgCU0sIBqHlZqmHldfHJViaSskd/6g= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MZLjW12PyKfaE9fXk1rglJtTXo+p7fY8Ln9FcT0QPsJZ+3uoJU3MBwQccYq6VN1j7rj4gTPhsqdOmIJC9gvuGVGDK0wNoiS8klXv7RwWnyh8LvTL5R3dYpsgXes5WLCzMi9zBrt6b2NGM14v8cpHHVVeaEtGAkl+tVAsY/5YCiuhS+zoVdXNsj1feht+/d9NtE5IyjGB7novckeYt2yfLbwX89RBq89K1oFq6nSSZPVU2jx6cJ6sB+sJ6EKeemuzlJFtCfO0XLvj8dLIgpkmtAtXXfSkTWtJK7yGk4HDz5kXNoMqafZhK6UA/6V+EHiuCPAkcrm1vfpMdRvJoe00xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6c7TS2be87pafpGLrKvv/SPS4n4gYc2yprRMX+vsoA8=; b=YfyWVCrZiOgWpcmq6ZmZyz9FTc7bQVMT7zs5pdWNMdK9tpqPjN1jbII89kP1ulK1ng5vgNMZIw4i99AX2w6xYNyzds3AbYA4Gc3MRGPOd9u/HjggJ3EK3qWZhBSwyT9Bzil58Lk0i22gPnIEZCJNZ4JCFOXceo1Ena7suJNRkA33/GQjGXpPbpJBZjgtCd7xOcM6DLbOfJG644c3+GaadxboiI2GZNxNazOkynun9Rt0BveIiy5lw4K/1g+Gnb5fIqiMVJwUG2kCfmgA94bfSZjCqKq6t9icCjRGP1/hPQlwT3ndq5Z1kRjMdfdv0Wsmam16X++lUQVe/bkoBafgBQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=espressif.com; dmarc=pass action=none header.from=espressif.com; dkim=pass header.d=espressif.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=espressifsystems.onmicrosoft.com; s=selector1-espressifsystems-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6c7TS2be87pafpGLrKvv/SPS4n4gYc2yprRMX+vsoA8=; b=Jyfm9c4wK1bGf48D0th62W4yvETZlL/whvSRzgP6C26P1P2wG4LtREu/xc1OJYbmiDdqIt4Rf/5vrrzY/WouvfI0u04Ij6AD0hMr0vnRKJiIlU+X4O1ng0QR/Esabpmvo8JvLVGZC7XlfzQJlE2PXktBtFBE1BmFOuuALY0B2KY= Received: from TYZPR04MB5736.apcprd04.prod.outlook.com (2603:1096:400:1fa::7) by TYZPR04MB6908.apcprd04.prod.outlook.com (2603:1096:400:341::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.18; Mon, 8 Jul 2024 07:38:28 +0000 Received: from TYZPR04MB5736.apcprd04.prod.outlook.com ([fe80::6d6:9923:c880:a521]) by TYZPR04MB5736.apcprd04.prod.outlook.com ([fe80::6d6:9923:c880:a521%4]) with mapi id 15.20.7762.016; Mon, 8 Jul 2024 07:38:27 +0000 From: Alexey Lapshin <alexey.lapshin@espressif.com> To: "newlib@sourceware.org" <newlib@sourceware.org> Subject: [PATCH] stdatomic: make atomics compatible with GCC-14 Thread-Topic: [PATCH] stdatomic: make atomics compatible with GCC-14 Thread-Index: AQHa0QnSPO5x3JNx0EuXQ8Idvp4B6A== Date: Mon, 8 Jul 2024 07:38:27 +0000 Message-ID: <6fb0cc60744e112cd396dc6ca15d8adc9ade39cf.camel@espressif.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=espressif.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: TYZPR04MB5736:EE_|TYZPR04MB6908:EE_ x-ms-office365-filtering-correlation-id: ac0608d8-5f24-46b7-3abc-08dc9f20f4d9 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|1800799024|376014|366016|38070700018; x-microsoft-antispam-message-info: =?utf-8?q?7jC6FpskU+ZGv/lUTiHJmXXyAeWhDFf?= =?utf-8?q?tDSYnB3HvBecsy/KwI/lL93V5B5BTTlRIaEzhhtqf7OSFgF8rYtReZ6oIHF/KQcGm?= =?utf-8?q?J7jsx/mNJCfvAmKxgaSCHDt2mQM/x7Kj6lCtjMHNQJYYsPAF4G4JCTzCiazk+LAEz?= =?utf-8?q?BTGHM3RJPD6cgO9FiM9hIf5UeMox7Li+ganAezkEIM2kW9FOaO3KasneP7bQKzK6E?= =?utf-8?q?56ziRfmEuAqBrC7n4jpIrFvU9q+tdaf12OJK/kQu+BbcVfzQBx3ZfzhH1/F3SfJeM?= =?utf-8?q?e7XKn2V6UjHnhJO0PvS1JQgGrpvQf9/RldzwUv5vEnYO5sfG4b+Lb7gHOSp4nkoc3?= =?utf-8?q?+oeN0v2mIWHiMxY73Le1W1ogCPYEoS7d4dWH+stTL6dVi3UzXF4d1nulfvOAwv/Zx?= =?utf-8?q?sQmpUQXgK9MQDuJxt/DY75p1l4uylLhaAkxBGL12ZP2b6U1yqs1FYbH2Z/ODO5BR7?= =?utf-8?q?HuimZKsiUfC4s48qaUaDXGrO3OXRzVP83JheduDLlbKXqU374JCzBxVP0WA4UT20d?= =?utf-8?q?VRmNfqGf1ABZpDD/sEbzXjiHDy471ybWnnoIaoBwv9IQllCqFEvCotvuQ6AUsyVwf?= =?utf-8?q?bT3mwZdjeb9FAbdDZlHQicaWPLgprT2g3cglCadpcZm/rgHu8rIyT/4wV+MoYloe1?= =?utf-8?q?7ns/dmHPbEXlpUS2sNFJtYupGM0l6rEiLz7VsddQ3Lr4afBNFn2KYdhIUAqCJLrWK?= =?utf-8?q?OTlxQ+LzI66KLS/tmNdwLcBxiKRPcryUGKGC4CppBJbmlUwR+Trw/8hxFJG4+8KAF?= =?utf-8?q?dhng2AbVM+3WJn0JIQjdoPdUx65Br3smq33KRA5yyo2vZ+4y7hAQU/HQYhLvcXCUd?= =?utf-8?q?1O2I+VwBxsQd1hozoJBahIpyyg/qcDTF+0JvfFXUADySXCcTfS1tkftzir9QehZyf?= =?utf-8?q?fqAeKlaaivmZWJbsjuFZWllIBCE/QFfyFwTi7ltY1oEmdaTi0uK2XdH1QV68I07h5?= =?utf-8?q?5tuD2FiPxUazcKSpLANhU73QbAHcgMUjQLSj0M4PxPra5BgNzGRYcy5A8AF/vq+7M?= =?utf-8?q?qFPdVd05CBnnkKvOS/KN6yPs+48WCbPbQRt1UzHp/79DVDXXBUeQy81RL/isvBB8H?= =?utf-8?q?M+sPegDqB4bN1ZuAPqGbhLeHCOJ4HIQ8UmNxkaloKr9lq5rB2aq5ztzf6gJWEnh5I?= =?utf-8?q?c/NubMieRmrSXN+bmHC6FgqlI7gGCyyRvFdAHxcRP1zHGG7wgPm+UA1709xdryowV?= =?utf-8?q?vHVLoDBMXTpLk7sLXOZ1VuJeUXO+gZoGSrovrMb5cHWzhjdCOkkqQ5Bj3Rki3DFPV?= =?utf-8?q?uDhRCF6LrfT00X24MAHZqnN8hQn/s+USInk6EhlIW9Xd/TQyJoQVxUj4=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYZPR04MB5736.apcprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(376014)(366016)(38070700018); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?zydTbFMaX3b5F6iSlWn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VP/GviXNFbP8?= =?utf-8?q?451oun8PWQp0v+vrMImjTbMKYh19AAgM48w1Cpnrf4TjKVnwwTpEVvtzUQfjZYTJm?= =?utf-8?q?NVnNNWCLt2K7NGT8Ri0l3FB0WAstg1YdmQ23T03i1ZS4U8v0ktkfYXHD3S6EAMxut?= =?utf-8?q?t1sKD6/hKhKGeOrs8APa3/KbHjxxVVxds+8had9+p5Zi0fgLXLVQwJL7wLMyAu64B?= =?utf-8?q?55M/Uooj1ZkWyWqCxv60O8Wo5G0iF1xIgYqFPuI+Gn+x/M3zGzIuqNzqP4FexenP/?= =?utf-8?q?NDz+RUy7eLX2UIjH8D1xxN6nSPHm+UMnm7J9BrEZdJtAgBAHCI10pQhV8Gc8RqPUn?= =?utf-8?q?l429YXqba7eVnpB+rGhs8KOvzjWjCDDuFiFAqtiXDb7P4MZ/JDXbIKxAVpdk/X3Pf?= =?utf-8?q?1d+dFvsVuYrTZ732MoSy2mS0DyJTkmKqA8IQiZ2glvlv2sY+P7x/UckS71VbbfE03?= =?utf-8?q?YghtlDk8NjG0JQajFwCZ5kGQ50H5lMcxSRtW070o1ojS9Wr32t8LQIi3GqnLjb2Td?= =?utf-8?q?CzYnmDilWX8dYPUmJWH285P/VOZUmADvSO6OxdhTATJQyp2f2mTVrs7GoPkCes7xr?= =?utf-8?q?NBxEQuPQfeQjxsOO6r8KUCYnfDwOYRxURgYUJtwky+Wh7YX4xtHCXxGi4NDQ7n1hA?= =?utf-8?q?3F38s4ZCAaMl/XlE+5k+O50kq9KMv7uWdQ=3D=3D?= Content-Type: text/plain; charset="utf-8" Content-ID: <C8C3E2FA53465F4F991404E69849BD06@apcprd04.prod.outlook.com> Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginatorOrg: espressif.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TYZPR04MB5736.apcprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ac0608d8-5f24-46b7-3abc-08dc9f20f4d9 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jul 2024 07:38:27.4994 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 5faf27fd-3557-4294-9545-8ea74a409f39 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: VTy3jkd4/O1a0CW9n/AXchXtyQrvT32JYmIt8cNWH5BM6hpOopJLjuGx/X7VrTXnDwcGtgWHbjhTIfRCS2nhUIjjzSl9pRZrSj0///FtZFQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR04MB6908 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_NUMSUBJECT, KAM_SHORT, SPF_HELO_PASS, SPF_PASS, 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 X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Newlib mailing list <newlib.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/newlib>, <mailto:newlib-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/newlib/> List-Post: <mailto:newlib@sourceware.org> List-Help: <mailto:newlib-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/newlib>, <mailto:newlib-request@sourceware.org?subject=subscribe> Errors-To: newlib-bounces~patchwork=sourceware.org@sourceware.org |
Series |
stdatomic: make atomics compatible with GCC-14
|
|
Commit Message
Alexey Lapshin
July 8, 2024, 7:38 a.m. UTC
https://gcc.gnu.org/pipermail/gcc-patches/2023-September/631525.html brings c_atomic and cxx_atomic definitions into GCC. This patch makes atomics type detection correct for GCC. --- newlib/libc/include/stdatomic.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.34.1
Comments
Hello Alexey, this file was imported from FreeBSD. So, it would be good to fix this issue first in FreeBSD. If GCC provides the c_atomic and cxx_atomic extensions, then why can't we use them for this header file? Independent of this, GCC provides its own stdatomic.h header file for a while which should be found before the Newlib header if you use standard compiler search paths. ----- Am 8. Jul 2024 um 9:38 schrieb Alexey Lapshin alexey.lapshin@espressif.com: > https://gcc.gnu.org/pipermail/gcc-patches/2023-September/631525.html > brings c_atomic and cxx_atomic definitions into GCC. > This patch makes atomics type detection correct for GCC. > --- > newlib/libc/include/stdatomic.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/newlib/libc/include/stdatomic.h b/newlib/libc/include/stdatomic.h > index d58e795eb..fb1a7a0c2 100644 > --- a/newlib/libc/include/stdatomic.h > +++ b/newlib/libc/include/stdatomic.h > @@ -33,7 +33,8 @@ > #include <sys/cdefs.h> > #include <sys/_types.h> > > -#if __has_extension(c_atomic) || __has_extension(cxx_atomic) > +#if defined(__clang__) && \ > + (__has_extension(c_atomic) || __has_extension(cxx_atomic)) > #define __CLANG_ATOMICS > #elif __GNUC_PREREQ__(4, 7) > #define __GNUC_ATOMICS > -- > 2.34.1
> If GCC provides the c_atomic and cxx_atomic extensions, then why can't we use them for this header file?
To keep code simple. Anyway GCC will go into `#elif __GNUC_PREREQ__(4, 7)` branch
On Jul 9 06:27, Alexey Lapshin wrote: > > If GCC provides the c_atomic and cxx_atomic extensions, then why can't we use them for this header file? > > To keep code simple. Anyway GCC will go into `#elif __GNUC_PREREQ__(4, 7)` branch Ok, but given that GCC actually supports the __CLANG_ATOMICS expression, I wonder if this isn't just a case of a badly named macro? Corinna
diff --git a/newlib/libc/include/stdatomic.h b/newlib/libc/include/stdatomic.h index d58e795eb..fb1a7a0c2 100644 --- a/newlib/libc/include/stdatomic.h +++ b/newlib/libc/include/stdatomic.h @@ -33,7 +33,8 @@ #include <sys/cdefs.h> #include <sys/_types.h> -#if __has_extension(c_atomic) || __has_extension(cxx_atomic) +#if defined(__clang__) && \ + (__has_extension(c_atomic) || __has_extension(cxx_atomic)) #define __CLANG_ATOMICS #elif __GNUC_PREREQ__(4, 7) #define __GNUC_ATOMICS