public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Sandiford <richard.sandiford@arm.com>
To: Evgeny Karpov <Evgeny.Karpov@microsoft.com>
Cc: "gcc-patches\@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	 "Richard Earnshaw \(lists\)" <Richard.Earnshaw@arm.com>,
	 "Andrew Pinski \(QUIC\)" <quic_apinski@quicinc.com>,
	 Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org>,
	 Radek Barton <radek.barton@microsoft.com>
Subject: Re: [PATCH v2 08/13] aarch64: Add Cygwin and MinGW environments for AArch64
Date: Wed, 10 Apr 2024 19:34:53 +0100	[thread overview]
Message-ID: <mptwmp5qd6a.fsf@arm.com> (raw)
In-Reply-To: <VI1PR83MB0431720FF1362C06760938D0F8232@VI1PR83MB0431.EURPRD83.prod.outlook.com> (Evgeny Karpov's message of "Mon, 4 Mar 2024 17:44:21 +0000")

Evgeny Karpov <Evgeny.Karpov@microsoft.com> writes:
> From: Zac Walker <zacwalker@microsoft.com>
> 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
> +<http://www.gnu.org/licenses/>.  */
> +
> +#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)

How about:

#define print_reg(rtx, code, file) (gcc_unreachable ())

so that attempts to use this are a noisy runtime failure?

> +#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

Similarly here, how about:

#define SSE_REGNO_P(N) (gcc_unreachable (), 0)
#define GENERAL_REGNO_P(N) (gcc_unreachable (), 0)
#define SEH_MAX_FRAME_SIZE (gcc_unreachable (), 0)

Thanks,
Richard

  parent reply	other threads:[~2024-04-10 18:34 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-04 17:24 [PATCH v2 00/13] Add aarch64-w64-mingw32 target Evgeny Karpov
2024-03-04 17:30 ` [PATCH v2 01/13] Introduce " Evgeny Karpov
2024-03-04 17:33 ` [PATCH v2 02/13] aarch64: The aarch64-w64-mingw32 target implements Evgeny Karpov
2024-04-10 18:17   ` Richard Sandiford
2024-03-04 17:36 ` [PATCH v2 03/13] aarch64: Mark x18 register as a fixed register for MS ABI Evgeny Karpov
2024-04-10 18:25   ` Richard Sandiford
2024-03-04 17:39 ` [PATCH v2 04/13] aarch64: Add aarch64-w64-mingw32 COFF Evgeny Karpov
2024-04-10 18:31   ` Richard Sandiford
2024-03-04 17:39 ` [PATCH v2 05/13] Reuse MinGW from i386 for AArch64 Evgeny Karpov
2024-03-04 17:41 ` [PATCH v2 06/13] Rename section and encoding functions from i386 which will be used in aarch64 Evgeny Karpov
2024-03-04 17:43 ` [PATCH v2 07/13] Exclude i386 functionality from aarch64 build Evgeny Karpov
2024-03-04 17:44 ` [PATCH v2 08/13] aarch64: Add Cygwin and MinGW environments for AArch64 Evgeny Karpov
2024-03-18 13:26   ` Christophe Lyon
2024-03-18 21:35   ` Evgeny Karpov
2024-03-19 13:40     ` Christophe Lyon
2024-03-20 21:53       ` rep.dot.nop
2024-04-10 18:34   ` Richard Sandiford [this message]
2024-03-04 17:45 ` [PATCH v2 09/13] aarch64: Add SEH to machine_function Evgeny Karpov
2024-03-04 17:46 ` [PATCH v2 10/13] Rename "x86 Windows Options" to "Cygwin and MinGW Options" Evgeny Karpov
2024-04-10 18:35   ` Richard Sandiford
2024-03-04 17:49 ` [PATCH v2 11/13] aarch64: Build and add objects for Cygwin and MinGW for AArch64 Evgeny Karpov
2024-03-04 17:50 ` [PATCH v2 12/13] aarch64: Add aarch64-w64-mingw32 target to libatomic Evgeny Karpov
2024-03-04 17:51 ` [PATCH v2 13/13] Add aarch64-w64-mingw32 target to libgcc Evgeny Karpov
2024-03-04 17:55 ` [PATCH v2 00/13] Add aarch64-w64-mingw32 target Evgeny Karpov
2024-03-04 19:25 ` Evgeny Karpov
2024-03-07 20:47 ` Evgeny Karpov
2024-03-18 13:33   ` Christophe Lyon
2024-03-18 22:10   ` Evgeny Karpov
2024-03-18 22:58     ` Fangrui Song
2024-03-18 23:22       ` Andrew Pinski
2024-03-19  7:50       ` Martin Storsjö
2024-03-21 10:28   ` [PING][PATCH " Evgeny Karpov
2024-03-18 21:05 ` [PATCH " Radek Barton
2024-03-20 11:50   ` Radek Barton
2024-03-20 19:37     ` NightStrike
2024-04-10 18:40 ` Richard Sandiford
2024-04-11 14:14   ` Evgeny Karpov
2024-04-11 14:34     ` Richard Sandiford

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=mptwmp5qd6a.fsf@arm.com \
    --to=richard.sandiford@arm.com \
    --cc=Evgeny.Karpov@microsoft.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=maxim.kuvyrkov@linaro.org \
    --cc=quic_apinski@quicinc.com \
    --cc=radek.barton@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).