unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob 5eaba0e259a3434d584b6380bcdda1f9f3c0610a 5977 bytes (raw)
name: gnu/packages/patches/gcc-4-reproducibility-wrapper.patch 	 # note: path name is non-authoritative(*)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
 
From 8646998bf1ced61c4fe212eae68a3fb43772d2b9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=A1bor=20Boskovits?= <boskovits@gmail.com>
Date: Wed, 22 Nov 2017 09:18:47 +0100
Subject: [PATCH] Prepare gcc for wrapper.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Squashed commit of the following:

commit b1d80031fed7f094789fd83b02d089376bb4374f
Author: Gábor Boskovits <boskovits@gmail.com>
Date:   Wed Nov 22 09:16:57 2017 +0100

    Prepare gcc/prefix.c for wrapper, eliminate remaining PREFIX references.

commit e3749ab19f7a660f9f47abd1e0959c3773df937f
Merge: 685201b4d 4d2c62dc0
Author: Gábor Boskovits <boskovits@gmail.com>
Date:   Tue Nov 21 18:21:13 2017 +0100

    Merge branch 'tmp_squash'

commit 4d2c62dc015407a14175a58d33b5c3a27e0a0755
Author: Gábor Boskovits <boskovits@gmail.com>
Date:   Tue Nov 21 18:19:47 2017 +0100

    Prepare gcc/prefix.c for wrapper.

commit 17878706e414e6cccc9400cd324bed5c97a70c64
Author: Gábor Boskovits <boskovits@gmail.com>
Date:   Tue Nov 21 09:02:36 2017 +0100

    Add wrapper support.

    Squashed commit of the following:

    commit 685201b4db65a6a32e1b0bb9964d405af99e4f48
    Author: Gábor Boskovits <boskovits@gmail.com>
    Date:   Tue Nov 21 02:58:37 2017 +0100

        Prepare gcc-ar.c for the wrapper.

    commit 2dd79c5b79182c2aa500de7a469b21b48dc1995f
    Author: Gábor Boskovits <boskovits@gmail.com>
    Date:   Tue Nov 21 02:45:20 2017 +0100

        Prepare source code for the wrapper.

commit 685201b4db65a6a32e1b0bb9964d405af99e4f48
Author: Gábor Boskovits <boskovits@gmail.com>
Date:   Tue Nov 21 02:58:37 2017 +0100

    Prepare gcc-ar.c for the wrapper.

commit 2dd79c5b79182c2aa500de7a469b21b48dc1995f
Author: Gábor Boskovits <boskovits@gmail.com>
Date:   Tue Nov 21 02:45:20 2017 +0100

    Prepare source code for the wrapper.
---
 gcc/gcc-ar.c |  7 +++++--
 gcc/gcc.c    | 10 +++++++---
 gcc/prefix.c | 23 +++++++++++++++++------
 3 files changed, 29 insertions(+), 11 deletions(-)

diff --git a/gcc/gcc-ar.c b/gcc/gcc-ar.c
index 5f78378de..4b0352a72 100644
--- a/gcc/gcc-ar.c
+++ b/gcc/gcc-ar.c
@@ -26,8 +26,8 @@ along with GCC; see the file COPYING3.  If not see
 #error "Please set personality"
 #endif
 
-static const char standard_libexec_prefix[] = STANDARD_LIBEXEC_PREFIX;
-static const char standard_bin_prefix[] = STANDARD_BINDIR_PREFIX;
+static const char *standard_libexec_prefix;
+static const char *standard_bin_prefix;
 static const char *const target_machine = TARGET_MACHINE;
 
 static const char dir_separator[] = { DIR_SEPARATOR, 0 };
@@ -44,6 +44,9 @@ main(int ac, char **av)
   bool is_ar = !strcmp (PERSONALITY, "ar");
   int exit_code = FATAL_EXIT_CODE;
 
+  standard_libexec_prefix=getenv("STANDARD_LIBEXEC_PREFIX");
+  standard_bin_prefix=getenv("STANDARD_BINDIR_PREFIX");
+
   exe_name = PERSONALITY;
 #ifdef CROSS_DIRECTORY_STRUCTURE
   exe_name = concat (target_machine, "-", exe_name, NULL);
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 939dcc873..f75f88eec 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -1125,9 +1125,9 @@ static const char *gcc_libexec_prefix;
    gcc_exec_prefix is set because, in that case, we know where the
    compiler has been installed, and use paths relative to that
    location instead.  */
