public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Evgeny Karpov <Evgeny.Karpov@microsoft.com>
To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Cc: "richard.sandiford@arm.com" <richard.sandiford@arm.com>,
	"10walls@gmail.com" <10walls@gmail.com>,
	Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org>,
	"mark@harmstone.com" <mark@harmstone.com>,
	Zac Walker <zacwalker@microsoft.com>,
	Ron Riddle <Ron.Riddle@microsoft.com>,
	Radek Barton <radek.barton@microsoft.com>
Subject: [PATCH v1 00/13] Add aarch64-w64-mingw32 target
Date: Wed, 21 Feb 2024 17:47:25 +0000	[thread overview]
Message-ID: <VI1PR83MB04314E947B1CF296708085DDF8572@VI1PR83MB0431.EURPRD83.prod.outlook.com> (raw)

Hello,

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.

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.

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.

The binutils should include recent relocation fixes.
f87eaf8ff3995a5888c6dc4996a20c770e6bcd36
aarch64: Add new relocations and limit COFF AArch64 relocation offsets

The series is structured in a way to trivially show that it should not
affect any other targets.

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
<stdint.h> types and definitions from i386, relocating them to a new
mingw folder for shared usage between both targets.

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.

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.

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.

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.

Coauthors: Zac Walker <zacwalker@microsoft.com>,
Mark Harmstone <mark@harmstone.com>  and
Ron Riddle <ron.riddle@microsoft.com>

Refactored, prepared, and validated by 
Radek Barton <radek.barton@microsoft.com> and 
Evgeny Karpov <evgeny.karpov@microsoft.com>

Special thanks to the Linaro GNU toolchain team for internal review
and assistance in preparing the patch series!

Regards,
Evgeny


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

 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 => mingw}/cygming.opt        |   0
 gcc/config/mingw/cygming.opt.urls             |  30 +++
 gcc/config/{i386 => mingw}/cygwin-d.cc        |   0
 gcc/config/{i386 => mingw}/mingw-stdint.h     |   0
 gcc/config/{i386 => mingw}/mingw.opt          |   0
 gcc/config/{i386 => mingw}/mingw.opt.urls     |   2 +-
 gcc/config/{i386 => mingw}/mingw32.h          |   0
 gcc/config/{i386 => mingw}/msformat-c.cc      |   0
 gcc/config/{i386 => mingw}/t-cygming          |  23 ++-
 gcc/config/{i386 => mingw}/winnt-cxx.cc       |   0
 gcc/config/{i386 => mingw}/winnt-d.cc         |   0
 gcc/config/{i386 => mingw}/winnt-stubs.cc     |   0
 gcc/config/{i386 => 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 => mingw}/t-gthr-win32    |   0
 libgcc/config/{i386 => 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 => mingw}/cygming.opt (100%)
 create mode 100644 gcc/config/mingw/cygming.opt.urls
 rename gcc/config/{i386 => mingw}/cygwin-d.cc (100%)
 rename gcc/config/{i386 => mingw}/mingw-stdint.h (100%)
 rename gcc/config/{i386 => mingw}/mingw.opt (100%)
 rename gcc/config/{i386 => mingw}/mingw.opt.urls (86%)
 rename gcc/config/{i386 => mingw}/mingw32.h (100%)
 rename gcc/config/{i386 => mingw}/msformat-c.cc (100%)
 rename gcc/config/{i386 => mingw}/t-cygming (73%)
 rename gcc/config/{i386 => mingw}/winnt-cxx.cc (100%)
 rename gcc/config/{i386 => mingw}/winnt-d.cc (100%)
 rename gcc/config/{i386 => mingw}/winnt-stubs.cc (100%)
 rename gcc/config/{i386 => mingw}/winnt.cc (97%)
 create mode 100644 libgcc/config/aarch64/t-no-eh
 rename libgcc/config/{i386 => mingw}/t-gthr-win32 (100%)
 rename libgcc/config/{i386 => mingw}/t-mingw-pthread (100%)

