From patchwork Mon Mar 4 17:44:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Evgeny Karpov X-Patchwork-Id: 209659 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:fa17:b0:10a:f01:a869 with SMTP id ju23csp1577361dyc; Mon, 4 Mar 2024 09:45:10 -0800 (PST) X-Forwarded-Encrypted: i=4; AJvYcCWg3LcqqWjqXl+JdF33PPwCGhjHvZ2pxrM7wWNolomtckpG0vzVRL+d7c/pK4wXba1yRYd9sQEZQCZbWHR31YhenhnvUA== X-Google-Smtp-Source: AGHT+IEsAeiov9x/YuCkoVuCXJRrBiwzXLePfFBbtK4e9qbdUhqKErzcfAoVehhD9F5xkZ4ZYCq6 X-Received: by 2002:a0c:bf0a:0:b0:68f:2a5e:4fa5 with SMTP id m10-20020a0cbf0a000000b0068f2a5e4fa5mr9691012qvi.11.1709574310483; Mon, 04 Mar 2024 09:45:10 -0800 (PST) ARC-Seal: i=3; a=rsa-sha256; t=1709574310; cv=pass; d=google.com; s=arc-20160816; b=WcVCw+kh6HhpKIIUdVjfNUyi6UYizju0pz6R/Xw0DNTq9K9b6oAHVlbuWA95d/gR8R dIJ5jEQmC9/j/O7KK70yyjybJyIJsTRFqMdX7AgB38EGfL1QDNr+AqHBxePQVzC32xe2 2gBXLPFkBXhwTh4+9wTWmfL/a8NqmLbYxsjyzKgY+4skTdt6ewD5is3NJpQKS3U/tHeW e6ZeE/z4KupmIg4z9WHWic2xBxFJBV987adKzeGcMRyoAobi/oX+QDf2U31ywPssYEAk CW1BhtS92OvWSIB95dpDq5COBf0RA3aRfAuGVmBZcC5JbBJ6kKDNy90n0zzvD931Yb8Z ClaQ== ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version :content-transfer-encoding:msip_labels:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature:arc-filter :dmarc-filter:delivered-to; bh=xxR/Oxx7wmXC31TBb8zZM8iQRKbfndoTHFE7cYw+SSs=; fh=+2oejmI9rg4HZgWvTrkP8qDufDd61kvBMNz7Wu2ta60=; b=CV3lV7ILbKCbHkg3fToqtYBmHmWqBQf0eya9pHmMecgoElULl40yxuPmte2vsJoSRL AqNbh8e1mWqIySr0tQYY+DcCVxjgq/CivmiNgBz99FgpeQSI1zudw8Yvy5Rtrc90M++c PiIXNoRCDgpPuZhLXsIz9GZ7Ojc3SyRKE9smdEdwsv0oyWMLJvNmiJmFVHQtmpKOAo2A TTKNRcn+Bjd6hFaVYnlVA7j4feQnjxN34B+FjkT9KeLpiyzD0B4LXSSwAZZLjfNjJ/Wn 9adzJVRwN3Edf3RkiH+2Xp0NiWApccnx4RiCXJTdsjuMo/cqSBYbtU8i9F9WXusd6r86 YKkg==; dara=google.com ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector2 header.b=LZHqcysk; arc=pass (i=2); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id gs11-20020a056214226b00b0068fff3e72ccsi9977926qvb.372.2024.03.04.09.45.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 09:45:10 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector2 header.b=LZHqcysk; arc=pass (i=2); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2092D3858C54 for ; Mon, 4 Mar 2024 17:45:10 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on2132.outbound.protection.outlook.com [40.107.15.132]) by sourceware.org (Postfix) with ESMTPS id 31BF8385841B for ; Mon, 4 Mar 2024 17:44:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 31BF8385841B 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 31BF8385841B Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.15.132 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1709574268; cv=pass; b=OnvlKNoveHbUSTLC+lvC3J6ZwfplOv7nNY/qcGNsHfaNtThX5DDUGn3p2U/3BL6MRu8y9I3b6mNYbTPawrmoMwdaw1Qw/wFOKVizbjF3tUoUWasvZpWyrTFa7xlEDG9qDHBT56o0gB/wvxk/cjyRoe9vkvmLxulTS1jtr/NfgfY= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1709574268; c=relaxed/simple; bh=SRfkjeiI//AAAiFpgOZcfeAT6ogFObfD39cw0sK1hM0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=t4EFqQWgxlTxVD8ii8hlJ4VJqMTj695NAVSNXuMfdEHGPkN1C0wLoud1ZIGYAw7E6Rv6uoKv9FxOAC6tmCleBCq0xT1sfsxvJBFrD0drlVmJfpGYvEIankftkbw1PABEK8bx8hal4rXbApO6z8PESHKg2/S1adpdd/xpokpzGFI= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZJGIlnQOz+cdJIuj0kra1Ct+eCgOKG9O9wfxds7Gx2kyNLn0TvMWmde4IyMUptOkGgtorVUYsTnRQp75LovNpTq/l7GM+CotNFkDwvCLY7MaEWYzTFXTA43yw/DDLMwaYKmVAKaCzbCkI5OUpnpF5BFR05rIrDEd+fWwdplR5ew1ttzS7OHhB/MIzS4+TnrfhzomiFKSOaKF7wvUw0p5gzrfAQz3iz2cs1l/nIV7VdsA6SxNvYXtrDyux+dfqod9CDtNUtvamxRN9/vpl/WzoROLUJL4t+lV8KhcW1Scf1+w8UFkeudVMPIC50i9DfHkZk1q8XmHSB+EuzHDoaEk2g== 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=xxR/Oxx7wmXC31TBb8zZM8iQRKbfndoTHFE7cYw+SSs=; b=dGzPTI/BKL5GNf3EKBsoOsi3l+1sgVipwSMzbXfNvE40a4DREwNew7N8SS8+A2bRaKhh2d4v0orSK06LhtB9OQeULiKsooEUK5BstPi9e+NcHI7JQBw/89Et/RzYc9chU5RHyHNtjjKZkKzWWdzn1NG6WGvgz7IJ7A5TPFjIYU5O7koIcBC9P5MvZtFrWFs3rhYzLvBXGSMX8zChNQF5k8DrTJCQdBgHLG/b9U2sxi2nw3w1TrEC2yVHiFjwzHFOPuo71+pMOc5POalu+gBSJAoBiUAjG4ibCTfeY1mV4lOuwRN3RgKFPBwcq37rwKZAe9WYC2WP5v+RBzO0lpak4A== 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=xxR/Oxx7wmXC31TBb8zZM8iQRKbfndoTHFE7cYw+SSs=; b=LZHqcyskcqZDim51+qI80kJBNlQHIwTjhy4rRZFBVJLeViLtKAznA0g1s8inB86lscusuWcYqxdWNlh16op4xoDpb17vCXiBFrdHQFA5Z089Huwi4XOwa5qgYnHZ3gwEYY0qJrITveAQUODLa2sWmMK+EUYCu+CcF/1l8+V19SA= 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:44:22 +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:44:22 +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 08/13] aarch64: Add Cygwin and MinGW environments for AArch64 Thread-Topic: [PATCH v2 08/13] aarch64: Add Cygwin and MinGW environments for AArch64 Thread-Index: AQHabluXAcOMVPCXtkuFlFB6rJAtTw== Date: Mon, 4 Mar 2024 17:44:21 +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: 4faa2a10-51e5-495f-b089-08dc3c72b9c6 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Ut+Il7e0rRTj18QZPEf/v+E9OK7RQiNYy3BOLlkZ2PRBZ0UA/GACcwQeCbg+/BWuSIOWIGZ9RvKAwAQkgmVOvy8Yoq0OdrHBcHraecD20nrv5o8ygkRdTU33rLoZ8S5uDguV1wrlt5es1pkGfcMuvnI7gTrEZqA8ZEFF0M47fXn8B66zlEXLPJM/jC/M4C6xNBBwUsSycImHagzTJTeyVnzZNmkzer024aZDd649KB13WLxbqkVCqeUKYNqJFC+CPRYALqeMOjb0e0bjVmxNxs86gfWEytyF4R50Vy8UH52ub+Nwwr7xh+JczUN9VDXbi3NVIQJMSyQjrdDCBjWGZCx3HVK5LJM77ArdGvzu4BpfIh3vIcKUqqajcX/WB7Zp9WxeSUfWa9NiYi3OkuQ9aUJv397lZhhKaxqUo1/feJIFgzAJWgqfo8gSb7es7yvnrs0Z22Uyd2J+9U5yGCBFqP4x4ac6jWTUut+mV2BCRmqZSilKK34zIjPBAThtGpKHItQGjMzxBTgS7xr1TgoI7pinjOauwDNQpWefX0fQF93qTGV3IfFaSgCcM2ecrJuvvfhLaqAv5BngyYYpaatTxO/tGjkr9sePtJEld2oACWzMPKl6kILqg0vL8qR3sXzaoT4x/ScOCy65MjVh3DgXZb+33rLmHMiV3ddPu/DjKT4= 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: bgLm+h3p9r7OMQqyyS2T2jT7BXDtEavgowhfqVJwoQQwJFoT3J1cz8m+5zasqy8IEzfsLplp50i0T/33TP8ziGDuH+WkZninlN/BCPnTTSd0xs1Uw9GiYwb5VfEWKk8nGvrIGWGf8uPBDiC6h2+H0A9/YZVhhDHsUecKcsuRLx2/11N1IT/rTc05oC8jP3Fdsfgs5Ib2aHvQWjawghPiU5FQrqfWdgvkJdFuDnKZdhbRiUUnN3LtaVSOmpwJdxsXm0tgKQTJmpZJToU9Hcd6sAmgqFl67px63drvSz8vDrQVgvLn5fup2GYSpikJgoYsQN9bZ4YbLeECDqk3HpuqCKrxCD6JXR4XxSeW/9/Xit480ZDU9ZJDGqclJiZfCr6/dTxl3MeA/zo7rVP7hdmaFR3b4P+WmlTXjpnKGLtSqKLz+zTo9aJzfs1HnTp65qkRZUZ/Ih/6Zy/oeo4CxlSvYmpRX6318D0HT8Bb/+3bUGE7xoM82MZMbuUNkCndqHFMLr2wIi0VY9vckAOJL2RgFJ2xkNxobonh79ltLykOvjhiPM4TRm9akSDbmzhhMUh1zV25THC+PT6PZzJ7P+4/48114xfoaxswY0QTXh1c0soHtQZlnhVLLFjtNXmjNEQt6FafuBmiCc51CQ7HWQ0BwfnjyKcFdNsqlPJnIl4jdHStQXCuWZgOPU0X3Rm13PGhYWDyVGunZYu3nkxKqd6b8QuVgqmDPEcSXCwNk/NVVKK0TLfno0jHat9Im/meWR++jyc3RSrn5PbD3JoRX/7JSjP/mnKhn1ZxcmiZC9+04mn5l2+qGZPhHs5gQK2BZPMXLyuz+xLoA2C1z++OqAbDOvuD3pLg3aQ6Z3wGF92Wv/aNAX+nhbzaFoxyTcQu0mEJXFCEvYaND9Kf0sCwoDepnlc2l1Z/sX+1LCGNpvvWs986FPMVfVMdQJ1W9rNvKGoj/onLOrdZE7YwkNkYOXlH1Ep91tM7THWWb+unHLavLmajbZ8Hp8/DcTNHJUkr4BGG6m78/3yCs3Lq6+YVhcqsNVMLwOHDcwJ1VpFrwFKmqPojF3zZ/JP2CWwmdtJDMprwTMLHSoJfCHFjdzb38dOSdrJFjxux2yYIXQZquO5H+K6W0J6qMpZ3+ZE8pQQGMvLFKTQvYCB885rAQT3RC/laQunTOIJ4lbXyyxmn7FFBX/LD+EtiOfcrtGW50XKkzkwDgLkQXl2uD1wFHRgNaIR6jX90IQsdXYrNlBP3C7WJQ8cFDBF+3rLNXW5RuKaUbbs+xA1mnq6vsxiVaZ6X9ckTncVUU72MFLCJVHHttPlcCYFPwrr/e+rxGTu0bPAZlysaMWZsy7ynxX4mZ2PSiV+zDjqbeyMBtag4ZWc49LWG56Iy+Tuhgtppdq9gUwQlSCo7MVrJ6GWpuAGMDqBpb86VVQELPFDRyKNVGfl4a1rMgDB54wIcqPXeTF3QeCWedn7QUnTdFxqH9CLOg1NGC9yvZeJRgmAkT1d7Z/An4/UtADoNnPgI6HuVsgO4uIlG06qEGaLGvhVJQTYKsrQ0uALSXRc1Fq/XTYXvJJaN9jKQfs1VYnP9uqt0gajD0e7CAs+6 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: 4faa2a10-51e5-495f-b089-08dc3c72b9c6 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Mar 2024 17:44:22.0094 (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: SlOdlULqWif/5RGj0Y0DTXDEM9JBpv6ueLeP0N2g8mAcKqqXpHbpu7sx5C+gw/XEY4uKL3zOxuUUrPlTzTrA4Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR83MB0436 X-Spam-Status: No, score=-9.0 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_NUMSUBJECT, KAM_SHORT, KAM_STOCKGEN, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792618592414117621 X-GMAIL-MSGID: 1792618592414117621 From: Zac Walker Date: Fri, 1 Mar 2024 10:49:28 +0100 Subject: [PATCH v2 08/13] aarch64: Add Cygwin and MinGW environments for AArch64 Define Cygwin and MinGW environment such as types, SEH definitions, shared libraries, etc. gcc/ChangeLog: * config.gcc: Add Cygwin and MinGW difinitions. * config/aarch64/aarch64-protos.h (mingw_pe_maybe_record_exported_symbol): Declare functions which are used in Cygwin and MinGW environment. (mingw_pe_section_type_flags): Likewise. (mingw_pe_unique_section): Likewise. (mingw_pe_encode_section_info): Likewise. * config/aarch64/cygming.h: New file. --- gcc/config.gcc | 4 + gcc/config/aarch64/aarch64-protos.h | 5 + gcc/config/aarch64/cygming.h | 175 ++++++++++++++++++++++++++++ 3 files changed, 184 insertions(+) create mode 100644 gcc/config/aarch64/cygming.h diff --git a/gcc/config.gcc b/gcc/config.gcc index 3aca257c322..4471599454b 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -1267,7 +1267,11 @@ aarch64*-*-linux*) aarch64-*-mingw*) tm_file="${tm_file} aarch64/aarch64-abi-ms.h" tm_file="${tm_file} aarch64/aarch64-coff.h" + tm_file="${tm_file} aarch64/cygming.h" + tm_file="${tm_file} mingw/mingw32.h" + tm_file="${tm_file} mingw/mingw-stdint.h" tmake_file="${tmake_file} aarch64/t-aarch64" + target_gtfiles="$target_gtfiles \$(srcdir)/config/mingw/winnt.cc" case ${enable_threads} in "" | yes | win32) thread_file='win32' diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h index bd719b992a5..759e1a0f9da 100644 --- a/gcc/config/aarch64/aarch64-protos.h +++ b/gcc/config/aarch64/aarch64-protos.h @@ -1110,6 +1110,11 @@ extern void aarch64_output_patchable_area (unsigned int, bool); extern void aarch64_adjust_reg_alloc_order (); +extern void mingw_pe_maybe_record_exported_symbol (tree, const char *, int); +extern unsigned int mingw_pe_section_type_flags (tree, const char *, int); +extern void mingw_pe_unique_section (tree, int); +extern void mingw_pe_encode_section_info (tree, rtx, int); + bool aarch64_optimize_mode_switching (aarch64_mode_entity); void aarch64_restore_za (rtx); diff --git a/gcc/config/aarch64/cygming.h b/gcc/config/aarch64/cygming.h new file mode 100644 index 00000000000..2f239c42a89 --- /dev/null +++ b/gcc/config/aarch64/cygming.h @@ -0,0 +1,175 @@ +/* Operating system specific defines to be used when targeting GCC for + hosting on Windows32, using a Unix style C library and tools. + Copyright (C) 1995-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_CYGMING_H +#define GCC_AARCH64_CYGMING_H + +#undef PREFERRED_DEBUGGING_TYPE +#define PREFERRED_DEBUGGING_TYPE DINFO_TYPE_NONE + +#define FASTCALL_PREFIX '@' + +#define print_reg(rtx, code, file) + +#define SYMBOL_FLAG_DLLIMPORT 0 +#define SYMBOL_FLAG_DLLEXPORT 0 + +#define SYMBOL_REF_DLLEXPORT_P(X) \ + ((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_DLLEXPORT) != 0) + +/* Disable SEH and declare the required SEH-related macros that are +still needed for compilation. */ +#undef TARGET_SEH +#define TARGET_SEH 0 + +#define SSE_REGNO_P(N) 0 +#define GENERAL_REGNO_P(N) 0 +#define SEH_MAX_FRAME_SIZE 0 + +#undef DEFAULT_ABI +#define DEFAULT_ABI AARCH64_CALLING_ABI_MS + +#undef TARGET_PECOFF +#define TARGET_PECOFF 1 + +#include +#ifdef __MINGW32__ +#include +#endif + +extern void mingw_pe_asm_named_section (const char *, unsigned int, tree); +extern void mingw_pe_declare_function_type (FILE *file, const char *name, + int pub); + +#define TARGET_ASM_NAMED_SECTION mingw_pe_asm_named_section + +/* Select attributes for named sections. */ +#define TARGET_SECTION_TYPE_FLAGS mingw_pe_section_type_flags + +#define TARGET_ASM_UNIQUE_SECTION mingw_pe_unique_section +#define TARGET_ENCODE_SECTION_INFO mingw_pe_encode_section_info + +/* Declare the type properly for any external libcall. */ +#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \ + mingw_pe_declare_function_type (FILE, XSTR (FUN, 0), 1) + +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define ("__MSVCRT__"); \ + builtin_define ("__MINGW32__"); \ + builtin_define ("_WIN32"); \ + builtin_define_std ("WIN32"); \ + builtin_define_std ("WINNT"); \ + builtin_define_with_int_value ("_INTEGRAL_MAX_BITS", \ + TYPE_PRECISION (intmax_type_node)); \ + builtin_define ("__MINGW64__"); \ + builtin_define_std ("WIN64"); \ + builtin_define ("_WIN64"); \ + builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ + builtin_define ("__fastcall=__attribute__((__fastcall__))"); \ + builtin_define ("__thiscall=__attribute__((__thiscall__))"); \ + builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ + } \ + while (0) + +/* Windows64 continues to use a 32-bit long type. */ +#undef LONG_TYPE_SIZE +#define LONG_TYPE_SIZE 32 + +#undef DEFAULT_SIGNED_CHAR +#define DEFAULT_SIGNED_CHAR 1 + +#undef SIZE_TYPE +#undef PTRDIFF_TYPE +#define SIZE_TYPE "long long unsigned int" +#define PTRDIFF_TYPE "long long int" + +#undef WCHAR_TYPE_SIZE +#undef WCHAR_TYPE +#define WCHAR_TYPE_SIZE 16 +#define WCHAR_TYPE "short unsigned int" + +#define drectve_section() \ + (fprintf (asm_out_file, "\t.section\t.drectve\n"), \ + in_section = NULL) + + +/* Enable alias attribute support. */ +#ifndef SET_ASM_OP +#define SET_ASM_OP "\t.set\t" +#endif + +/* GNU as supports weak symbols on PECOFF. */ +#define ASM_WEAKEN_LABEL(FILE, NAME) \ + do \ + { \ + fputs ("\t.weak\t", (FILE)); \ + assemble_name ((FILE), (NAME)); \ + fputc ('\n', (FILE)); \ + } \ + while (0) + +/* Get tree.cc to declare a target-specific specialization of + merge_decl_attributes. */ +#define TARGET_DLLIMPORT_DECL_ATTRIBUTES 1 + +#define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM, BODY, VALUE, REL) \ + do { \ + switch (GET_MODE (BODY)) \ + { \ + case E_QImode: \ + asm_fprintf (STREAM, "\t.byte\t(%LL%d - %LLrtx%d) / 4\n", \ + VALUE, REL); \ + break; \ + case E_HImode: \ + asm_fprintf (STREAM, "\t.2byte\t(%LL%d - %LLrtx%d) / 4\n", \ + VALUE, REL); \ + break; \ + case E_SImode: \ + case E_DImode: /* See comment in aarch64_output_casesi. */ \ + asm_fprintf (STREAM, "\t.word\t(%LL%d - %LLrtx%d) / 4\n", \ + VALUE, REL); \ + break; \ + default: \ + gcc_unreachable (); \ + } \ + } while (0) + +#define READONLY_DATA_SECTION_ASM_OP "\t.section\t.rdata,\"dr\"" + +#undef SUBTARGET_OVERRIDE_OPTIONS +#define SUBTARGET_OVERRIDE_OPTIONS \ + do { \ + flag_stack_check = STATIC_BUILTIN_STACK_CHECK; \ + } while (0) + + +#define SUPPORTS_ONE_ONLY 1 + +/* Define this to be nonzero if static stack checking is supported. */ +#define STACK_CHECK_STATIC_BUILTIN 1 + +#define HAVE_GAS_ALIGNED_COMM 1 + +#undef MAX_OFILE_ALIGNMENT +#define MAX_OFILE_ALIGNMENT (8192 * 8) + +#endif