From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2074.outbound.protection.outlook.com [40.107.105.74]) by sourceware.org (Postfix) with ESMTPS id DBDF73858D20 for ; Fri, 3 Feb 2023 11:15:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DBDF73858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4urWyjpVvXfakzJis5Mbwqd8Su/lGLFnuafq24wRuQo=; b=3DafMaJehc0Ofdi7pruy6GIvMyhyucShlU66GlvcfkihFp7VVZb8zVnyilqQTc4gnfa+3SMItqW1KBbkVMHbrWvySfOvp5m5H79omr7PNNeUemIFv8H9Nogu6vjGFGZoUMSxnUjDMJu+LPYBl+9S1fDRHlxO49W+IARFcjvDlFI= Received: from DB8PR06CA0064.eurprd06.prod.outlook.com (2603:10a6:10:120::38) by AS2PR08MB9643.eurprd08.prod.outlook.com (2603:10a6:20b:608::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.28; Fri, 3 Feb 2023 11:15:57 +0000 Received: from DBAEUR03FT029.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:120:cafe::f8) by DB8PR06CA0064.outlook.office365.com (2603:10a6:10:120::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.31 via Frontend Transport; Fri, 3 Feb 2023 11:15:56 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT029.mail.protection.outlook.com (100.127.142.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.25 via Frontend Transport; Fri, 3 Feb 2023 11:15:55 +0000 Received: ("Tessian outbound 43b0faad5a68:v132"); Fri, 03 Feb 2023 11:15:55 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: c2e108cacade23ed X-CR-MTA-TID: 64aa7808 Received: from ccac50496450.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id C5A9111F-44BA-4F5E-A860-55A8EE255D93.1; Fri, 03 Feb 2023 11:15:48 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ccac50496450.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 03 Feb 2023 11:15:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NcQkSVBDUgL3tuMWny+gLnxy3hr5bJcRvOIOZ6Xnq6dsGhorO6XT7G3KJYzW4GODU1bZhBa97ywhtnn+pr0pSsBz2tIPUilQeLICAsdIrC1+IwqJ+c836TA/imwE9DYQ04DqsNn+Vw7FMx7WTF3yyT/xFhxSD6qC7guEh6ESxiDnMQwrHdD0JXQj14rYviuUZ+qO1LHstNPEaZ5jHHLKqKHEKyVMVrcaMa/SwP5r+i4gXIXf9itjEbl0TqA4q4MDjkLFopwvmAtul16q+1NsyqysjGEJKI1rEMk3c8D3pW0qukqZ4QlTHtCVT134FEcoHI12CHr+3cdybINISjvKew== 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=4urWyjpVvXfakzJis5Mbwqd8Su/lGLFnuafq24wRuQo=; b=hbBxbjXU3JDz06tGMOfEhch3N2m7AAebjvfRXdPkKUrV92svbpdt3VW90FPnPR+cVPrfx1KEH6cz+eiohI0TZRUgQTZYe7NluMLcq7RuD9C8E2YSVO9sQ74JVurf7KHvkZGU/SApi0Yq+fmRXV5a0/6W9kN372/V90NOJlcz8/T4VULKj5X0SjVKSiFTp1VOkzdFGN9vChuFw4telunnlz+B0zpttbgoLT89utjGg0r+OoAu0ybD8+bxhEcil+yfv3ZZHRPU67jOzkeoRhs84l7u8V6N6tHVfHn6AnlwG4R/0bvXJqFI2mHf29fWGf5RFGcJRL3Xod48lPuM285l5g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4urWyjpVvXfakzJis5Mbwqd8Su/lGLFnuafq24wRuQo=; b=3DafMaJehc0Ofdi7pruy6GIvMyhyucShlU66GlvcfkihFp7VVZb8zVnyilqQTc4gnfa+3SMItqW1KBbkVMHbrWvySfOvp5m5H79omr7PNNeUemIFv8H9Nogu6vjGFGZoUMSxnUjDMJu+LPYBl+9S1fDRHlxO49W+IARFcjvDlFI= Received: from AM6P193CA0093.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:88::34) by VI1PR08MB5373.eurprd08.prod.outlook.com (2603:10a6:803:131::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.24; Fri, 3 Feb 2023 11:15:46 +0000 Received: from AM7EUR03FT021.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:88:cafe::90) by AM6P193CA0093.outlook.office365.com (2603:10a6:209:88::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.31 via Frontend Transport; Fri, 3 Feb 2023 11:15:46 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by AM7EUR03FT021.mail.protection.outlook.com (100.127.140.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6064.28 via Frontend Transport; Fri, 3 Feb 2023 11:15:46 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Fri, 3 Feb 2023 11:15:27 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Fri, 3 Feb 2023 11:15:26 +0000 Received: from e125768 (10.2.78.50) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Fri, 3 Feb 2023 11:15:26 +0000 Date: Fri, 3 Feb 2023 11:15:26 +0000 Message-ID: From: "Victor L. Do Nascimento" To: CC: Subject: [PATCH v2] libc: arm: Implement setjmp GCC backwards compatibility. MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT021:EE_|VI1PR08MB5373:EE_|DBAEUR03FT029:EE_|AS2PR08MB9643:EE_ X-MS-Office365-Filtering-Correlation-Id: 9cf7cab3-edac-4dd2-5e96-08db05d8051c x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: T53EGDNXhufIF7PKan+/USgq6eGmf5Ytx1Y9q9tSnvAl3JTxRv3PgErQuBxI6QQqGLERMmxAb+udOK5UpmfXyVle5fI9V7pYQ//ckcoXQAbnFCYraUWKnocTMpjGqKZ6Ao49d3+cDU+YrUW8arhVgzWqsov45EIIxg7/HAK51G4FAC8+oU9jZVsGIk2S25/lnDKj0UYu8wDSWKYOcRvtaHwLHV4In+f6tHwVaWyoQsw5HCFjnj6G7X3Opm2MqdiW8Vsx2mGPuvgvavg9XYV+v7v0zDwPBarjt6Gk8BBrzhtwlwyWd+RxHzOJAe3pKHK5hpyBd1116s+wqWisSAMMx3+Kk3XfdGh94XcuK4N4wcNPnKuNDpASrPD/roPJSOpb1bQX65ANnTCoBqGicfGs8iwKv2BzVAhsE+xGBGg6tCAmZ6eRLLGJZdJNgxRGcUgZKsk7CPxhM/13/Gn1b6ZflF8gOd8IFfMzm2yvy92XngnWDes5Rd4p1us8+MVdvVfitYfAXcqi5fbMMw67QmxkVYKSN+lG+Hvr1R9OZbP7gDF218xgaFN6B+bjUCGYZottKvvFZjrSL+IlxTtO6fYxk7b/vMpJ3eGlDjO52v8X5y4Z/0zf9XqFYx1xK4KamGkYAAzt3vFzbGfhUvBr1Dhb5+yVGjEW1nZWShgxObDQJ38nvaZXann2c+Kal9Ua+IVn8yMoJFOqaC2ae3btaHGE8iRDIMPQT9OmHVFN616eMDM= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(346002)(39860400002)(136003)(396003)(376002)(451199018)(36840700001)(40470700004)(46966006)(70586007)(4326008)(6916009)(40460700003)(8676002)(41300700001)(36860700001)(8936002)(70206006)(47076005)(316002)(2906002)(5660300002)(40480700001)(336012)(426003)(36756003)(2616005)(82740400003)(478600001)(86362001)(356005)(186003)(82310400005)(26005)(81166007)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB5373 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT029.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 21c5b67f-fbca-46b8-1cab-08db05d7ff90 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: F8xFjnsCBLGeZeZmiz894ApOmcVdQ+Q7SSiq4dcY2gGgk1KN/eXaMmsa4kvET9epMWb6TtM3RmGbp5XdRmFePgh4YYtAUBHcbVaJn3WUW4rlIMu664t39B3xTyfw+zIfw3VE0nq69G+00L+C0Sv6CGZUAtoGoIMhM93wJHBh3CvCYoliBCXjEI79TrNfE7YuxD1Pq5MiuQodproIEH6CNOeblHcAUx0HoYO0KQIFxhtDxuMpD5I7n3OwLxuCgju+fLVEKAaKiHbAYd7fP52kjcLgywOJa5xrHTY9/sX2hqSnzWwCgo9JjaoFwEyDZ4o/tD94eWHXP8ApGnBx4z590bYvDoWe4BDTMXiuZASUWnjxUyQy3DurM5S8sy13LI3zc5o7Vdh4zQwr4kCNMrU8FiIpd3eEIMGAxuzSbLQwrvsPgQ6B9er0rTw/XWNhLnPIqwXjZFfvZIxpkqtwahr3HVMVKAkUSppUCkPF4W3dSyCWFl+ArKPrFYU8WCqtMMqOxz2qAJkvOGyZfOy6oa1ZVmAjo7eGN+2kVFTapCKAGXJIo+MKhpyfbTqKAf+Xy3kKNFpmRscPDf2qkxMVZChyA/yrNeKzkG5tk+n3lTkLl4aMEYu5LVSdbFAVYdTpcIjr8dHwt8c/zSOi69R3Gqh23wv7Yh3L5n8ThVaNl0Y8n8YUOWLugqKp9NkOwq+8Dtd2JFpEBWi0VqrR7tsPOKtb3g== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230025)(4636009)(346002)(396003)(376002)(39860400002)(136003)(451199018)(40470700004)(36840700001)(46966006)(41300700001)(70206006)(8676002)(70586007)(6916009)(4326008)(316002)(8936002)(36756003)(40460700003)(5660300002)(186003)(26005)(47076005)(36860700001)(426003)(40480700001)(2906002)(336012)(86362001)(2616005)(478600001)(82310400005)(82740400003)(81166007);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Feb 2023 11:15:55.9721 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9cf7cab3-edac-4dd2-5e96-08db05d8051c X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DBAEUR03FT029.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9643 X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,GIT_PATCH_0,KAM_DMARC_NONE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,UNPARSEABLE_RELAY 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: When compiling Newlib for arm targets with GCC 12.1 onward, the passing of architecture extension information to the assembler is automatic, making the use of .fpu and .arch_extension directives in assembly files redundant. With older versions of GCC, however, these directives must be hard-coded into the `arm/setjmp.S' file to allow the assembly of instructions concerning the storage and subsequent reloading of the floating point registers to/from the jump buffer, respectively. This patch conditionally adds the `.fpu vfpxd' and `.arch_extension mve' directives based on compile-time preprocessor macros concerning GCC version and target architectural features, such that both the assembly and linking of setjmp.S succeeds for older versions of Newlib. --- newlib/libc/machine/arm/setjmp.S | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/newlib/libc/machine/arm/setjmp.S b/newlib/libc/machine/arm/setjmp.S index c615f2428..5401534cd 100644 --- a/newlib/libc/machine/arm/setjmp.S +++ b/newlib/libc/machine/arm/setjmp.S @@ -64,6 +64,28 @@ .syntax unified +/* GCC 12.1 and later will tell the assembler exactly which floating + point (or MVE) unit is required and we don't want to override + that. Conversely, older versions of the compiler don't pass this + information so we need to enable the VFP version that is most + appropriate. The choice here should support all suitable VFP + versions that the older toolchains can handle. */ +#if __GNUC__ && __GNUC__ < 12 +/* Ensure that FPU instructions are correctly compiled and, likewise, + the appropriate build attributes are added to the resulting object + file. Check whether the MVE extension is present and whether + we have support for hardware floating point-operations. VFPxd + covers all the cases we need in this file for hardware + floating-point and should be compatible with all required FPUs + that we need to support. */ +# if __ARM_FP + .fpu vfpxd +# endif +# if __ARM_FEATURE_MVE + .arch_extension mve +# endif +#endif + #if __ARM_ARCH_ISA_THUMB == 1 && !__ARM_ARCH_ISA_ARM /* ARMv6-M-like has to be implemented in Thumb mode. */ -- 2.36.1