-- 
2.25.1


             reply	other threads:[~2024-02-21 17:47 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-21 17:47 Evgeny Karpov [this message]
2024-02-21 18:16 ` [PATCH v1 01/13] Introduce " Evgeny Karpov
2024-02-21 18:23   ` Andrew Pinski
2024-02-23 14:15     ` Evgeny Karpov
2024-02-23 22:02       ` Fangrui Song
2024-02-22 11:33   ` Richard Earnshaw (lists)
2024-02-21 18:26 ` [PATCH v1 00/13] Add " Maxim Kuvyrkov
2024-02-22 22:03   ` Evgeny Karpov
2024-02-21 18:26 ` [PATCH v1 02/13] aarch64: The aarch64-w64-mingw32 target implements Evgeny Karpov
2024-02-22 11:40   ` Richard Earnshaw (lists)
2024-02-23 14:22     ` Evgeny Karpov
2024-02-23 17:49       ` Richard Sandiford
2024-02-23 17:54         ` Andrew Pinski
2024-02-25 21:15           ` Mark Harmstone
2024-02-23 20:37         ` Martin Storsjö
2024-02-23 21:47           ` Evgeny Karpov
2024-02-23 21:32         ` Evgeny Karpov
2024-02-21 18:30 ` [PATCH v1 03/13] aarch64: Mark x18 register as a fixed register for MS ABI Evgeny Karpov
2024-02-22 11:55   ` Richard Earnshaw (lists)
2024-02-22 17:45     ` Andrew Pinski
2024-02-22 18:15       ` Iain Sandoe
2024-02-23 16:10       ` Jacek Caban
2024-02-26 16:34         ` Evgeny Karpov
2024-02-23 16:56     ` Richard Sandiford
2024-02-26 17:03       ` Evgeny Karpov
2024-02-26 16:07     ` Evgeny Karpov
2024-02-22 13:11   ` Richard Earnshaw (lists)
2024-02-22 15:06     ` [EXTERNAL] " Evgeny Karpov
2024-02-21 18:32 ` [PATCH v1 04/13] aarch64: Add aarch64-w64-mingw32 COFF Evgeny Karpov
2024-02-23 17:01   ` Richard Sandiford
2024-02-26 18:16     ` Evgeny Karpov
2024-02-21 18:34 ` [PATCH v1 05/13] Reuse MinGW from i386 for AArch64 Evgeny Karpov
2024-02-21 18:50   ` Andrew Pinski
2024-02-22 15:39     ` Evgeny Karpov
2024-02-21 21:34   ` rep.dot.nop
2024-02-22 11:11     ` Richard Earnshaw (lists)
2024-02-22 15:56       ` Evgeny Karpov
2024-02-23 20:59         ` Bernhard Reutner-Fischer
2024-02-22 17:54       ` Joseph Myers
2024-02-25 21:12       ` Mark Harmstone
2024-02-26  8:17         ` Bernhard Reutner-Fischer
2024-02-26 18:31           ` Evgeny Karpov
2024-02-21 18:35 ` [PATCH v1 06/13] Rename section and encoding functions from i386 which will be used in aarch64 Evgeny Karpov
2024-02-21 18:36 ` [PATCH v1 07/13] Exclude i386 functionality from aarch64 build Evgeny Karpov
2024-02-21 18:36 ` [PATCH v1 08/13] aarch64: Add Cygwin and MinGW environments for AArch64 Evgeny Karpov
2024-02-22 13:23   ` Richard Earnshaw (lists)
2024-02-25 18:52     ` Evgeny Karpov
2024-02-23 17:15   ` Richard Sandiford
2024-02-27 21:17     ` Evgeny Karpov
2024-02-28  1:00       ` Andrew Pinski
2024-02-29 16:45         ` Evgeny Karpov
2024-02-29 17:35           ` Andrew Pinski (QUIC)
2024-02-29 17:46             ` Maxim Kuvyrkov
2024-02-29 17:55               ` Andrew Pinski (QUIC)
2024-02-29 17:59                 ` Richard Earnshaw (lists)
2024-03-01 13:10                   ` Maxim Kuvyrkov
2024-02-29 18:32                 ` Evgeny Karpov
2024-02-28  2:12       ` NightStrike
2024-02-21 18:37 ` [PATCH v1 09/13] aarch64: Add SEH to machine_function Evgeny Karpov
2024-02-21 18:38 ` [PATCH v1 10/13] Rename "x86 Windows Options" to "Cygwin and MinGW Options" Evgeny Karpov
2024-02-22 13:32   ` Richard Earnshaw (lists)
2024-02-27 20:04     ` Evgeny Karpov
2024-02-21 18:39 ` [PATCH v1 11/13] aarch64: Build and add objects for Cygwin and MinGW for AArch64 Evgeny Karpov
2024-02-21 18:40 ` [PATCH v1 12/13] aarch64: Add aarch64-w64-mingw32 target to libatomic Evgeny Karpov
2024-02-21 18:40 ` [PATCH v1 13/13] Add aarch64-w64-mingw32 target to libgcc Evgeny Karpov
2024-02-22 13:36   ` Richard Earnshaw (lists)
2024-02-25 19:14     ` Evgeny Karpov
2024-02-22 13:39 ` [PATCH v1 00/13] Add aarch64-w64-mingw32 target Richard Earnshaw (lists)
2024-02-23 18:00   ` Richard Sandiford
2024-02-29 15:45     ` Evgeny Karpov
2024-02-27 20:32   ` Evgeny Karpov
2024-02-22 18:11 ` Mark Harmstone
2024-02-22 22:16   ` Evgeny Karpov
2024-02-26  1:29 ` NightStrike
2024-02-29 16:25   ` Evgeny Karpov
2024-02-29 18:09     ` NightStrike
2024-02-29 19:34 ` Evgeny Karpov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=VI1PR83MB04314E947B1CF296708085DDF8572@VI1PR83MB0431.EURPRD83.prod.outlook.com \
    --to=evgeny.karpov@microsoft.com \
    --cc=10walls@gmail.com \
    --cc=Ron.Riddle@microsoft.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mark@harmstone.com \
    --cc=maxim.kuvyrkov@linaro.org \
    --cc=radek.barton@microsoft.com \
    --cc=richard.sandiford@arm.com \
    --cc=zacwalker@microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).