all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Leo Famulari <leo@famulari.name>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 24703@debbugs.gnu.org
Subject: bug#24703: Store references in 8-byte chunks in compiled code
Date: Wed, 9 Nov 2016 18:16:52 -0500	[thread overview]
Message-ID: <20161109231652.GA12060@jasmine> (raw)
In-Reply-To: <87oa1o75ga.fsf@gnu.org>

On Wed, Nov 09, 2016 at 09:40:05PM +0100, Ludovic Courtès wrote:
> I read much more code than I wanted just to end up in gcc/builtins.c.
> In 8033772363b287ca529461e575ceb4a69d7af942 I added a patch for GCC 5.x
> and 6.x that disables the ‘movabs’ optimization for strcpy/memcpy when
> the source is a string constant that contains “/gnu/store” (I followed
> Mark’s advice to disable the optimization for any string that contains
> “/gnu/store”, rather than just for strings that start with
> “/gnu/store”.)
> 
> This can be tested by compiling a file like this one (comment or
> uncomment the lines that you want):
> 
> --8<---------------cut here---------------start------------->8---
> #include <string.h>
> void foo (char *x, char *y)
> {
>   /* memcpy(x, "this is a long string, a very long string", 42); */
>   /* strcpy(x, "STRCPY THIS IS A LONG STRING, A VERY LONG STRING"); */
>   strcpy(x, "STRCPY /gnu/store/THIS IS A LONG  STRING, A VERY LONG STRING");
>   /* __builtin_strcpy(x, "THIS IS A LONG STRING, A VERY LONG STRING"); */
>   /* strcpy(y, "/gnu/store/THIS IS A LONG STRING, A VERY LONG STRING"); */
>   /* memcpy(y, "MEMCPY THIS IS A LONG STRING, A VERY LONG STRING", 30); */
>   memcpy(y, "MEMCPY /gnu/store/THIS IS A LONG STRING, A VERY LONG STRING", 30);
>   /* __builtin_memcpy(y, "/gnu/store/THIS IS A LONG STRING, A VERY LONG STRING", 30); */
> }
> --8<---------------cut here---------------end--------------->8---
> 
> … and then running “objdump -S foo.o | grep movabs”, for instance.

Awesome. Thank you!

> Now we need a plan to actually fix the bug.
> 
> The long-term goal is to rebuild everything with a compiler that has
> this patch, in the next ‘core-updates’.  We might as well switch to GCC
> 5 as the default compiler.
> 
> In the meantime, the only approach I can think of is to (1) ungraft more
> frequently than we’ve done so far, and (2) when we ungraft a package,
> add gcc@5 as an input such that it gets rebuilt without the problem.
> 
> Thoughts?

Sounds good to me. I wonder, with our current build farm, how often can
we do the full rebuilds required by ungrafting? I don't yet have a sense
of how long it takes.

  reply	other threads:[~2016-11-09 23:17 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-16  3:49 bug#24703: fontconfig keeps obfuscated reference to itself, not grafted Mark H Weaver
2016-10-16  4:26 ` Mark H Weaver
2016-10-16  5:00   ` Mark H Weaver
2016-10-16  6:24     ` bug#24703: Store references in 8-byte chunks in compiled code Mark H Weaver
2016-10-16  9:03       ` Mark H Weaver
2016-10-16  9:25       ` Mark H Weaver
2016-10-16 10:15         ` Mark H Weaver
2016-10-16 19:04         ` Ludovic Courtès
2016-10-17  7:46           ` bug#24703: " Török Edwin
2016-10-17  9:42             ` Mark H Weaver
2016-10-17 12:09             ` Ludovic Courtès
2016-10-18  3:36               ` Mark H Weaver
2016-10-18  8:59                 ` Ludovic Courtès
2016-10-31  6:35                   ` Mark H Weaver
2016-10-31 11:37                     ` Ludovic Courtès
2016-10-24 19:40                 ` Leo Famulari
2016-10-24 20:18                   ` Ludovic Courtès
2016-11-04 23:15                     ` Ludovic Courtès
2016-11-05 18:36                       ` Leo Famulari
2016-11-06 20:58                         ` Ludovic Courtès
2016-11-09 20:40                       ` Ludovic Courtès
2016-11-09 23:16                         ` Leo Famulari [this message]
2016-11-10  8:01                           ` Ludovic Courtès
2017-04-02 22:19                             ` Ludovic Courtès
2016-11-11 10:39                         ` Ludovic Courtès
2016-10-19 21:25               ` Török Edwin
2016-10-20 12:25                 ` Ludovic Courtès
2016-10-16 14:42 ` bug#24703: fontconfig keeps obfuscated reference to itself, not grafted Ludovic Courtès
2016-10-16 15:06   ` Ludovic Courtès

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=20161109231652.GA12060@jasmine \
    --to=leo@famulari.name \
    --cc=24703@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.