From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on2111.outbound.protection.outlook.com [40.107.14.111]) by sourceware.org (Postfix) with ESMTPS id D307F3858D1E for ; Thu, 11 Apr 2024 13:50:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D307F3858D1E 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 D307F3858D1E Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.14.111 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1712843433; cv=pass; b=pxEc53A8jmibs5J93frnIBe2alKTDcPGt8fysp7rB8EbqBwbNKRSkoSM9ilXJ2lor7FV2teN6y7ZQPUpcbnVDL4WW8czG27orPJSSmDD63HN5NWOHyn50jwXgWH+4i1DOVztqfMiBBAYxfANJib6/CREIvg5G68vWkgXETtC4cU= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1712843433; c=relaxed/simple; bh=o5Yz+Ug06k5uxLMJnHo+eQwOGmHUBXESZW3uQ8lh6d0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=RG5Tiwb9Fm5YoseD8/emteJgPNTW8TdoLzMfFrKfqtixe4sh02+lQAwFFgBaPuNQAFZimu15spc7iPvbGj4pEIvwk6+o4YOB/+Nf7ObO7xyPOaX2jdrusp9yLMThspJFDj3Xe3uYmqIYZPws1bjWZOM5507KrCavGvZAUPugkjA= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bCmHRqtpy8oJGDZZgYnm+j5hc4XXr+5Y01NnXcNPhkzNu7fOgKPmERiWWjjO/VB8CufkG3tNsvyFtNy/zmm9t8oRUWa0Jg7E/Dx81BlN11d+xyBHZznqstiXA9MDWparDUXz1d4TkpzzBaJ/VYxFOgN6x07DrpqhEu9O7scATPBNttyZjRxCl/5bRsvFCp7+tPetC43MuXR74D2ksyP50dwthl7HA5pxDRabKGhvjKkLFZBDVSat9fbtpOKelH6j1vZmQK2JhJzB3dKxzHRHO7jNeRjGyMddxoUT8Y7Kk1/jaPvTZ+lYNnZqe6l7zE2f+8f57Hz1YtncsdQdBmYhWg== 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=S0m8lNwpXRRD1Sne6gtP0YbFESJNTdL5/qOYSjwnG0s=; b=XbRo6UMQgRaN5Pn8xSz99qjkXsBJpX9h9jAyS3lx/oxDFF3wzxOqu1gKjzKfwKYrxAjYXZiJRaXDCB6cnDapmt1UfeVt7eGLusrv0cilk/mYRL+sYCl+T7UaQYnBjmnNwA9Zr7YvCIc1ksO8uqzrAYIDsbMwJ93NsJBb2B2cc9oVJZuEWdAs8hqg/E8XMXQi3QTdzek+QlSFdmEJvxDpT/LkUUQXIKi6F9VfBrlvEPxCeQOc+/kVg0JkwjOz46dNeMb5J5tfUQl0HW+JsdEgiBt61S8WrpLWlHVcLblkKGPZh4YCrjpu1XP2kieG+x/5NjWQhzPgCrMJ+RDQvSpFqw== 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=S0m8lNwpXRRD1Sne6gtP0YbFESJNTdL5/qOYSjwnG0s=; b=ZbvQwyplu9g/+VyFkt1qN3IiYcqKSNYhIquW8NVnZallslLsMEX0FiQ/TTgefP6PPQKukcxpu1OQbm7Ogq6q380Xxr/y4vc50tLktlBm3WBk0APMzXb8EWOPuxm1wxlpAkGs34Yyo4Gvx4v4Ke/neREEHHbPMb1nVgLBG2/Y9Ds= Received: from VI1PR83MB0431.EURPRD83.prod.outlook.com (2603:10a6:800:17f::6) by PA4PR83MB0525.EURPRD83.prod.outlook.com (2603:10a6:102:26a::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7495.12; Thu, 11 Apr 2024 13:50:26 +0000 Received: from VI1PR83MB0431.EURPRD83.prod.outlook.com ([fe80::7147:b7f9:31fb:39f7]) by VI1PR83MB0431.EURPRD83.prod.outlook.com ([fe80::7147:b7f9:31fb:39f7%6]) with mapi id 15.20.7495.011; Thu, 11 Apr 2024 13:50:25 +0000 From: Evgeny Karpov To: Evgeny Karpov , "gcc-patches@gcc.gnu.org" CC: "richard.sandiford@arm.com" , "Richard Earnshaw (lists)" , Maxim Kuvyrkov , Radek Barton Subject: [PATCH v3 03/12] aarch64: Add aarch64-w64-mingw32 COFF Thread-Topic: [PATCH v3 03/12] aarch64: Add aarch64-w64-mingw32 COFF Thread-Index: AQHajBc0/zm4gLVn60Cdojzc13I+hg== Date: Thu, 11 Apr 2024 13:50:25 +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=ee10a91a-ecb0-4ef6-a7aa-22b9c54f3645;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-04-11T13:35:01Z;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_|PA4PR83MB0525:EE_ x-ms-office365-filtering-correlation-id: 9bda61dc-66a3-4df6-6fe8-08dc5a2e5732 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: R7p9VS5CKOwUcdEAjyBfKHTXH3VhcMYXbo4yZnHhM0ZMOSu33aMlQmVjB1iiITc+k5fygQxOy9pdmQkiswv6IS4IE2LqWyvo0nm/nZ5qZ9MSldh0PTepZaTmnQ0z3OLYkKE3i3IBljbzBSUIBPBxOWDURARXyg6B9zsnyHvCjZycgal7T9vbftzwydNDPBIq2itLUzAsAHnZTVC6OWwTYqo1lgE2f4CoOHOVD9JmXtc09DWD/buM9wyGksMymnQCkKgEcIjiqLLZkLcA/+N9GItyt5AnTdi8fDIZCQkrqWbpCuT59ogiNRqki8PeC2wzJhJboj5NZAst2P9XPcYUjgGa9hDYYOGzCZEM1txB8QMNlt4qaOvSkmHc39u1aULdpg5i6iequNJujP8Dz1CCd46ms93ze895+0FJAX9b42+x2TN0OTkjuwc2yVlAv7vHqyBbdMwP8mX6KO2R1lsOeUI+u9ZHcPrl9rksmCq2/rF+odit0j8qNauRk6Elk87zq/WrQkrZlI/C8Ws/5fK3pN6BREA2+1yAA6anlSRUCYvMlGz2Jfp1fS3meEBwWizxtZgmz1nO4Jx3oHC+DF0cDpqUZO24YXwCwH3bWu1RzFTQo+ojIu24ysrYv0Ml3hAdUpV25YL/X1gXQyT8HJ4+27sH1KEMEuX1BGgceJb9TWM= 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)(1800799015)(376005)(366007)(38070700009);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?F5wnhu+eNdbNtNJNKUODR7DWppV3Mrw+cq/IZh/keZS/zFRVX0afEJWvRTOy?= =?us-ascii?Q?szbxWKw+AxHT2zg0cIHgSoLoTZf79NsSWfwCr5WP24JtRZbYlyRFlQ9WaqVu?= =?us-ascii?Q?G6MQrWKMm1h5gyGjaNXhc7iF+aLvZvnwUfft2h+1WPYk0089gFxROEI+8uTA?= =?us-ascii?Q?l/kfVMqTYa59Ml6kiR64081c2ER4MOi5YPtXTK6+MwXDvGxT9CwUBu8OeXKN?= =?us-ascii?Q?r9FF4pqu4R1/Ls7y51wSUgAh44Z/Yy+Y2ehxx1eTfbd+wdZeDlMYQEZrOrxs?= =?us-ascii?Q?eUdiMvWSEGXDUIRhFpdUAj10qtRj+v4+tra6e0QdZbLexJ1bsc5OcPaKDfBx?= =?us-ascii?Q?v+n1EcQ73RuKLaqncAKdtWSro/j2k7SpwG0Bm+HPzUDpKwOgt7kh4Xbn6Mkn?= =?us-ascii?Q?oCCHEeENgNGQPDNSpbJ6N4duD5acq5+arWUMOHTUsBiRUQO06spkeuo40i59?= =?us-ascii?Q?FHTp+NHXe2ZRj3N7XdZIr8ao4MVWTMw+ZbiJiIpM/ZBQWFk5HhJedlHjS5GU?= =?us-ascii?Q?MB2RGv6B2JbK31Q7No8dSUqvOqaR8EkcqEBeibPKycizi+Fp17b7DZSFqbOV?= =?us-ascii?Q?LGJ4tTH9SMTAdzbCWe0nhVsV+uDfww0UzxiNzH6Ka9P3e/TAd3t0vJ7I3Y67?= =?us-ascii?Q?sFb917WqS2kWj4xeva8r5wa1ppo2iM0oQyY5wBj49pvdvLC1FVqhtio93eDZ?= =?us-ascii?Q?Q1+qOKwYsIan22CatQ8e8QaXWoKKaOEaFPweaUmYJ/tWs1pTEMvAqUFSLC9E?= =?us-ascii?Q?u5vccbyorH1IoxntW78edIlfDGo1WEKW2jYxOiJk15wZsHls+m3z1/gtjyMB?= =?us-ascii?Q?7nbxahspjE4xKmM9yRghoah0fa0gdauLi19fLQtmh3JcBilViRgTUsjLG53h?= =?us-ascii?Q?Duoy87zms1a9SOca/tOH8Kr6uAUMQoiU8/jsZpjGSkAgcLpBCw2JXWv/rv24?= =?us-ascii?Q?57neSeEWqVFlOMbyRGGvT1UXDZHjAMUQZls/+A8dPYbYejJPOamaQLbn7j6C?= =?us-ascii?Q?rXf/5i2Q6GWXnukm1OLVC0pd8abZyYkO/xHUvbx0/efG/26CrkQzlvqrCXmW?= =?us-ascii?Q?oXmpVvwTtSkd1duTJz0XDs0fGChqpVTH08nUerH8B++LiF9Y8sA1clvZjxp1?= =?us-ascii?Q?6OfG+5AMaX8vzAQqBno0IhYGkSG6gmpXYvWicz8vuKVd7JK5vO+wqxodNOxd?= =?us-ascii?Q?qjrI6qMfOOABTG4kMC/JWFTh9IuybjPDNc62huHntVF4XwHapV4EEq6YvFPp?= =?us-ascii?Q?HgBoq6I6WgS0JZVRmxAZjJZBRVgLZ8yCar5+sHjoEnN5uWekDXZipMV43kyJ?= =?us-ascii?Q?/veaQT6duXxS8BBLkZHcDTOiwyxd5qOshG4LoshPVDhq7NU1EtdJdIpMQLeI?= =?us-ascii?Q?XJ7aomyboPfowVB+4rqVT9tzi+b/088qkjg1Fqn82EoYfdmTgWQzVheckGY4?= =?us-ascii?Q?dmFGpof3G49odCmcYsVfKGoSk0cdAT8U3ShHvwZ8b62I/oLIaUHUD5v9I2mJ?= =?us-ascii?Q?wV/CqV6/7/hBegwf2UEfvVLz9L6UIOZ3GUpluIUQuvk0L7LR/+Fmy0VZvGmt?= =?us-ascii?Q?7YzR1yAT2foEZf2qIWq88zCW2PiLld5kG/2C7oiI?= 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: 9bda61dc-66a3-4df6-6fe8-08dc5a2e5732 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Apr 2024 13:50:25.7275 (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: 7zUpmGwep3nTMN95+I8X46RflM7LBC6UKqJx0edZsoTkgswC4xzBpfuJA10flI2BC4KcHcUZGlveUYy2fJv2Vg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR83MB0525 X-Spam-Status: No, score=-11.1 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_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,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 List-Id: From: Zac Walker Date: Thu, 11 Apr 2024 14:46:07 +0200 Subject: [PATCH v3 03/12] 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 0aeb5641461..dffc041cc18 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -1273,6 +1273,7 @@ aarch64*-*-gnu*) ;; 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..81fd9954f75 --- /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 + +#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)) + +/* Definitions that are not yet supported by binutils for the + aarch64-w64-mingw32 target. */ +#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