From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by sourceware.org (Postfix) with ESMTPS id C361D3858D34 for ; Wed, 21 Feb 2024 18:27:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C361D3858D34 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C361D3858D34 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::232 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708540026; cv=none; b=X15n1r2ep/XNRVzg72H40zNRYos0c7scWqVITWNnWIHTGmY3JgNdswTwQDRdS4WURJGIl4abchXEWy8c2eIe9ZRTQFxqG63XMe1ZByKPgoUamlaa2y/ByTrY6FJV6yx/dqdCUKThUOuG769f4ixbfC8nRcWvxrzZkSAo5frCu9U= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708540026; c=relaxed/simple; bh=93GTVZFXFLJSoCKJtG4PddewaWWf2jDzBi6swSvRnEs=; h=DKIM-Signature:Mime-Version:Subject:From:Date:Message-Id:To; b=pHIcyKnNBRI7bfa8B1HaA7PkrOo8uEdcYZL7wQDYNRhef/rBonc9e7oEAUopsErV9N16jXwv38ARqZLUWXXZ96f7EiKqEeJIj+IKl1W9VyWvh1Ur69IEy6IOI4i9+oZTMbD3qIyB0X1A4X4pz2sztpfFQ1NginsGp0i2hECsCeE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2d247f58159so7314591fa.0 for ; Wed, 21 Feb 2024 10:27:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708540022; x=1709144822; darn=gcc.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=G3GgQyiY9Xbc2xHtV5EiNhARbir3Y5/4inz4TYk+Dp8=; b=iEorhXaaGpXsuUia5kjgzT7yBB1aEbN3zmGsoUqRdxOE0ra7eCTv9Sr/RnTFAbb6Aa AVai5ZYEBR8waPWVNdp2qlsDqm1g20BRlnz6VfjpZ+WB8m32Qgbnj7bVFQCPR9EU5xoF dnX5Wj5TNuCgEPPkS5ru8gJtu1lqI6nI3RuFzv5RvfI7C8i3QrgZbDnhdNQNpnGHEnRC /ruvVDIHrVPw7eH2tL30A53R6SXl6Vpr6qNFs4u+bnVs/psqtonjcWO4nLFFL5/Dd+nw YeiXcm2fly0j3HjF47y/9FdpJ2WB1xuxw6PMDkzZ4m5pkQofTTQr+DNY+5WwveLMz6lR aSSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708540022; x=1709144822; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=G3GgQyiY9Xbc2xHtV5EiNhARbir3Y5/4inz4TYk+Dp8=; b=bm0zcEE9w6vSzNbLqNOwpXMm5OJlvtKJKD/MvZHLWEwxpr2rtIj+NSOO8P99KL2tHe JdxTfjk7bvlEjE/a1E2r3m9YOkT0KjGdCVpaz3Mm1Ca3MIsnLqXbwXHQNErFo0qXvpJe 04yv4hJdKvdiplXpsytsHQXblYxKei0vgZqgbpZQKr2hckWvi5sRclXmdmqf/JEXvl9o ou280whggIzXjRd/+CmfSZS54aoaWwRItfVH0z4wi2uvyW0B6dAZotBHl6Z9EyfBrPfG eSSvDbar+tpKyctB8MYBylrAXaP8XgaDnbz+KjXhUdhc81YL+NT+5Szl6CecCfhDGQp7 eWSA== X-Gm-Message-State: AOJu0YyAUhu8n/MH7o3a3Borw2mb3XClWQ7gP6X9FzR63eb+cY7Tq1n3 2/CXW7VnrpTj6yP2npg3tXSmtTqs9t4H69cooVbltDMeO9BAqjRmyzimK/jc5w== X-Google-Smtp-Source: AGHT+IG5dj/qYx2ZnnIrBHbc6BcioHV91NPly4ltiFkH9In4BSRYJrIFiCTwQDfdZ3kF7n0UfqX5kA== X-Received: by 2002:ac2:4e8b:0:b0:512:a6cd:b37e with SMTP id o11-20020ac24e8b000000b00512a6cdb37emr170823lfr.2.1708540021753; Wed, 21 Feb 2024 10:27:01 -0800 (PST) Received: from smtpclient.apple ([37.252.94.180]) by smtp.gmail.com with ESMTPSA id rg8-20020a1709076b8800b00a3e209b225asm4781536ejc.43.2024.02.21.10.26.59 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Feb 2024 10:27:01 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.300.61.1.2\)) Subject: Re: [PATCH v1 00/13] Add aarch64-w64-mingw32 target From: Maxim Kuvyrkov In-Reply-To: Date: Wed, 21 Feb 2024 22:26:48 +0400 Cc: "gcc-patches@gcc.gnu.org" , "richard.sandiford@arm.com" , "10walls@gmail.com" <10walls@gmail.com>, "mark@harmstone.com" , Zac Walker , Ron Riddle , Radek Barton Content-Transfer-Encoding: quoted-printable Message-Id: <3A8EFF8F-6D44-428F-9737-FA95FE6E9D3C@linaro.org> References: To: Evgeny Karpov X-Mailer: Apple Mail (2.3774.300.61.1.2) X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_BARRACUDACENTRAL,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Evgeny, Great job! For reference, here is a test build of this patch series using Linaro = Toolchain CI: = https://ci.linaro.org/view/tcwg-build/job/tcwg_gnu_mingw_build--master-woa= 64-build/9/artifact/artifacts/=20 -- Maxim Kuvyrkov https://www.linaro.org > On Feb 21, 2024, at 21:47, Evgeny Karpov = wrote: >=20 > Hello, >=20 > We would like to take your attention to the review of changes for the > new GCC target, aarch64-w64-mingw32. The new target will be > supported, tested, added to CI, and maintained by Linaro. This marks > the first of three planned patch series contributing to the GCC C > compiler's support for Windows Arm64. >=20 > 1. Minimal aarch64-w64-mingw32 C implementation to cross-compile > hello-world with libgcc for Windows Arm64 using MinGW. > 2. Extension of the aarch64-w64-mingw32 C implementation to > cross-compile OpenSSL, OpenBLAS, FFmpeg, and libjpeg-turbo. All > packages successfully pass tests. > 3. Addition of call stack support for debugging, resolution of > optimization issues in the C compiler, and DLL export/import for the > aarch64-w64-mingw32 target. >=20 > This patch series introduces the 1st point, which involves building > hello-world for the aarch64-w64-mingw32 target. The patch depends on > the binutils changes for the aarch64-w64-mingw32 target that have > already been merged. >=20 > The binutils should include recent relocation fixes. > f87eaf8ff3995a5888c6dc4996a20c770e6bcd36 > aarch64: Add new relocations and limit COFF AArch64 relocation offsets >=20 > The series is structured in a way to trivially show that it should not > affect any other targets. >=20 > In this patch, several changes have been made to support the > aarch64-w64-mingw32 target for GCC. The modifications include the > definition of the MS ABI for aarch64, adjustments to FIXED_REGISTERS > and STATIC_CHAIN_REGNUM for different ABIs, and specific definitions > for COFF format on AArch64. Additionally, the patch reuses MinGW > types and definitions from i386, relocating them to a new > mingw folder for shared usage between both targets. >=20 > MinGW-specific options have been introduced for AArch64, along with > override options for aarch64-w64-mingw32. Builtin stack probing for > override options for aarch64-w64-mingw32. Builtin stack probing for > AArch64 has been enabled as an alternative for chkstk. Symbol name > encoding and section information handling for aarch64-w64-mingw32 have > been incorporated, and the MinGW environment has been added, which > will also be utilized for defining the Cygwin environment in the > future. >=20 > The patch includes renaming "x86 Windows Options" to "Cygwin and MinGW > Options," which now encompasses AArch64 as well. AArch64-specific > Cygwin and MinGW Options have been introduced for the unique > requirements of the AArch64 architecture. >=20 > Function type declaration and named sections support have been added. > The necessary objects for Cygwin and MinGW have been built for the > aarch64-w64-mingw32 target, and relevant files such as msformat-c.cc > and winnt-d.cc have been moved to the mingw folder for reuse in > AArch64. >=20 > Furthermore, the aarch64-w64-mingw32 target has been included in both > libatomic and libgcc, ensuring support for the AArch64 architecture > within these libraries. These changes collectively enhance the > capabilities of GCC for the specified target. >=20 > Coauthors: Zac Walker , > Mark Harmstone and > Ron Riddle >=20 > Refactored, prepared, and validated by=20 > Radek Barton and=20 > Evgeny Karpov >=20 > Special thanks to the Linaro GNU toolchain team for internal review > and assistance in preparing the patch series! >=20 > Regards, > Evgeny >=20 >=20 > Zac Walker (13): > Introduce aarch64-w64-mingw32 target > aarch64: The aarch64-w64-mingw32 target implements the MS ABI > aarch64: Mark x18 register as a fixed register for MS ABI > aarch64: Add aarch64-w64-mingw32 COFF > Reuse MinGW from i386 for AArch64 > Rename section and encoding functions from i386 which will be used in > aarch64 > Exclude i386 functionality from aarch64 build > aarch64: Add Cygwin and MinGW environments for AArch64 > aarch64: Add SEH to machine_function > Rename "x86 Windows Options" to "Cygwin and MinGW Options" > aarch64: Build and add objects for Cygwin and MinGW for AArch64 > aarch64: Add aarch64-w64-mingw32 target to libatomic > Add aarch64-w64-mingw32 target to libgcc >=20 > fixincludes/mkfixinc.sh | 3 +- > gcc/config.gcc | 47 +++-- > gcc/config/aarch64/aarch64-coff.h | 92 +++++++++ > gcc/config/aarch64/aarch64-opts.h | 7 + > gcc/config/aarch64/aarch64-protos.h | 5 + > gcc/config/aarch64/aarch64.h | 25 ++- > gcc/config/aarch64/cygming.h | 178 ++++++++++++++++++ > gcc/config/i386/cygming.h | 18 +- > gcc/config/i386/cygming.opt.urls | 30 --- > gcc/config/i386/i386-protos.h | 12 +- > gcc/config/i386/mingw-w64.opt.urls | 2 +- > gcc/config/lynx.opt.urls | 2 +- > gcc/config/{i386 =3D> mingw}/cygming.opt | 0 > gcc/config/mingw/cygming.opt.urls | 30 +++ > gcc/config/{i386 =3D> mingw}/cygwin-d.cc | 0 > gcc/config/{i386 =3D> mingw}/mingw-stdint.h | 0 > gcc/config/{i386 =3D> mingw}/mingw.opt | 0 > gcc/config/{i386 =3D> mingw}/mingw.opt.urls | 2 +- > gcc/config/{i386 =3D> mingw}/mingw32.h | 0 > gcc/config/{i386 =3D> mingw}/msformat-c.cc | 0 > gcc/config/{i386 =3D> mingw}/t-cygming | 23 ++- > gcc/config/{i386 =3D> mingw}/winnt-cxx.cc | 0 > gcc/config/{i386 =3D> mingw}/winnt-d.cc | 0 > gcc/config/{i386 =3D> mingw}/winnt-stubs.cc | 0 > gcc/config/{i386 =3D> mingw}/winnt.cc | 30 +-- > gcc/doc/invoke.texi | 12 +- > gcc/varasm.cc | 2 +- > libatomic/configure.tgt | 2 +- > libgcc/config.host | 23 ++- > libgcc/config/aarch64/t-no-eh | 2 + > libgcc/config/{i386 =3D> mingw}/t-gthr-win32 | 0 > libgcc/config/{i386 =3D> mingw}/t-mingw-pthread | 0 > 32 files changed, 450 insertions(+), 97 deletions(-) > create mode 100644 gcc/config/aarch64/aarch64-coff.h > create mode 100644 gcc/config/aarch64/cygming.h > delete mode 100644 gcc/config/i386/cygming.opt.urls > rename gcc/config/{i386 =3D> mingw}/cygming.opt (100%) > create mode 100644 gcc/config/mingw/cygming.opt.urls > rename gcc/config/{i386 =3D> mingw}/cygwin-d.cc (100%) > rename gcc/config/{i386 =3D> mingw}/mingw-stdint.h (100%) > rename gcc/config/{i386 =3D> mingw}/mingw.opt (100%) > rename gcc/config/{i386 =3D> mingw}/mingw.opt.urls (86%) > rename gcc/config/{i386 =3D> mingw}/mingw32.h (100%) > rename gcc/config/{i386 =3D> mingw}/msformat-c.cc (100%) > rename gcc/config/{i386 =3D> mingw}/t-cygming (73%) > rename gcc/config/{i386 =3D> mingw}/winnt-cxx.cc (100%) > rename gcc/config/{i386 =3D> mingw}/winnt-d.cc (100%) > rename gcc/config/{i386 =3D> mingw}/winnt-stubs.cc (100%) > rename gcc/config/{i386 =3D> mingw}/winnt.cc (97%) > create mode 100644 libgcc/config/aarch64/t-no-eh > rename libgcc/config/{i386 =3D> mingw}/t-gthr-win32 (100%) > rename libgcc/config/{i386 =3D> mingw}/t-mingw-pthread (100%) >=20 > --=20 > 2.25.1 >=20