public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Christophe Lyon <christophe.lyon.oss@gmail.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: Iain Sandoe <idsandoe@googlemail.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>,
	Richard Biener <rguenther@suse.de>
Subject: Re: [PATCH] pch: Add support for relocation of the PCH data [PR71934]
Date: Thu, 9 Dec 2021 17:42:10 +0100	[thread overview]
Message-ID: <CAKhMtS+SkyX5Wh7TmhbY-GagLiTzENg1jfXg_YpMFMu-a=oH9w@mail.gmail.com> (raw)
In-Reply-To: <20211209145940.GI2646553@tucnak>

Hi Jakub,


On Thu, Dec 9, 2021 at 4:00 PM Jakub Jelinek via Gcc-patches <
gcc-patches@gcc.gnu.org> wrote:

> On Wed, Dec 08, 2021 at 08:00:03AM +0000, Iain Sandoe wrote:
> > > On 7 Dec 2021, at 14:50, Jakub Jelinek via Gcc-patches <
> gcc-patches@gcc.gnu.org> wrote:
> > The attached patch should be applied before (or merged with) the change
> for
> > relocation when it is applied - since the operation of the PCH hooks
> needs some
> > adjustment on Darwin.
>
> Oops, didn't do this change and therefore likely broke Darwin and
> apparently
> HP-UX.
>

This also broke aarch64 I think:
In file included from
/tmp/6140018_6.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/config/aarch64/aarch64-sve-builtins.cc:3920:0:
./gt-aarch64-sve-builtins.h: In function 'void
gt_pch_p_19registered_function(void*, void*, gt_pointer_operator, void*)':
./gt-aarch64-sve-builtins.h:86:44: error: no matching function for call to
'gt_pch_nx(aarch64_sve::function_instance*, void (*&)(void*, void*, void*),
void*&)'
     gt_pch_nx (&((*x).instance), op, cookie);

Can you check?

Thanks

Christophe



> Went through other targets and they don't do this reading in there and so
> aren't problematic.  Of course, as I said before, to enable relocation
> support one has to do minor changes to the hook not to fail on those but
> update the reference parameter.
>
> I've committed following which should hopefully unbreak it (untested),
> please go ahead with your patch without the last hunk incrementally when
> you're ready.
>
> 2021-12-09  Jakub Jelinek  <jakub@redhat.com>
>
>         PR pch/71934
>         * config/host-darwin.c (darwin_gt_pch_use_address): When reading
>         manually the file into mapped area, update mapped_addr as
>         an automatic variable rather than addr which is a reference
> parameter.
>         * config/host-hpux.c (hpux_gt_pch_use_address): When reading
>         manually the file into mapped area, update addr as
>         an automatic variable rather than base which is a reference
> parameter.
>
> --- gcc/config/host-darwin.c.jj 2021-12-09 15:40:06.232022601 +0100
> +++ gcc/config/host-darwin.c    2021-12-09 15:48:51.397467287 +0100
> @@ -185,10 +185,10 @@ darwin_gt_pch_use_address (void *&addr,
>      {
>        ssize_t nbytes;
>
> -      nbytes = read (fd, addr, MIN (sz, (size_t) -1 >> 1));
> +      nbytes = read (fd, mapped_addr, MIN (sz, (size_t) -1 >> 1));
>        if (nbytes <= 0)
>         return -1;
> -      addr = (char *) addr + nbytes;
> +      mapped_addr = (char *) mapped_addr + nbytes;
>        sz -= nbytes;
>      }
>
> --- gcc/config/host-hpux.c.jj   2021-12-09 15:40:06.251022328 +0100
> +++ gcc/config/host-hpux.c      2021-12-09 15:49:25.464977378 +0100
> @@ -115,10 +115,10 @@ hpux_gt_pch_use_address (void *&base, si
>      {
>        ssize_t nbytes;
>
> -      nbytes = read (fd, base, MIN (size, SSIZE_MAX));
> +      nbytes = read (fd, addr, MIN (size, SSIZE_MAX));
>        if (nbytes <= 0)
>          return -1;
> -      base = (char *) base + nbytes;
> +      addr = (char *) addr + nbytes;
>        size -= nbytes;
>      }
>
>
>
>         Jakub
>
>

  parent reply	other threads:[~2021-12-09 16:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-07  9:55 Jakub Jelinek
2021-12-07 14:50 ` Jakub Jelinek
2021-12-08  8:00   ` Iain Sandoe
2021-12-08 23:10     ` Jeff Law
2021-12-09 14:59     ` Jakub Jelinek
2021-12-09 15:03       ` Iain Sandoe
2021-12-09 16:42       ` Christophe Lyon [this message]
2021-12-09 16:52         ` Jeff Law
2021-12-09 16:59         ` [committed] pch: Fix aarch64 build [PR71934] Jakub Jelinek
2021-12-10 12:56           ` [PATCH] pch: Small cleanup Jakub Jelinek
2021-12-10 21:20             ` Jeff Law
2021-12-08 23:09 ` [PATCH] pch: Add support for relocation of the PCH data [PR71934] Jeff Law
2021-12-10  1:20   ` Eric Gallager

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='CAKhMtS+SkyX5Wh7TmhbY-GagLiTzENg1jfXg_YpMFMu-a=oH9w@mail.gmail.com' \
    --to=christophe.lyon.oss@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=idsandoe@googlemail.com \
    --cc=jakub@redhat.com \
    --cc=rguenther@suse.de \
    /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).