From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#30395: bug#30820: Chunked store references in compiled code break grafting (again) Date: Fri, 16 Mar 2018 09:54:31 +0100 Message-ID: <87in9wxuwo.fsf@gnu.org> References: <87o9jq7j7r.fsf@gnu.org> <87efkm7eov.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54352) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ewl8k-0001Wm-Q2 for bug-guix@gnu.org; Fri, 16 Mar 2018 04:55:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ewl8f-0005iy-UM for bug-guix@gnu.org; Fri, 16 Mar 2018 04:55:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:56049) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ewl8f-0005is-QO for bug-guix@gnu.org; Fri, 16 Mar 2018 04:55:01 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87efkm7eov.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Wed, 14 Mar 2018 18:24:48 +0100") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: 30820@debbugs.gnu.org Cc: 30395@debbugs.gnu.org ludo@gnu.org (Ludovic Court=C3=A8s) skribis: > void foo (char *x, char *y) > { > /* MEMCPY (x, str, sizeof str); */ > MEMCPY (y, "this is a literal /gnu/store string", 35); > } This was not a correct example because =E2=80=9C/gnu/store=E2=80=9D must be= followed by at least 34 chars for the patch to work. And indeed, it does work in this case: --8<---------------cut here---------------start------------->8--- $ cat strmov.c #define _GNU_SOURCE #include static const char str[] =3D "MEMpCPY /gnu/store/THIS IS A LONG STRING, A VE= RY, VERY, VERY LOOOOONG STRING"; extern char *p, *q; #ifndef MEMCPY # define MEMCPY memcpy #endif void foo (char *x, char *y) { /* MEMCPY (x, str, sizeof str); */ MEMCPY (y, "this is a literal /gnu/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee= ee string", 35); } $ guix environment --ad-hoc gcc-toolchain@5 -C -- gcc -O2 -c strmov.c $ objdump -S strmov.o |grep movabs --8<---------------cut here---------------end--------------->8--- So the real issue is this: > The second issue is that the patch only ever worked with literal > strings. It does not =E2=80=9Csee=E2=80=9D strings in constant arrays li= ke the =E2=80=98str=E2=80=99 > array in the example above. Ludo=E2=80=99.