public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: iain@sandoe.co.uk
Cc: hubicka@ucw.cz, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] lto, Darwin: Fix offload section names.
Date: Wed, 17 Jan 2024 07:52:17 +0100	[thread overview]
Message-ID: <CAFiYyc2d+1URy12H3VmLWbEH6yLmSc3ZjeZ2vuZ6_xwGLfAZHA@mail.gmail.com> (raw)
In-Reply-To: <20240116150016.3471-1-iain@sandoe.co.uk>

On Tue, Jan 16, 2024 at 4:00 PM Iain Sandoe <iains.gcc@gmail.com> wrote:
>
> Tested on x86_64 Darwin, x86_64 Linux.
> OK for trunk?  When?

OK now.

> thanks
> Iain
>
> --- 8< ---
>
> Currently, these section names have wrong syntax for Mach-O.
> Although they were added some time ago; recently added tests are
> now emitting them leading to new fails on Darwin.
>
> This adds a Mach-O variant for each.
>
> gcc/ChangeLog:
>
>         * lto-section-names.h (OFFLOAD_SECTION_NAME_PREFIX,
>         OFFLOAD_VAR_TABLE_SECTION_NAME, OFFLOAD_FUNC_TABLE_SECTION_NAME,
>         OFFLOAD_IND_FUNC_TABLE_SECTION_NAME): Provide Mach-O syntax
>         versions when the object format is Mach-O.
>
> Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
> ---
>  gcc/lto-section-names.h | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/gcc/lto-section-names.h b/gcc/lto-section-names.h
> index a743deb4efb..1cdadf36ec0 100644
> --- a/gcc/lto-section-names.h
> +++ b/gcc/lto-section-names.h
> @@ -25,7 +25,11 @@ along with GCC; see the file COPYING3.  If not see
>     name for the functions and static_initializers.  For other types of
>     sections a '.' and the section type are appended.  */
>  #define LTO_SECTION_NAME_PREFIX ".gnu.lto_"
> +#if OBJECT_FORMAT_MACHO
> +#define OFFLOAD_SECTION_NAME_PREFIX "__GNU_OFFLD_LTO,"
> +#else
>  #define OFFLOAD_SECTION_NAME_PREFIX ".gnu.offload_lto_"
> +#endif
>
>  /* Can be either OFFLOAD_SECTION_NAME_PREFIX when we stream IR for offload
>     compiler, or LTO_SECTION_NAME_PREFIX for LTO case.  */
> @@ -35,8 +39,14 @@ extern const char *section_name_prefix;
>
>  #define LTO_SEGMENT_NAME "__GNU_LTO"
>
> +#if OBJECT_FORMAT_MACHO
> +#define OFFLOAD_VAR_TABLE_SECTION_NAME "__GNU_OFFLOAD,__vars"
> +#define OFFLOAD_FUNC_TABLE_SECTION_NAME "__GNU_OFFLOAD,__funcs"
> +#define OFFLOAD_IND_FUNC_TABLE_SECTION_NAME "__GNU_OFFLOAD,__ind_fns"
> +#else
>  #define OFFLOAD_VAR_TABLE_SECTION_NAME ".gnu.offload_vars"
>  #define OFFLOAD_FUNC_TABLE_SECTION_NAME ".gnu.offload_funcs"
>  #define OFFLOAD_IND_FUNC_TABLE_SECTION_NAME ".gnu.offload_ind_funcs"
> +#endif
>
>  #endif /* GCC_LTO_SECTION_NAMES_H */
> --
> 2.39.2 (Apple Git-143)
>

  reply	other threads:[~2024-01-17  6:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-16 15:00 Iain Sandoe
2024-01-17  6:52 ` Richard Biener [this message]
2024-02-29 14:37 ` Thomas Schwinge
2024-02-29 15:55   ` Iain Sandoe
2024-02-29 16:52   ` Tobias Burnus

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=CAFiYyc2d+1URy12H3VmLWbEH6yLmSc3ZjeZ2vuZ6_xwGLfAZHA@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    --cc=iain@sandoe.co.uk \
    /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).