[v1,0/6] Add DLL import/export implementation to AArch64

Message ID PR3PR83MB0425E5A9911AEB3716BEC140F80E2@PR3PR83MB0425.EURPRD83.prod.outlook.com
Headers
Series Add DLL import/export implementation to AArch64 |

Message

Evgeny Karpov April 18, 2024, 9:35 p.m. UTC
  Hello,

This is the second patch series, following the first patch series which
introduced the aarch64-w64-mingw32 target.
https://gcc.gnu.org/pipermail/gcc-patches/2024-February/thread.html#646203
https://gcc.gnu.org/pipermail/gcc-patches/2024-March/thread.html#647128
https://gcc.gnu.org/pipermail/gcc-patches/2024-April/thread.html#649261

The patch series aims at the goal:
Extend the aarch64-w64-mingw32 C implementation to
cross-compile OpenSSL, OpenBLAS, FFmpeg, and libjpeg-turbo. All
packages successfully pass tests.

The changes in this patch series are focused on reusing functionality
for DLL import/export from ix86 in aarch64. The ix86 implementation
for expanding a SYMBOL into its corresponding dllimport symbol has
been moved to the mingw folder. Functions related to
dllimport/dllexport functionality have been renamed for reuse in the
AArch64 target.

This patch series is implemented on top of the first patch series which
has not been merged yet. It is currently awaiting the opening of GCC Stage1.
https://gcc.gnu.org/pipermail/gcc-patches/2024-April/thread.html#649261

Patchwork cannot verify this patch series. However, a link to Linaro CI will
be provided once the testing is complete.
A minimal regression test for building main targets can be found here:
https://github.com/Windows-on-ARM-Experiments/mingw-woarm64-build/actions/runs/8739609732

Regression test for all languages on x86_86-w64-mingw32 is in progress and 
will be also provided.

Known issues:
In order to compile FFmpeg, the optimization level should be reduced
from -O3 to -O2. The fix for this issue is planned to be delivered
in the third patch series.

Thank you for your review!

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>

Regards,
Evgeny


Evgeny Karpov (6):
  Move mingw_* declarations to the mingw folder
  Extract ix86 dllimport implementation to mingw
  Rename functions for reuse in AArch64
  aarch64: Add selectany attribute handling
  Adjust DLL import/export implementation for AArch64
  aarch64: Add DLL import/export to AArch64 target

 gcc/config.gcc                      |   8 +-
 gcc/config/aarch64/aarch64-protos.h |   7 +-
 gcc/config/aarch64/aarch64.cc       |  42 ++++-
 gcc/config/aarch64/cygming.h        |  26 +++-
 gcc/config/i386/cygming.h           |   8 +-
 gcc/config/i386/i386-expand.cc      |   2 +-
 gcc/config/i386/i386-expand.h       |   2 +-
 gcc/config/i386/i386-protos.h       |  13 +-
 gcc/config/i386/i386.cc             | 211 +++----------------------
 gcc/config/mingw/mingw32.h          |   2 +-
 gcc/config/mingw/t-cygming          |   6 +
 gcc/config/mingw/winnt-dll.cc       | 233 ++++++++++++++++++++++++++++
 gcc/config/mingw/winnt-dll.h        |  26 ++++
 gcc/config/mingw/winnt.cc           |   8 +-
 gcc/config/mingw/winnt.h            |  34 ++++
 15 files changed, 402 insertions(+), 226 deletions(-)
 create mode 100644 gcc/config/mingw/winnt-dll.cc
 create mode 100644 gcc/config/mingw/winnt-dll.h
 create mode 100644 gcc/config/mingw/winnt.h