From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2124.outbound.protection.outlook.com [40.107.105.124]) by sourceware.org (Postfix) with ESMTPS id 2C10E3858409 for ; Mon, 4 Mar 2024 17:39:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2C10E3858409 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 2C10E3858409 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.105.124 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1709573963; cv=pass; b=koaf90Vt4YKMe/3OvpDhl0BlPaZdM14oxJce5FT3yfyvGUkCPoyJj0JBO7dWLdvV89EZbJZ0Z9Jt96jkAzFW6v4Zd3jFJPWC2oGKwSM2sZ839e9gTaHJ2GXxL8g1JMixl8GI6QfVXi5dbacHF9vFVVyhfk5iOn4avm7QozJfhNo= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1709573963; c=relaxed/simple; bh=b7xZpGSzInWrB4lmU+dcGSBisk2QNmo4s3hkoRT6wjQ=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=IMlIJOaRz+kMwJOmE3BkZGnvxcpTOWfT+9xUAkn+yuygWBXnhlxIEHfK3ABswd79AP3DpOegJQh42Ehp+bYB4D7T35a6Sb/86fxD4eh1pP3c/kpzbQF+/UsnVR8YG8citIW6V+pcNsym6XK/wWvlBhxC30QDfkZAqXHB5OXIbyY= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jKiudaL6i+Ij0P+BfwUGmz6OyRQpQyVY5iSXSCh4BrrObAcCO+5SiZ78yHrp6Ija3O+5KqE1N85NLiRQj/rIsz25hH4xDEwFC/pHxkB0dfsrJ7IoGEhBAPRQYJGv0xCOrA+guMl5WG++nrybolS1MppAg5FfC2xJc2iovSBFeEdPyo41Sg8AKR4PoDOYHm9mUuTehZ260Ux6DdXT25OtLk03yKoRuXMjaEvD7sV4a8tcMscxFCw36yv5f5nsgFMB4VbPF7HjclLQhQYfTn9iCJT79Lzike38rb3+hlPPnMiQPie3ofYQL+LIaLLZrL7GjVz4xZb2QUxmw3TV7ntldg== 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=0pim9HY8gVVZi4XBxKVWk8wUhmGKa98xKVGQbfxYpE4=; b=NQPH6wOEcO9+H4ZHpjI/0/KYeq+KTlyI+EamxiQyQa8DosdZdgtIto7R0uR3wpUqTzcldxDY8XZMPRpvZj4IUTPWCVpTTyFfd+RaFlP6oGSrBcVIpwhzbVmeQCQqiUfm1XvairM8Ikfuuho84yDY9HDhCsLk1zj2qy7+JDrJYc/15cbPeEImYZm5jfDhL/tPsPyBxEETppg45Gcg+w/ne7fMMb5kfrrC2Cq12Xw2Otl+tjpCOcCPIIEErpH++0tNymwLpjmMIrUMsd/Z/4P3o7XiedPILQbDCpCWn8v2XLf3m1WzoBHBUA8H3MUpPz0tcZc53uvRokJdyH99kSdolg== 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=0pim9HY8gVVZi4XBxKVWk8wUhmGKa98xKVGQbfxYpE4=; b=RDnjF3e5jw+LUCcLsUozXU/4Qz4PDyhwcjfpBl0oT3WTNFW+nUN4jFIGpWIOvXCtRHFCauMWOUQvo4t9kpQ0KGzZC8JsFIIVg4SAbwOuZ2IbZTEg7VASjB9R9MLHbO5kRFPj15AFjG4tTOJD0JkhGJgl8Mg8W95SwD5Jd62smg8= Received: from VI1PR83MB0431.EURPRD83.prod.outlook.com (2603:10a6:800:17f::6) by GVXPR83MB0607.EURPRD83.prod.outlook.com (2603:10a6:150:154::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.3; Mon, 4 Mar 2024 17:39:09 +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:39:09 +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 04/13] aarch64: Add aarch64-w64-mingw32 COFF Thread-Topic: [PATCH v2 04/13] aarch64: Add aarch64-w64-mingw32 COFF Thread-Index: AQHablrcwmu+EOZNWE+UzNR+AZV++w== Date: Mon, 4 Mar 2024 17:39:08 +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_|GVXPR83MB0607:EE_ x-ms-office365-filtering-correlation-id: d74cc06e-b971-4777-a2dd-08dc3c71ff1f x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: EGaAsnRYlBtOA5m6n0p0imnYBUAKpB1XnHHKwHL+uw7aDjJ6hej36EWCQ17Bgfjz8xjxnJUnxMWa51UCmCtRwz6JpFC7bWRcbsvTJrIbTNnvaI1AjGAMXUq3OSGdDDxcmhoVjZXOvhZoSFH7xPKiq9d1bra/cCGUR32N3Mnoes+bAhWW5gQDbBZ2/j/ZovzfIbVW1vP5PfRRmL/poUUPEs3Ev1zd6CkR5pKzqFkZv5UVhhTwOWiy2NqKhzKHzosmK47RB+KFzUCAO0Yu/NdjMro8r22S81KZFG7B8FFiGcZLM563KxqgKdPLfvDZuwNOfv6pNJljF4xZMAw2+QOuvNk+3rJKyYjHy05UuYLoFEVxFFtkMU72NnNUmFoMwrsiDTY6IAss6PQWLtnGICl/uJZK5LKiKNOYOyZeiO6MOSWFOTZgAI1q6//G+Rj3PhoLt5ZZnBjUHD2zPOLc/M3W/KyMIHS96AhiJj2Vec+W2r7+B9mU47OTYRya9brcVgXRCnihS5vTvp8heeV6FD/pp3EdEhGMWDocFrxtM4QGCgVPT3GTgZiddjviGk5Bm9shQ59COcRGeaSSpl70ePZWgtFo6GJlIEMY7ET+8o7I1Srz+HhZ/I2VjbXAIche63ycUNoPuTqZMilQ9VdjcCx5Rrp2HdUSeoyA0wJExB8hKwM= 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?QBnxbu/eT6N8Li5A/txdEaw7O2L17LCwmRX+eYP7HvPfCL+yTNx7oQlnM5lE?= =?us-ascii?Q?PCw1i6sDrBrIW3zXGAQMaxi9WwhRd8u2lGrLdWh9Of3YBbkaWwoZzAbtDoIo?= =?us-ascii?Q?wQwq+/C2o3uZvLf1ME/cvDsJXAjDFRjZnT78FxZ/+p55T3N3LMgbbDI1mtJ9?= =?us-ascii?Q?NwGWJrHm37s4/zIMZn/dLegoFUVqLMl9oWsiQ53++3QnbZkLejXN0r6UbT8x?= =?us-ascii?Q?d/xd7jlWvcGwL6WXn1qXygaZ4NNscoR+Z2MrlPAemQZrXYVkPZOuhNP56bBl?= =?us-ascii?Q?DWTD1m/jI1GRdp0pweGpDTjt61PeEswFPrKd7RdDjz55jrqkp0JSsfHTyvN7?= =?us-ascii?Q?RWafFslxjg5VMr5nX9ksqk669dt+vYLiH3864A2zbllPJsD1TJBMFt0PSoFw?= =?us-ascii?Q?AlKDsT+ilQWEqtISEL/QwX/Wgf8zbGKg51PABoDbY8Y9L8I0SNRFuRLeq6fy?= =?us-ascii?Q?olNNMbqis7QRTeFqZ2bxO1Pnr4hDXVPZvOooODt84UF1mkZA41W8L7crxiNh?= =?us-ascii?Q?HY4Tu5Kl4UpW/ARoV3XlkmMCba4zsv7wmULcZgNSxv0RicoXuk7uqA9x4gPR?= =?us-ascii?Q?IrLZaCqRs4a10CxZJ5U0Ab8AdfTeHAKV/R/jphmVL/h9rvgBAWT/A/ZWSQZG?= =?us-ascii?Q?2ZTfkSi70Hr2mpGP76jDXr8nipTPFfrSTwNdOoOPliNjiRqxBx36vM1IxX/P?= =?us-ascii?Q?MNe76Xt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/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: d74cc06e-b971-4777-a2dd-08dc3c71ff1f X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Mar 2024 17:39:08.8419 (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: OxzD4aMCgQCTWgMHs4JFdpiyghHsfYJsNnrIp4vKzwWruYJnh0cBUvDcdpGAXIvuUx5fs6oRVXR0xKyK4wjRrQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR83MB0607 X-Spam-Status: No, score=-9.7 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 01:55:47 +0100 Subject: [PATCH v2 04/13] aarch64: Add aarch64-w64-mingw32 COFF Define ASM specific for COFF format on AArch64. gcc/ChangeLog: * config.gcc: Add COFF format support definitions. * config/aarch64/aarch64-coff.h: New file. --- gcc/config.gcc | 1 + gcc/config/aarch64/aarch64-coff.h | 91 +++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 gcc/config/aarch64/aarch64-coff.h diff --git a/gcc/config.gcc b/gcc/config.gcc index b762393b64c..cb6661f44ef 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -1266,6 +1266,7 @@ aarch64*-*-linux*) ;; aarch64-*-mingw*) tm_file=3D"${tm_file} aarch64/aarch64-abi-ms.h" + tm_file=3D"${tm_file} aarch64/aarch64-coff.h" tmake_file=3D"${tmake_file} aarch64/t-aarch64" case ${enable_threads} in "" | yes | win32) diff --git a/gcc/config/aarch64/aarch64-coff.h b/gcc/config/aarch64/aarch64= -coff.h new file mode 100644 index 00000000000..79c5a43b970 --- /dev/null +++ b/gcc/config/aarch64/aarch64-coff.h @@ -0,0 +1,91 @@ +/* Machine description for AArch64 architecture. + Copyright (C) 2024 Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GCC is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING3. If not see + . */ + +#ifndef GCC_AARCH64_COFF_H +#define GCC_AARCH64_COFF_H + +#include "aarch64.h" + +#ifndef LOCAL_LABEL_PREFIX +# define LOCAL_LABEL_PREFIX "" +#endif + +/* Using long long breaks -ansi and -std=3Dc90, so these will need to be + made conditional for an LLP64 ABI. */ +#undef SIZE_TYPE +#define SIZE_TYPE "long long unsigned int" + +#undef PTRDIFF_TYPE +#define PTRDIFF_TYPE "long long int" + +#undef LONG_TYPE_SIZE +#define LONG_TYPE_SIZE 32 + +#ifndef ASM_GENERATE_INTERNAL_LABEL +# define ASM_GENERATE_INTERNAL_LABEL(STRING, PREFIX, NUM) \ + sprintf (STRING, "*%s%s%u", LOCAL_LABEL_PREFIX, PREFIX, (unsigned int)(N= UM)) +#endif + +#define ASM_OUTPUT_ALIGN(STREAM, POWER) \ + fprintf (STREAM, "\t.align\t%d\n", (int)POWER) + +/* Output a common block. */ +#ifndef ASM_OUTPUT_COMMON +# define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED) \ + { \ + fprintf (STREAM, "\t.comm\t"); \ + assemble_name (STREAM, NAME); \ + asm_fprintf (STREAM, ", %d, %d\n", \ + (int)(ROUNDED), (int)(SIZE)); \ + } +#endif + +/* Output a local common block. /bin/as can't do this, so hack a + `.space' into the bss segment. Note that this is *bad* practice, + which is guaranteed NOT to work since it doesn't define STATIC + COMMON space but merely STATIC BSS space. */ +#ifndef ASM_OUTPUT_ALIGNED_LOCAL +# define ASM_OUTPUT_ALIGNED_LOCAL(STREAM, NAME, SIZE, ALIGN) \ + { \ + switch_to_section (bss_section); \ + ASM_OUTPUT_ALIGN (STREAM, floor_log2 (ALIGN / BITS_PER_UNIT)); \ + ASM_OUTPUT_LABEL (STREAM, NAME); \ + fprintf (STREAM, "\t.space\t%d\n", (int)(SIZE)); \ + } +#endif + +#define ASM_OUTPUT_SKIP(STREAM, NBYTES) \ + fprintf (STREAM, "\t.space\t%d // skip\n", (int) (NBYTES)) + +#define ASM_OUTPUT_TYPE_DIRECTIVE(STREAM, NAME, TYPE) +#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) + +#define TEXT_SECTION_ASM_OP "\t.text" +#define DATA_SECTION_ASM_OP "\t.data" +#define BSS_SECTION_ASM_OP "\t.bss" + +#define CTORS_SECTION_ASM_OP "\t.section\t.ctors, \"aw\"" +#define DTORS_SECTION_ASM_OP "\t.section\t.dtors, \"aw\"" + +#define GLOBAL_ASM_OP "\t.global\t" + +#undef SUPPORTS_INIT_PRIORITY +#define SUPPORTS_INIT_PRIORITY 0 + +#endif --=20 2.25.1