From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on2117.outbound.protection.outlook.com [40.107.15.117]) by sourceware.org (Postfix) with ESMTPS id 276C8385842B for ; Mon, 4 Mar 2024 17:43:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 276C8385842B Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=microsoft.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=microsoft.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 276C8385842B Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.15.117 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1709574215; cv=pass; b=VXnYIAe5/sjtbToz2gXq62EbIV2XOiLmfze3c3rSAt+rAUva8XTQcsleMACFOCO0AnzTVpLUOfoL9JGInQNPbZp82DbUoZY/paSUfbBbJFsFu7dOLSIE5M/t0hgrkY9FozzZRmnXXLcv4RJs8rzqclY6dNfsPZcXgNR1eNJzQ1o= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1709574215; c=relaxed/simple; bh=fayN4atEGzFYQ5i/PS9zBfTtIahmKBS++Op0Cmahz3A=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=L2n/FExa2bnbSH8ICWhfLPVBn/TApGn6WYfCS0nEgQSlwC+d/IsT2VL6Ie1JgjKTarmo9BwtKZ2UggeCuhySAorIElYFXguOsRhUuuf0sjfEL+dzHh3UzVbIpYqkrQLkQ6AoNK0H8QyrCX0f1gRatLpLlTrKbN/E8jA26uFcqUI= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FEmYMZbppr6AlEFmAubwENaPELffvk/XEMj9POJH9HM8TojYMS7hSv2WlU00+CJK8yeLI+f8RJ8V8C1xJIzaV7QM/EiBBvPb/gB4ZYALIsmiykgl9UHuxgxz/ejfT82L4XjScVvDzMvmTz0MFQByqh1XuyCmh7M43GWkiovGzIBBQry3ldlWk4rhOVpOPI9yOxhELZkHA7m9oa45rOEPPGKqMx140cGNT34UyVAWdMeqN1crgjSkhrqycVxeTtQ27OphvYVYbAOKAEZNhz05wW/Xfd8lw02mVjc7Cx6fwaZ4VcbLECicLLm9B4UhVKAfrWm7it4k/wH/PavQjQFf1w== 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=xxWga+cdWj62L4bFrm6HpZY2MgmB4z+5KIOZpvMm6ZA=; b=f3I2b3vJb9KOb78socAETQW3+XNTBX0IV+2t10dfTHEC2Bw0eTkoKmGiWEEfaCky3CmF4gTHJ1C/40pclKiZ7z12wOChvAjtMoarr85xekwXY+gwE0P8RtoYxw07IjcqrpHCe8mWpHbGkvBlxXWhPm1yEsPNtNIJWIw0Bh2v4H3FuA01dkoVDkdgSeK7qAit0QmyHebJZ2rRHCvq+w8PvngDxj5LbHX9uEdcmJD728eP5UTLkgSuaMn/DoYw6mnwxdcY5JZP0rmgDtYhPwwjCD1sGr0dpLNACj1QZS8/tYWkJ+1QfG/6wPp5vqBrZy73dlkQF1HgvO+liMjEbg8T+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xxWga+cdWj62L4bFrm6HpZY2MgmB4z+5KIOZpvMm6ZA=; b=gJ9H4rmK1Jh18zeZpOMsVqRTDsjDJ5qZmlliMuqR7oeoAl+yHhb6aqh7ypboGsjXB+e8WNtarScmOci8XRlvPLDagbi6CXJYWCxNfry5XmNdGAskt1o0Kjb7yTkkdxVn9S0bovtSRJmW+7YCno/LHEi1VaSKL/MfDkg5OQ7tf+Q= Received: from VI1PR83MB0431.EURPRD83.prod.outlook.com (2603:10a6:800:17f::6) by AM7PR83MB0436.EURPRD83.prod.outlook.com (2603:10a6:20b:1bf::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.0; Mon, 4 Mar 2024 17:43:30 +0000 Received: from VI1PR83MB0431.EURPRD83.prod.outlook.com ([fe80::7279:eea0:8540:a0f5]) by VI1PR83MB0431.EURPRD83.prod.outlook.com ([fe80::7279:eea0:8540:a0f5%7]) with mapi id 15.20.7386.002; Mon, 4 Mar 2024 17:43:30 +0000 From: Evgeny Karpov To: Evgeny Karpov , "gcc-patches@gcc.gnu.org" CC: "richard.sandiford@arm.com" , "Richard Earnshaw (lists)" , "Andrew Pinski (QUIC)" , Maxim Kuvyrkov , Radek Barton Subject: [PATCH v2 07/13] Exclude i386 functionality from aarch64 build Thread-Topic: [PATCH v2 07/13] Exclude i386 functionality from aarch64 build Thread-Index: AQHablt43GXY62gr7kGtSUDpRm8A7A== Date: Mon, 4 Mar 2024 17:43:29 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=804f8e78-f263-4809-bbd5-d515c5934d44;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2024-03-04T17:10:26Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: VI1PR83MB0431:EE_|AM7PR83MB0436:EE_ x-ms-office365-filtering-correlation-id: e94dd7d7-2725-4409-703c-08dc3c729aa8 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 0inAlki39HLp1mcB8cjo7grkuQRHaD0miHvb4j0ayKXkwBlCph+ffkiYH2dGS+al97b5GnfHKoW1b2SsLpWQYJC74T2NN4PdzicYcryHCXJqd93OW/xmeI66MZHTkX8y6nG+gGHUIL/ltIx7eEGE7KSF6ePcCjuyT06LO4tdD/ihI2/wesP98ZLdvBAVhfCJaywsVjdeCwaZXeiS/Z84knI814uGN0R5yqcbFb7OQsepFnGQI5AZMMnYA3jj1TWzRAAFD7U+slj9BCamxdqVFTiCEb0NrEnSpF6wokBQBs/VOMbMPouVJGCauQRVkvwACLZ+DBc9i2mEStowjqEjz84+nI061ALtdlj8zqCR0qeHnv07IiKTFy3E+/52dVgMTBHNkTE6qvcQS8J+iKk2SuqFCZy9ZDd5xThLNu/s3mDnaSwT/WgD+ZfBUKHkvKA3Tpe3xJq7/ax2uQS/g2b02AOczYy5d/oB4bocETbnKWuiUdLINfJz8dYi1DiiMXJaa+nojKBXM5MMsbWE3dL3eph6+TTLo0UONzAN3Bc/H28Z+V9g2Gg3Wt5GZbRTysedvbwESBAzGC76vMFYZRd1f6ePYigJm6uakbT0AAQQvfdWwharN2gkGXHx45mmZKnX3OYmpgrk3U9CzB8J+4K8z0iPFQ9Ac4c8pXWgoppeGuk= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR83MB0431.EURPRD83.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(38070700009);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?FIuR0B+ZQ9LSzjnhbYHe1Tea4hA0ufl9fBqyNuFrtzvi4HUGJ7CkIQkmW/ti?= =?us-ascii?Q?GEBGBkJFQjrTFoV2QFkMHQvfv8zhabedH3wXCoSRxO2VZfsqCHeDWvC7iw14?= =?us-ascii?Q?R13Zcx2BPJeTjBTARver2Z1dgZOg/A0H4kgo+lrFNQ4CXgzzK6dvJsWSfMXY?= =?us-ascii?Q?c3VoL5VWiEPmJtA6lkSc6u0v3KkjbvOdeVLJgsVqAIsDOEHCUogTznWvG/Ux?= =?us-ascii?Q?PyspymY4JTQhy+JPFAyFepP35ik8IkzLQwDyombwsN6/L3uBlpeOpw14rk3S?= =?us-ascii?Q?Zr8QF00juFMnotLK2rG+0lPVnRvrNVAXGPnsZspUzg6Cr/4roX4JFWTm+sN5?= =?us-ascii?Q?I7h03sz2Fw1/RAyucDRBSx0Yh+3GIA7hfBZcb60m5SjMQ90By0k2fRioptD6?= =?us-ascii?Q?hELD6L3RrE7TKOnDL5RyplEoW+w8t5gDUrF4KY5LRx65MUiTFqKdYLvhUEgL?= =?us-ascii?Q?MwtWp0JVS3HUX3qHhoTJ6L8rALisIxcb5HI+5ee2hwX6Zht381vqRVGLPFHI?= =?us-ascii?Q?i2b77jfZUZGJ2VHONlv3Vp5dR4A05L0EDNmUl7ut5WT3vye8u709ykoHovnw?= =?us-ascii?Q?LNp/M3BVKxWV/tbNeBuQ+bkJtAq32KpKD2Kuaeav7MYHyubcaCD/BkzftaDW?= =?us-ascii?Q?9sgWGjjPPCzw9HLuSJy3bNY33iDo+NWhn++SziFKQczRoTCd0r/CZvkQqfIh?= =?us-ascii?Q?/5vLkepr2Pq+yX1lhLXr/9qAeF75tYcWFLnqHQB1sT/ha04WBJcJdtir0D6S?= =?us-ascii?Q?DdFZebM861106fZUJ4sKDHj0vGxVMXDGY5ouE4JWG7ztkv8CBDmAaztmA6As?= =?us-ascii?Q?vXjh4Su8/55oNAcwI/zFymfu0Tac/kUaCjDgXiOgM5a4bxhOANRa6D1SPXr9?= =?us-ascii?Q?Bm5lM8kP4MNmuHG/KbMQbUeyQ/Xyf+vkUBknElP8xIPUKPLpFoPibEKD+eKm?= =?us-ascii?Q?BBToupckGlsFxQleENi50ZwEyvLygR/sAu7GL7FWqnsjLwNAVFvWmK1hL521?= =?us-ascii?Q?W21VxpZxZ599zU2rAr74pHF9E8cjXBCKP98pevQSGxR+MVFfxwYiYj4bPoxg?= =?us-ascii?Q?THmtlWgB86Po+UjOtzhntMD5RhvNcsooOY4Kjy/62KFBQR5NtW+/fayfUTmb?= =?us-ascii?Q?dvke9bcUG1Rt3su8we/sDSiCtDXSvpmtkEiw9J0Hueg/85/abypTSKrGFtdq?= =?us-ascii?Q?af+gT0jsn9t8zC13ExNqEoy3mHPQNde8nkRSUjgpx1S8KK9R6QR7T1Guy1Vs?= =?us-ascii?Q?S5uq+Menh6CDPGuDCnWSPVnqUfDGRiVlrmeCrdPKD253ou+5ZTSOB4Tfa4gK?= =?us-ascii?Q?BKDQ+C53F+u+Z6jOflX/vDnUKEDCNzWvV+yPKf87KE63WscaIDFKJonzwbYE?= =?us-ascii?Q?xGDop8MGILIwnfTDZGS8nh+i7aeck8Cr/fAepw09g1I/RCuZb3balIRAOxJv?= =?us-ascii?Q?1myJ5/YdevPsvyEysm3MQsxyvIEEPOpi7k3vdfSM0e4qZFO3bFgZj0nRrtXY?= =?us-ascii?Q?Z1wbDsY4Irv6Wr3cHrF2IKrp3lQ4AV7vaVy6W5fKDpAOMn7piCDtEv9EVXvM?= =?us-ascii?Q?y2NNHihhRdRVRddTWUMzzvn94+1kRy7nV8x9LuFD?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: VI1PR83MB0431.EURPRD83.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e94dd7d7-2725-4409-703c-08dc3c729aa8 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Mar 2024 17:43:29.8172 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 1WDNlWfF6MoNcYYDjyweZvbxZ3V0UcCS5h2mdOf1GIGa2XwKb2IJQCaz2aD/7ni3CtcO4yTCMq1b1Gl2vn8IrQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR83MB0436 X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,GIT_PATCH_0,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE 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: From: Zac Walker Date: Fri, 1 Mar 2024 02:35:40 +0100 Subject: [PATCH v2 07/13] Exclude i386 functionality from aarch64 build This patch defines TARGET_AARCH64_MS_ABI in config.gcc and uses it to exclude i386 functionality from aarch64 build and adjust MinGW headers for AArch64 MS ABI. gcc/ChangeLog: * config.gcc: Define TARGET_AARCH64_MS_ABI. * config/mingw/mingw-stdint.h (INTPTR_TYPE): Use TARGET_AARCH64_MS_ABI to adjust MinGW headers for AArch64 MS ABI. (UINTPTR_TYPE): Likewise. (defined): Likewise. * config/mingw/mingw32.h (DEFAULT_ABI): Likewise. (defined): Likewise. * config/mingw/winnt.cc (defined): Use TARGET_ARM64_MS_ABI to exclude ix86_get_callcvt. (i386_pe_maybe_mangle_decl_assembler_name): Likewise. (i386_pe_mangle_decl_assembler_name): Likewise. --- gcc/config.gcc | 1 + gcc/config/mingw/mingw-stdint.h | 9 +++++++-- gcc/config/mingw/mingw32.h | 6 +++++- gcc/config/mingw/winnt.cc | 8 ++++++++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/gcc/config.gcc b/gcc/config.gcc index 26564ead079..3aca257c322 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -1278,6 +1278,7 @@ aarch64-*-mingw*) esac default_use_cxa_atexit=3Dyes user_headers_inc_next_post=3D"${user_headers_inc_next_post} float.h" + tm_defines=3D"${tm_defines} TARGET_AARCH64_MS_ABI=3D1" ;; aarch64*-wrs-vxworks*) tm_file=3D"${tm_file} elfos.h aarch64/aarch64-elf.h" diff --git a/gcc/config/mingw/mingw-stdint.h b/gcc/config/mingw/mingw-stdin= t.h index c0feade76e9..debbe829bdf 100644 --- a/gcc/config/mingw/mingw-stdint.h +++ b/gcc/config/mingw/mingw-stdint.h @@ -46,5 +46,10 @@ along with GCC; see the file COPYING3. If not see #define UINT_FAST32_TYPE "unsigned int" #define UINT_FAST64_TYPE "long long unsigned int" =20 -#define INTPTR_TYPE (TARGET_64BIT ? "long long int" : "int") -#define UINTPTR_TYPE (TARGET_64BIT ? "long long unsigned int" : "unsigned = int") +#if defined (TARGET_AARCH64_MS_ABI) +# define INTPTR_TYPE "long long int" +# define UINTPTR_TYPE "long long unsigned int" +#else +# define INTPTR_TYPE (TARGET_64BIT ? "long long int" : "int") +# define UINTPTR_TYPE (TARGET_64BIT ? "long long unsigned int" : "unsigned= int") +#endif \ No newline at end of file diff --git a/gcc/config/mingw/mingw32.h b/gcc/config/mingw/mingw32.h index 58304fc55f6..040c3e1e521 100644 --- a/gcc/config/mingw/mingw32.h +++ b/gcc/config/mingw/mingw32.h @@ -19,7 +19,11 @@ along with GCC; see the file COPYING3. If not see . */ =20 #undef DEFAULT_ABI -#define DEFAULT_ABI MS_ABI +#if defined (TARGET_AARCH64_MS_ABI) +# define DEFAULT_ABI AARCH64_CALLING_ABI_MS +#else +# define DEFAULT_ABI MS_ABI +#endif =20 /* By default, target has a 80387, uses IEEE compatible arithmetic, returns float values in the 387 and needs stack probes. diff --git a/gcc/config/mingw/winnt.cc b/gcc/config/mingw/winnt.cc index 1ed383155d0..2a4fc03fc56 100644 --- a/gcc/config/mingw/winnt.cc +++ b/gcc/config/mingw/winnt.cc @@ -224,6 +224,8 @@ gen_stdcall_or_fastcall_suffix (tree decl, tree id, boo= l fastcall) return get_identifier (new_str); } =20 +#if !defined (TARGET_AARCH64_MS_ABI) + /* Maybe decorate and get a new identifier for the DECL of a stdcall or fastcall function. The original identifier is supplied in ID. */ =20 @@ -250,6 +252,8 @@ i386_pe_maybe_mangle_decl_assembler_name (tree decl, tr= ee id) return new_id; } =20 +#endif + /* Emit an assembler directive to set symbol for DECL visibility to the visibility type VIS, which must not be VISIBILITY_DEFAULT. As for PE there is no hidden support in gas, we just warn for @@ -266,6 +270,8 @@ i386_pe_assemble_visibility (tree decl, int) "in this configuration; ignored"); } =20 +#if !defined (TARGET_AARCH64_MS_ABI) + /* This is used as a target hook to modify the DECL_ASSEMBLER_NAME in the language-independent default hook langhooks,c:lhd_set_decl_assembler_name () @@ -278,6 +284,8 @@ i386_pe_mangle_decl_assembler_name (tree decl, tree id) return (new_id ? new_id : id); } =20 +#endif + /* This hook behaves the same as varasm.cc/assemble_name(), but generates the name into memory rather than outputting it to a file stream. */ --=20 2.25.1