-static const char *const standard_exec_prefix = STANDARD_EXEC_PREFIX;
-static const char *const standard_libexec_prefix = STANDARD_LIBEXEC_PREFIX;
-static const char *const standard_bindir_prefix = STANDARD_BINDIR_PREFIX;
+static const char *standard_exec_prefix;
+static const char *standard_libexec_prefix;
+static const char *standard_bindir_prefix;
 static const char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
 
 /* For native compilers, these are well-known paths containing
@@ -6154,6 +6154,10 @@ main (int argc, char **argv)
      on ?: in file-scope variable initializations.  */
   asm_debug = ASM_DEBUG_SPEC;
 
+  standard_exec_prefix=getenv("STANDARD_EXEC_PREFIX");
+  standard_libexec_prefix=getenv("STANDARD_LIBEXEC_PREFIX");
+  standard_bindir_prefix=getenv("STANDARD_BINDIR_PREFIX");
+
   p = argv[0] + strlen (argv[0]);
   while (p != argv[0] && !IS_DIR_SEPARATOR (p[-1]))
     --p;
diff --git a/gcc/prefix.c b/gcc/prefix.c
index c7003f8c6..01408e2e5 100644
--- a/gcc/prefix.c
+++ b/gcc/prefix.c
@@ -73,7 +73,7 @@ License along with GCC; see the file COPYING3.  If not see
 #include "prefix.h"
 #include "common/common-target.h"
 
-static const char *std_prefix = PREFIX;
+static const char *std_prefix;
 
 static const char *get_key_value (char *);
 static char *translate_name (char *);
@@ -85,6 +85,17 @@ static char *lookup_key (char *);
 static HKEY reg_key = (HKEY) INVALID_HANDLE_VALUE;
 #endif
 
+/* Return std_prefix, factory method. */
+
+static const char *
+get_std_prefix (void)
+{
+  if (std_prefix == 0)
+    std_prefix = getenv ("PREFIX");
+
+  return std_prefix;
+}
+
 /* Given KEY, as above, return its value.  */
 
 static const char *
@@ -101,7 +112,7 @@ get_key_value (char *key)
     prefix = getenv (temp = concat (key, "_ROOT", NULL));
 
   if (prefix == 0)
-    prefix = std_prefix;
+    prefix = get_std_prefix();
 
   free (temp);
 
@@ -207,13 +218,13 @@ translate_name (char *name)
 	{
 	  prefix = get_key_value (key);
 	  if (prefix == 0)
-	    prefix = std_prefix;
+	    prefix = get_std_prefix();
 	}
       else
 	prefix = getenv (key);
 
       if (prefix == 0)
-	prefix = PREFIX;
+	prefix = getenv("PREFIX");
 
       /* We used to strip trailing DIR_SEPARATORs here, but that can
 	 sometimes yield a result with no separator when one was coded
@@ -248,9 +259,9 @@ char *
 update_path (const char *path, const char *key)
 {
   char *result, *p;
-  const int len = strlen (std_prefix);
+  const int len = strlen (get_std_prefix());
 
-  if (! filename_ncmp (path, std_prefix, len)
+  if (! filename_ncmp (path, get_std_prefix(), len)
       && (IS_DIR_SEPARATOR(path[len])
           || path[len] == '\0')
       && key != 0)
-- 
2.15.0


debug log:

solving 5eaba0e25 ...
found 5eaba0e25 in https://yhetil.org/guix-devel/CAE4v=pgNCiu9vBkd2BF3nHxe2Fu-g3Db-zu3Tsu1c7HJrrEdwg@mail.gmail.com/

applying [1/1] https://yhetil.org/guix-devel/CAE4v=pgNCiu9vBkd2BF3nHxe2Fu-g3Db-zu3Tsu1c7HJrrEdwg@mail.gmail.com/
diff --git a/gnu/packages/patches/gcc-4-reproducibility-wrapper.patch b/gnu/packages/patches/gcc-4-reproducibility-wrapper.patch
new file mode 100644
index 000000000..5eaba0e25

1:80: trailing whitespace.
 
1:86: trailing whitespace.
 
1:91: trailing whitespace.
 
1:113: trailing whitespace.
 
1:118: trailing whitespace.
 
Checking patch gnu/packages/patches/gcc-4-reproducibility-wrapper.patch...
Applied patch gnu/packages/patches/gcc-4-reproducibility-wrapper.patch cleanly.
warning: squelched 18 whitespace errors
warning: 23 lines add whitespace errors.

index at:
100644 5eaba0e259a3434d584b6380bcdda1f9f3c0610a	gnu/packages/patches/gcc-4-reproducibility-wrapper.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

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

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).