public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 3/4] Use SOURCE_PREFIX_MAP envvar to transform __FILE__
  2016-11-02 14:24 [PATCH] Generate reproducible output independently of the build-path Ximin Luo
                   ` (2 preceding siblings ...)
  2016-11-02 14:24 ` [PATCH 1/4] Use SOURCE_PREFIX_MAP envvar as an implicit debug-prefix-map Ximin Luo
@ 2016-11-02 14:24 ` Ximin Luo
  2016-11-02 16:28 ` [PATCH] Generate reproducible output independently of the build-path Joseph Myers
  2016-11-03 20:01 ` Ximin Luo
  5 siblings, 0 replies; 12+ messages in thread
From: Ximin Luo @ 2016-11-02 14:24 UTC (permalink / raw)
  To: GCC Patches; +Cc: Ximin Luo

Honour the SOURCE_PREFIX_MAP environment variable when expanding the __FILE__
macro, in the same way that debug-prefix-map works for debugging symbol paths.

This patch follows similar lines to the earlier patch for SOURCE_DATE_EPOCH.
Specifically, we read the environment variable not in libcpp but via a hook
which has an implementation defined in gcc/c-family. However, to achieve this
is more complex than the earlier patch: we need to share the prefix_map data
structure and associated functions between libcpp and c-family. Therefore, we
need to move these to libiberty. (For comparison, the SOURCE_DATE_EPOCH patch
did not need this because time_t et. al. are in the standard C library.)

Acknowledgements
----------------

Dhole <dhole@openmailbox.org> who wrote the earlier patch for SOURCE_DATE_EPOCH
which saved me a lot of time on figuring out what to edit.

ChangeLogs
----------

include/ChangeLog:

2016-11-01  Ximin Luo  <infinity0@pwned.gg>

	* prefix-map.h: New file, mostly derived from /gcc/final.c.

libiberty/ChangeLog:

2016-11-01  Ximin Luo  <infinity0@pwned.gg>

	* prefix-map.c: New file, mostly derived from /gcc/final.c.
	* Makefile.in: Update for new files.

gcc/ChangeLog:

2016-11-01  Ximin Luo  <infinity0@pwned.gg>

	* final.c: Generalise and refactor code related to debug_prefix_map.
	Move some of it to /libiberty/prefix-map.c, /include/prefix-map.h
	and refactor the remaining code to use the moved-out things.
	* doc/invoke.texi (Environment Variables): Update SOURCE_PREFIX_MAP to
	describe how it affects __FILE__ expansion.

gcc/c-family/ChangeLog:

2016-11-01  Ximin Luo  <infinity0@pwned.gg>

	* c-common.c (cb_get_source_prefix_map): Define new call target.
	* c-common.h (cb_get_source_prefix_map): Declare call target.
	* c-lex.c (init_c_lex): Set the get_source_prefix_map callback.

libcpp/ChangeLog:

2016-11-01  Ximin Luo  <infinity0@pwned.gg>

	* include/cpplib.h (cpp_callbacks): Add get_source_prefix_map
	callback.
	* init.c (cpp_create_reader): Initialise source_prefix_map field.
	* internal.h (cpp_reader): Add new field source_prefix_map.
	* macro.c (_cpp_builtin_macro_text): Set the source_prefix_map field
	if unset and apply it to the __FILE__ macro.

gcc/testsuite/ChangeLog:

2016-11-01  Ximin Luo  <infinity0@pwned.gg>

	* gcc.dg/cpp/source_prefix_map-1.c: New test.
	* gcc.dg/cpp/source_prefix_map-2.c: New test.

Index: gcc-7-20161030/include/prefix-map.h
===================================================================
--- /dev/null
+++ gcc-7-20161030/include/prefix-map.h
@@ -0,0 +1,71 @@
+/* Declarations for manipulating filename prefixes.
+
+   Copyright (C) 2016 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#ifndef _PREFIX_MAP_H
+#define _PREFIX_MAP_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+/* Linked-list of mappings from old prefixes to new prefixes.  */
+
+struct prefix_map
+{
+  const char *old_prefix;
+  const char *new_prefix;
+  size_t old_len;
+  size_t new_len;
+  struct prefix_map *next;
+};
+
+/* Parse a single prefix-map.
+
+   The string `arg' is split at the final '=' character. The part before
+   it is used to set `map->old_prefix' and `map->old_len', and the part
+   after it is used to set `map->new_prefix' and `map->new_len'.
+
+   If `arg' does not contain a '=' then 0 is returned. Otherwise, a
+   non-zero value is returned.
+   */
+
+extern int parse_prefix_map (const char *arg, struct prefix_map *map);
+
+/* Perform mapping of filename prefixes.
+
+   Return the filename corresponding to `old_name'. The return value is
+   equal to `old_name' if no transformation occurred, else it is equal
+   to `new_name' where the new filename is stored.
+
+   On entry into this function, `new_name' must be able to hold at least
+   `(old_name - map->old_len + map->old_len + 1)' characters, where
+   `map' is the mapping that will be selected and performed.
+   */
+
+extern const char *apply_prefix_map (const char *old_name, char *new_name,
+				     struct prefix_map *map_head);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _PREFIX_MAP_H */
Index: gcc-7-20161030/libiberty/prefix-map.c
===================================================================
--- /dev/null
+++ gcc-7-20161030/libiberty/prefix-map.c
@@ -0,0 +1,88 @@
+/* Definitions for manipulating filename prefixes.
+
+   Copyright (C) 2016 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#include "filenames.h"
+#include "libiberty.h"
+#include "prefix-map.h"
+
+/* Parse a single prefix-map.
+
+   The string `arg' is split at the final '=' character. The part before
+   it is used to set `map->old_prefix' and `map->old_len', and the part
+   after it is used to set `map->new_prefix' and `map->new_len'.
+
+   If `arg' does not contain a '=' then 0 is returned. Otherwise, a
+   non-zero value is returned.
+   */
+int
+parse_prefix_map (const char *arg, struct prefix_map *map)
+{
+  const char *p;
+  p = strrchr (arg, '=');
+  if (!p)
+    {
+      return 0;
+    }
+  map->old_prefix = xstrndup (arg, p - arg);
+  map->old_len = p - arg;
+  p++;
+  map->new_prefix = xstrdup (p);
+  map->new_len = strlen (p);
+  return 1;
+}
+
+/* Perform mapping of filename prefixes.
+
+   Return the filename corresponding to `old_name'. The return value is
+   equal to `old_name' if no transformation occurred, else it is equal
+   to `new_name' where the new filename is stored.
+
+   On entry into this function, `new_name' must be able to hold at least
+   `(old_name - map->old_len + map->old_len + 1)' characters, where
+   `map' is the mapping that will be selected and performed.
+   */
+const char *
+apply_prefix_map (const char *old_name, char *new_name,
+		  struct prefix_map *map_head)
+{
+  struct prefix_map *map;
+  const char *name;
+
+  for (map = map_head; map; map = map->next)
+    if (filename_ncmp (old_name, map->old_prefix, map->old_len) == 0)
+      break;
+  if (!map)
+    return old_name;
+
+  name = old_name + map->old_len;
+  memcpy (new_name, map->new_prefix, map->new_len);
+  memcpy (new_name + map->new_len, name, strlen (name) + 1);
+  return new_name;
+}
Index: gcc-7-20161030/libiberty/Makefile.in
===================================================================
--- gcc-7-20161030.orig/libiberty/Makefile.in
+++ gcc-7-20161030/libiberty/Makefile.in
@@ -145,6 +145,7 @@ CFILES = alloca.c argv.c asprintf.c atex
 	 pex-common.c pex-djgpp.c pex-msdos.c pex-one.c			\
 	 pex-unix.c pex-win32.c						\
          physmem.c putenv.c						\
+	prefix-map.c \
 	random.c regex.c rename.c rindex.c				\
 	safe-ctype.c setenv.c setproctitle.c sha1.c sigsetmask.c        \
 	 simple-object.c simple-object-coff.c simple-object-elf.c	\
@@ -183,6 +184,7 @@ REQUIRED_OFILES =							\
 	./partition.$(objext) ./pexecute.$(objext) ./physmem.$(objext)	\
 	./pex-common.$(objext) ./pex-one.$(objext)			\
 	./@pexecute@.$(objext) ./vprintf-support.$(objext)		\
+	./prefix-map.$(objext) \
 	./safe-ctype.$(objext)						\
 	./simple-object.$(objext) ./simple-object-coff.$(objext)	\
 	./simple-object-elf.$(objext) ./simple-object-mach-o.$(objext)	\
@@ -756,7 +758,7 @@ $(CONFIGURED_OFILES): stamp-picdir stamp
 	$(COMPILE.c) $(srcdir)/fibheap.c $(OUTPUT_OPTION)
 
 ./filename_cmp.$(objext): $(srcdir)/filename_cmp.c config.h $(INCDIR)/ansidecl.h \
-	$(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
+	$(INCDIR)/filenames.h $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h \
 	$(INCDIR)/safe-ctype.h
 	if [ x"$(PICFLAG)" != x ]; then \
 	  $(COMPILE.c) $(PICFLAG) $(srcdir)/filename_cmp.c -o pic/$@; \
@@ -1103,7 +1105,8 @@ $(CONFIGURED_OFILES): stamp-picdir stamp
 	$(COMPILE.c) $(srcdir)/pex-one.c $(OUTPUT_OPTION)
 
 ./pex-unix.$(objext): $(srcdir)/pex-unix.c config.h $(INCDIR)/ansidecl.h \
-	$(INCDIR)/libiberty.h $(srcdir)/pex-common.h
+	$(INCDIR)/environ.h $(INCDIR)/libiberty.h \
+	$(srcdir)/pex-common.h
 	if [ x"$(PICFLAG)" != x ]; then \
 	  $(COMPILE.c) $(PICFLAG) $(srcdir)/pex-unix.c -o pic/$@; \
 	else true; fi
@@ -1142,6 +1145,15 @@ $(CONFIGURED_OFILES): stamp-picdir stamp
 	else true; fi
 	$(COMPILE.c) $(srcdir)/physmem.c $(OUTPUT_OPTION)
 
+./prefix-map.$(objext): $(srcdir)/prefix-map.c config.h $(INCDIR)/prefix-map.h
+	if [ x"$(PICFLAG)" != x ]; then \
+	  $(COMPILE.c) $(PICFLAG) $(srcdir)/prefix-map.c -o pic/$@; \
+	else true; fi
+	if [ x"$(NOASANFLAG)" != x ]; then \
+	  $(COMPILE.c) $(PICFLAG) $(NOASANFLAG) $(srcdir)/prefix-map.c -o noasan/$@; \
+	else true; fi
+	$(COMPILE.c) $(srcdir)/prefix-map.c $(OUTPUT_OPTION)
+
 ./putenv.$(objext): $(srcdir)/putenv.c config.h $(INCDIR)/ansidecl.h
 	if [ x"$(PICFLAG)" != x ]; then \
 	  $(COMPILE.c) $(PICFLAG) $(srcdir)/putenv.c -o pic/$@; \
@@ -1198,7 +1210,8 @@ $(CONFIGURED_OFILES): stamp-picdir stamp
 	else true; fi
 	$(COMPILE.c) $(srcdir)/safe-ctype.c $(OUTPUT_OPTION)
 
-./setenv.$(objext): $(srcdir)/setenv.c config.h $(INCDIR)/ansidecl.h
+./setenv.$(objext): $(srcdir)/setenv.c config.h $(INCDIR)/ansidecl.h \
+	$(INCDIR)/environ.h
 	if [ x"$(PICFLAG)" != x ]; then \
 	  $(COMPILE.c) $(PICFLAG) $(srcdir)/setenv.c -o pic/$@; \
 	else true; fi
@@ -1649,7 +1662,7 @@ $(CONFIGURED_OFILES): stamp-picdir stamp
 	$(COMPILE.c) $(srcdir)/xexit.c $(OUTPUT_OPTION)
 
 ./xmalloc.$(objext): $(srcdir)/xmalloc.c config.h $(INCDIR)/ansidecl.h \
-	$(INCDIR)/libiberty.h
+	$(INCDIR)/environ.h $(INCDIR)/libiberty.h
 	if [ x"$(PICFLAG)" != x ]; then \
 	  $(COMPILE.c) $(PICFLAG) $(srcdir)/xmalloc.c -o pic/$@; \
 	else true; fi
@@ -1707,3 +1720,4 @@ $(CONFIGURED_OFILES): stamp-picdir stamp
 	  $(COMPILE.c) $(PICFLAG) $(NOASANFLAG) $(srcdir)/xvasprintf.c -o noasan/$@; \
 	else true; fi
 	$(COMPILE.c) $(srcdir)/xvasprintf.c $(OUTPUT_OPTION)
+
Index: gcc-7-20161030/gcc/final.c
===================================================================
--- gcc-7-20161030.orig/gcc/final.c
+++ gcc-7-20161030/gcc/final.c
@@ -46,6 +46,7 @@ along with GCC; see the file COPYING3.
 #define INCLUDE_ALGORITHM /* reverse */
 #include "system.h"
 #include "coretypes.h"
+#include "prefix-map.h"
 #include "backend.h"
 #include "target.h"
 #include "rtl.h"
@@ -1502,22 +1503,11 @@ asm_str_count (const char *templ)
   return count;
 }
 \f
-/* ??? This is probably the wrong place for these.  */
-/* Structure recording the mapping from source file and directory
-   names at compile time to those to be embedded in debug
-   information.  */
-struct debug_prefix_map
-{
-  const char *old_prefix;
-  const char *new_prefix;
-  size_t old_len;
-  size_t new_len;
-  struct debug_prefix_map *next;
-};
 
-/* Linked list of such structures.  */
-static debug_prefix_map *debug_prefix_maps;
+/* Linked list of `struct prefix_map'.  */
+static prefix_map *debug_prefix_maps;
 
+static size_t max_prefix_replace = 0;
 
 /* Record a debug file prefix mapping.  ARG is the argument to
    -fdebug-prefix-map and must be of the form OLD=NEW.  */
@@ -1525,23 +1515,19 @@ static debug_prefix_map *debug_prefix_ma
 void
 add_debug_prefix_map (const char *arg)
 {
-  debug_prefix_map *map;
-  const char *p;
-
-  p = strrchr (arg, '=');
-  if (!p)
+  prefix_map *map = XNEW (prefix_map);
+  if (!parse_prefix_map (arg, map))
     {
       error ("invalid value %qs for debug-prefix-map", arg);
+      free (map);
       return;
     }
-  map = XNEW (debug_prefix_map);
-  map->old_prefix = xstrndup (arg, p - arg);
-  map->old_len = p - arg;
-  p++;
-  map->new_prefix = xstrdup (p);
-  map->new_len = strlen (p);
+
   map->next = debug_prefix_maps;
   debug_prefix_maps = map;
+
+  if (map->new_len > max_prefix_replace)
+    max_prefix_replace = map->new_len;
 }
 
 /* Perform user-specified mapping of debug filename prefixes.  Return
@@ -1550,22 +1536,13 @@ add_debug_prefix_map (const char *arg)
 const char *
 remap_debug_filename (const char *filename)
 {
-  debug_prefix_map *map;
-  char *s;
-  const char *name;
-  size_t name_len;
-
-  for (map = debug_prefix_maps; map; map = map->next)
-    if (filename_ncmp (filename, map->old_prefix, map->old_len) == 0)
-      break;
-  if (!map)
+  char *newname = (char *) alloca (strlen (filename) + max_prefix_replace + 1);
+  const char *name = apply_prefix_map (filename, newname, debug_prefix_maps);
+
+  if (name == filename)
     return filename;
-  name = filename + map->old_len;
-  name_len = strlen (name) + 1;
-  s = (char *) alloca (name_len + map->new_len);
-  memcpy (s, map->new_prefix, map->new_len);
-  memcpy (s + map->new_len, name, name_len);
-  return ggc_strdup (s);
+
+  return ggc_strdup (newname);
 }
 \f
 /* Return true if DWARF2 debug info can be emitted for DECL.  */
Index: gcc-7-20161030/gcc/doc/invoke.texi
===================================================================
--- gcc-7-20161030.orig/gcc/doc/invoke.texi
+++ gcc-7-20161030/gcc/doc/invoke.texi
@@ -26224,7 +26224,8 @@ compiler uses @code{mblen} and @code{mbt
 recognize and translate multibyte characters.
 
 @item SOURCE_PREFIX_MAP If this variable is set, it specifies a mapping
-that is used to transform filepaths that are output in debug symbols.
+that is used to transform filepaths that are output in debug symbols,
+as well as filepaths emitted during expansions of the __FILE__ macro.
 This helps the embedded paths become reproducible, without having the
 unreproducible value be visible in other input sources - such as GCC
 command-line flags or standardised build-time environment variables like
Index: gcc-7-20161030/gcc/c-family/c-common.c
===================================================================
--- gcc-7-20161030.orig/gcc/c-family/c-common.c
+++ gcc-7-20161030/gcc/c-family/c-common.c
@@ -21,6 +21,7 @@ along with GCC; see the file COPYING3.
 
 #include "config.h"
 #include "system.h"
+#include "prefix-map.h"
 #include "coretypes.h"
 #include "target.h"
 #include "function.h"
@@ -7928,6 +7929,31 @@ cb_get_source_date_epoch (cpp_reader *pf
   return (time_t) epoch;
 }
 
+/* Read SOURCE_PREFIX_MAP from environment to have deterministic relative
+   paths to replace embedded absolute paths to get reproducible results.
+   Returns NULL if SOURCE_PREFIX_MAP is not defined or badly formed.  */
+
+prefix_map *
+cb_get_source_prefix_map (cpp_reader *pfile ATTRIBUTE_UNUSED)
+{
+  const char *arg;
+  prefix_map *map;
+
+  arg = getenv ("SOURCE_PREFIX_MAP");
+  if (!arg)
+    return NULL;
+
+  map = XNEW (prefix_map);
+  if (parse_prefix_map (arg, map))
+    return map;
+
+  free (map);
+  error_at (input_location, "environment variable SOURCE_PREFIX_MAP must "
+	    "be of the form ${old}=${new}");
+
+  return NULL;
+}
+
 /* Callback for libcpp for offering spelling suggestions for misspelled
    directives.  GOAL is an unrecognized string; CANDIDATES is a
    NULL-terminated array of candidate strings.  Return the closest
Index: gcc-7-20161030/gcc/c-family/c-common.h
===================================================================
--- gcc-7-20161030.orig/gcc/c-family/c-common.h
+++ gcc-7-20161030/gcc/c-family/c-common.h
@@ -1075,6 +1075,11 @@ extern time_t cb_get_source_date_epoch (
    __TIME__ can store.  */
 #define MAX_SOURCE_DATE_EPOCH HOST_WIDE_INT_C (253402300799)
 
+/* Read SOURCE_PREFIX_MAP from environment to have deterministic relative
+   paths to replace embedded absolute paths to get reproducible results.
+   Returns NULL if SOURCE_PREFIX_MAP is not defined or badly formed.  */
+extern prefix_map *cb_get_source_prefix_map (cpp_reader *pfile);
+
 /* Callback for libcpp for offering spelling suggestions for misspelled
    directives.  */
 extern const char *cb_get_suggestion (cpp_reader *, const char *,
Index: gcc-7-20161030/gcc/c-family/c-lex.c
===================================================================
--- gcc-7-20161030.orig/gcc/c-family/c-lex.c
+++ gcc-7-20161030/gcc/c-family/c-lex.c
@@ -81,6 +81,7 @@ init_c_lex (void)
   cb->read_pch = c_common_read_pch;
   cb->has_attribute = c_common_has_attribute;
   cb->get_source_date_epoch = cb_get_source_date_epoch;
+  cb->get_source_prefix_map = cb_get_source_prefix_map;
   cb->get_suggestion = cb_get_suggestion;
 
   /* Set the debug callbacks if we can use them.  */
Index: gcc-7-20161030/libcpp/include/cpplib.h
===================================================================
--- gcc-7-20161030.orig/libcpp/include/cpplib.h
+++ gcc-7-20161030/libcpp/include/cpplib.h
@@ -603,6 +603,9 @@ struct cpp_callbacks
   /* Callback to parse SOURCE_DATE_EPOCH from environment.  */
   time_t (*get_source_date_epoch) (cpp_reader *);
 
+  /* Callback to parse SOURCE_PREFIX_MAP from environment.  */
+  struct prefix_map *(*get_source_prefix_map) (cpp_reader *);
+
   /* Callback for providing suggestions for misspelled directives.  */
   const char *(*get_suggestion) (cpp_reader *, const char *, const char *const *);
 };
Index: gcc-7-20161030/libcpp/init.c
===================================================================
--- gcc-7-20161030.orig/libcpp/init.c
+++ gcc-7-20161030/libcpp/init.c
@@ -261,6 +261,9 @@ cpp_create_reader (enum c_lang lang, cpp
   /* Initialize source_date_epoch to -2 (not yet set).  */
   pfile->source_date_epoch = (time_t) -2;
 
+  /* Initialize source_prefix_map to NULL (not yet set).  */
+  pfile->source_prefix_map = NULL;
+
   /* The expression parser stack.  */
   _cpp_expand_op_stack (pfile);
 
Index: gcc-7-20161030/libcpp/internal.h
===================================================================
--- gcc-7-20161030.orig/libcpp/internal.h
+++ gcc-7-20161030/libcpp/internal.h
@@ -507,6 +507,11 @@ struct cpp_reader
      set to -1 to disable it or to a non-negative value to enable it.  */
   time_t source_date_epoch;
 
+  /* Externally set prefix-map to transform absolute paths, useful for
+     reproducibility.  It should be initialized to NULL (not yet set or
+     disabled) or to a `struct prefix_map` value to enable it.  */
+  struct prefix_map *source_prefix_map;
+
   /* EOF token, and a token forcing paste avoidance.  */
   cpp_token avoid_paste;
   cpp_token eof;
Index: gcc-7-20161030/libcpp/macro.c
===================================================================
--- gcc-7-20161030.orig/libcpp/macro.c
+++ gcc-7-20161030/libcpp/macro.c
@@ -26,6 +26,7 @@ along with this program; see the file CO
 #include "system.h"
 #include "cpplib.h"
 #include "internal.h"
+#include "prefix-map.h"
 
 typedef struct macro_arg macro_arg;
 /* This structure represents the tokens of a macro argument.  These
@@ -290,8 +291,22 @@ _cpp_builtin_macro_text (cpp_reader *pfi
       {
 	unsigned int len;
 	const char *name;
+	char *newname;
 	uchar *buf;
+	prefix_map *map = pfile->source_prefix_map;
 	
+	/* Set a prefix-map for __FILE__ if SOURCE_PREFIX_MAP is defined.  */
+	if (map == NULL && pfile->cb.get_source_prefix_map != NULL)
+	  {
+	    map = pfile->cb.get_source_prefix_map (pfile);
+	    if (map == NULL)
+	      {
+		/* Set a dummy value to avoid doing the check again.  */
+		map = XNEW (prefix_map);
+		memset (map, 0, sizeof (prefix_map));
+	      }
+	  }
+
 	if (node->value.builtin == BT_FILE)
 	  name = linemap_get_expansion_filename (pfile->line_table,
 						 pfile->line_table->highest_line);
@@ -301,6 +316,17 @@ _cpp_builtin_macro_text (cpp_reader *pfi
 	    if (!name)
 	      abort ();
 	  }
+
+	/* Strip source_prefix_map from name, if it's a prefix.  */
+	if (map != NULL && map->old_prefix != NULL)
+	  {
+	    newname = (char *) alloca (strlen (name)
+				       - map->old_len
+				       + map->new_len
+				       + 1);
+	    name = apply_prefix_map (name, newname, map);
+	  }
+
 	len = strlen (name);
 	buf = _cpp_unaligned_alloc (pfile, len * 2 + 3);
 	result = buf;
Index: gcc-7-20161030/gcc/testsuite/gcc.dg/cpp/source_prefix_map-1.c
===================================================================
--- /dev/null
+++ gcc-7-20161030/gcc/testsuite/gcc.dg/cpp/source_prefix_map-1.c
@@ -0,0 +1,11 @@
+/* __FILE__ should strip SOURCE_PREFIX_MAP if the latter is a prefix. */
+/* { dg-do run } */
+/* { dg-set-compiler-env-var SOURCE_PREFIX_MAP "$srcdir=MACROTEST" } */
+
+int
+main ()
+{
+  if (__builtin_strcmp (__FILE__, "MACROTEST/gcc.dg/cpp/source_prefix_map-1.c") != 0)
+    __builtin_abort ();
+  return 0;
+}
Index: gcc-7-20161030/gcc/testsuite/gcc.dg/cpp/source_prefix_map-2.c
===================================================================
--- /dev/null
+++ gcc-7-20161030/gcc/testsuite/gcc.dg/cpp/source_prefix_map-2.c
@@ -0,0 +1,11 @@
+/* __FILE__ should not be relative if SOURCE_PREFIX_MAP is not set, and gcc is
+   asked to compile an absolute filename as is the case with this test. */
+/* { dg-do run } */
+
+int
+main ()
+{
+  if (__builtin_strcmp (__FILE__, "./gcc.dg/cpp/source_prefix_map-1.c") == 0)
+    __builtin_abort ();
+  return 0;
+}

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 4/4] Use SOURCE_DATE_EPOCH in place of __TIMESTAMP__ if the latter is newer.
  2016-11-02 14:24 [PATCH] Generate reproducible output independently of the build-path Ximin Luo
  2016-11-02 14:24 ` [PATCH 2/4] Split prefix-map values on the last '=' character, not the first Ximin Luo
@ 2016-11-02 14:24 ` Ximin Luo
  2016-11-02 14:24 ` [PATCH 1/4] Use SOURCE_PREFIX_MAP envvar as an implicit debug-prefix-map Ximin Luo
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Ximin Luo @ 2016-11-02 14:24 UTC (permalink / raw)
  To: GCC Patches; +Cc: Ximin Luo

This brings the behaviour in line with the __DATE__ and __TIME__ macros. Note
though the minor difference: __TIMESTAMP__ is defined as the file-modification
date and not the "current" date or time like the other two macros. Therefore,
we do a clamping behaviour (similar to tar --clamp-mtime).

Acknowledgements
----------------

Reiner Herrmann suggested the clamping behaviour.

ChangeLogs
----------

libcpp/ChangeLog:

2016-11-01  Ximin Luo  <infinity0@pwned.gg>

	* macro.c (_cpp_builtin_macro_text): Use SOURCE_DATE_EPOCH in place of
	__TIMESTAMP__ if the latter is newer than the former.

gcc/ChangeLog:

2016-11-01  Ximin Luo  <infinity0@pwned.gg>

	* doc/cppenv.texi (Environment Variables): Update SOURCE_DATE_EPOCH to
	describe the new effect on __TIMESTAMP__.

gcc/testsuite/ChangeLog:

2016-11-01  Ximin Luo  <infinity0@pwned.gg>

	* gcc.dg/cpp/source_date_epoch-4.c: New test.
	* gcc.dg/cpp/source_date_epoch-5.c: New test.

Index: gcc-7-20161030/libcpp/macro.c
===================================================================
--- gcc-7-20161030.orig/libcpp/macro.c
+++ gcc-7-20161030/libcpp/macro.c
@@ -264,7 +264,30 @@ _cpp_builtin_macro_text (cpp_reader *pfi
 		struct tm *tb = NULL;
 		struct stat *st = _cpp_get_file_stat (file);
 		if (st)
-		  tb = localtime (&st->st_mtime);
+		  {
+		    /* Set a reproducible timestamp for __DATE__ and __TIME__ macro
+		       if SOURCE_DATE_EPOCH is defined.  */
+		    if (pfile->source_date_epoch == (time_t) -2
+			&& pfile->cb.get_source_date_epoch != NULL)
+		      pfile->source_date_epoch = pfile->cb.get_source_date_epoch (pfile);
+
+		    if (pfile->source_date_epoch >= (time_t) 0)
+		      {
+			/* If SOURCE_DATE_EPOCH is set, we want reproducible
+			   timestamps so use gmtime not localtime.  */
+			if (st->st_mtime >= pfile->source_date_epoch)
+			  tb = gmtime (&pfile->source_date_epoch);
+			else
+			  /* Don't use SOURCE_DATE_EPOCH if the timestamp is
+			     older, since that means it was probably already
+			     set in a reproducible way (e.g. via source tarball
+			     extraction or some other method). */
+			  tb = gmtime (&st->st_mtime);
+		      }
+		    else
+		      tb = localtime (&st->st_mtime);
+		  }
+
 		if (tb)
 		  {
 		    char *str = asctime (tb);
Index: gcc-7-20161030/gcc/doc/cppenv.texi
===================================================================
--- gcc-7-20161030.orig/gcc/doc/cppenv.texi
+++ gcc-7-20161030/gcc/doc/cppenv.texi
@@ -83,8 +83,9 @@ main input file is omitted.
 @item SOURCE_DATE_EPOCH
 If this variable is set, its value specifies a UNIX timestamp to be
 used in replacement of the current date and time in the @code{__DATE__}
-and @code{__TIME__} macros, so that the embedded timestamps become
-reproducible.
+and @code{__TIME__} macros, and in replacement of the file modification
+date in the @code{__TIMESTAMP__} macro if the latter is newer than the
+former, so that the embedded timestamps become reproducible.
 
 The value of @env{SOURCE_DATE_EPOCH} must be a UNIX timestamp,
 defined as the number of seconds (excluding leap seconds) since
Index: gcc-7-20161030/gcc/testsuite/gcc.dg/cpp/source_date_epoch-4.c
===================================================================
--- /dev/null
+++ gcc-7-20161030/gcc/testsuite/gcc.dg/cpp/source_date_epoch-4.c
@@ -0,0 +1,13 @@
+/* __TIMESTAMP__ should use SOURCE_DATE_EPOCH if the latter is older. */
+/* { dg-do run } */
+/* { dg-set-compiler-env-var TZ "UTC" } */
+/* { dg-set-compiler-env-var LC_ALL "C" } */
+/* { dg-set-compiler-env-var SOURCE_DATE_EPOCH "0" } */
+
+int
+main ()
+{
+  if (__builtin_strcmp (__TIMESTAMP__, "Thu Jan  1 00:00:00 1970") != 0)
+    __builtin_abort ();
+  return 0;
+}
Index: gcc-7-20161030/gcc/testsuite/gcc.dg/cpp/source_date_epoch-5.c
===================================================================
--- /dev/null
+++ gcc-7-20161030/gcc/testsuite/gcc.dg/cpp/source_date_epoch-5.c
@@ -0,0 +1,13 @@
+/* __TIMESTAMP__ should not use SOURCE_DATE_EPOCH if the latter is newer. */
+/* { dg-do run } */
+/* { dg-set-compiler-env-var TZ "UTC" } */
+/* { dg-set-compiler-env-var LC_ALL "C" } */
+/* { dg-set-compiler-env-var SOURCE_DATE_EPOCH "253402300799" } */
+
+int
+main ()
+{
+  if (__builtin_strcmp (__TIMESTAMP__, "Fri Dec 31 23:59:59 UTC 9999") == 0)
+    __builtin_abort ();
+  return 0;
+}

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 2/4] Split prefix-map values on the last '=' character, not the first
  2016-11-02 14:24 [PATCH] Generate reproducible output independently of the build-path Ximin Luo
@ 2016-11-02 14:24 ` Ximin Luo
  2016-11-02 14:24 ` [PATCH 4/4] Use SOURCE_DATE_EPOCH in place of __TIMESTAMP__ if the latter is newer Ximin Luo
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Ximin Luo @ 2016-11-02 14:24 UTC (permalink / raw)
  To: GCC Patches; +Cc: Ximin Luo

We are planning to ask other tools to support SOURCE_PREFIX_MAP, in the same
way that we have already done this for SOURCE_DATE_EPOCH. So, this will last
for some time and have quite wide reach. Consequently, we believe it is better
to split on the final '=', since it is much less likely to result in problems.

For example, with the previous behaviour (splitting on the first '=') it would
not be possible to map paths like the following:

C:\Documents and Settings\Betrand Russell\Proofs of 1+1=2\Automated Proofs\Source Code\
/srv/net/distributed-hash-table/address/VaIWP8YIWDChR2O76yiufXBsbw5g2skB_kp9VP-qVLvydovdGw==/projects/gcc-6/

These are contrived examples, but hopefully you can agree that they're not *so*
unrealistic - future software or users might plausibly wish to run reproducible
build processes underneath paths similar to these.

On the other hand, I can think of much fewer cases where the new-prefix *must*
include a '=' character. I can't think of any software project that includes
it, and I'd imagine that any such (or future) projects that might exist would
already have standardised "ASCII-only" versions of its name.

ChangeLogs
----------

gcc/ChangeLog:

2016-11-01  Ximin Luo  <infinity0@pwned.gg>

	* final.c: (add_debug_prefix_map): Split on the last and not first '='.
	* doc/invoke.texi (Environment Variables): Update SOURCE_PREFIX_MAP to
	describe new parsing.

Index: gcc-7-20161030/gcc/final.c
===================================================================
--- gcc-7-20161030.orig/gcc/final.c
+++ gcc-7-20161030/gcc/final.c
@@ -1528,7 +1528,7 @@ add_debug_prefix_map (const char *arg)
   debug_prefix_map *map;
   const char *p;
 
-  p = strchr (arg, '=');
+  p = strrchr (arg, '=');
   if (!p)
     {
       error ("invalid value %qs for debug-prefix-map", arg);
Index: gcc-7-20161030/gcc/doc/invoke.texi
===================================================================
--- gcc-7-20161030.orig/gcc/doc/invoke.texi
+++ gcc-7-20161030/gcc/doc/invoke.texi
@@ -26233,8 +26233,8 @@ output by higher-level build processes.
 
 The form and behaviour is similar to @option{-fdebug-prefix-map}. That
 is, the value of @env{SOURCE_PREFIX_MAP} must be of the form
-@samp{@var{old}=@var{new}}. The split occurs on the first @code{=}
-character, so that @var{old} cannot itself contain a @code{=}.
+@samp{@var{old}=@var{new}}. The split occurs on the last @code{=}
+character, so that @var{new} cannot itself contain a @code{=}.
 
 Whenever an absolute source- or build-related filepath is to be emitted
 in a final end-result output, GCC will replace @var{old} with @var{new}

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/4] Use SOURCE_PREFIX_MAP envvar as an implicit debug-prefix-map
  2016-11-02 14:24 [PATCH] Generate reproducible output independently of the build-path Ximin Luo
  2016-11-02 14:24 ` [PATCH 2/4] Split prefix-map values on the last '=' character, not the first Ximin Luo
  2016-11-02 14:24 ` [PATCH 4/4] Use SOURCE_DATE_EPOCH in place of __TIMESTAMP__ if the latter is newer Ximin Luo
@ 2016-11-02 14:24 ` Ximin Luo
  2016-11-02 16:25   ` Joseph Myers
  2016-11-02 14:24 ` [PATCH 3/4] Use SOURCE_PREFIX_MAP envvar to transform __FILE__ Ximin Luo
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Ximin Luo @ 2016-11-02 14:24 UTC (permalink / raw)
  To: GCC Patches; +Cc: Ximin Luo

Define the SOURCE_PREFIX_MAP environment variable, and treat it as an implicit
CLI -fdebug-prefix-map option specified before any explicit such options.

Acknowledgements
----------------

Daniel Kahn Gillmor who wrote the patch for r231835, which saved me a lot of
time figuring out what to edit.

HW42 for discussion on the details of the proposal, and for suggesting that we
retain the ability to map the prefix to something other than ".".

ChangeLogs
----------

gcc/ChangeLog:

2016-11-01  Ximin Luo  <infinity0@pwned.gg>

	* opts-global.c (add_debug_prefix_map_from_envvar): Add the value of
	SOURCE_PREFIX_MAP as a debug_prefix_map if the former is set.
	(handle_common_deferred_options): Call add_debug_prefix_map_from_envvar
	before processing options.
	* final.c: (add_debug_prefix_map): Be less specific in the error message,
	since it can also be triggered by the SOURCE_PREFIX_MAP variable.
	* doc/invoke.texi (Environment Variables): Document form and behaviour of
	SOURCE_PREFIX_MAP.

gcc/testsuite/ChangeLog:

2016-11-01  Ximin Luo  <infinity0@pwned.gg>

	* gcc.dg/debug/dwarf2/source_prefix_map-1.c: New test.
	* gcc.dg/debug/dwarf2/source_prefix_map-2.c: New test.

Index: gcc-7-20161030/gcc/opts-global.c
===================================================================
--- gcc-7-20161030.orig/gcc/opts-global.c
+++ gcc-7-20161030/gcc/opts-global.c
@@ -310,6 +310,21 @@ decode_options (struct gcc_options *opts
   finish_options (opts, opts_set, loc);
 }
 
+/* Add a debug-prefix-map using the SOURCE_PREFIX_MAP environment variable if
+   it is set.  */
+
+static void
+add_debug_prefix_map_from_envvar ()
+{
+  char *prefix_map;
+
+  prefix_map = getenv ("SOURCE_PREFIX_MAP");
+  if (!prefix_map)
+    return;
+
+  add_debug_prefix_map (prefix_map);
+}
+
 /* Hold command-line options associated with stack limitation.  */
 const char *opt_fstack_limit_symbol_arg = NULL;
 int opt_fstack_limit_register_no = -1;
@@ -335,6 +350,8 @@ handle_common_deferred_options (void)
   if (flag_opt_info)
     opt_info_switch_p (NULL);
 
+  add_debug_prefix_map_from_envvar ();
+
   FOR_EACH_VEC_ELT (v, i, opt)
     {
       switch (opt->opt_index)
Index: gcc-7-20161030/gcc/final.c
===================================================================
--- gcc-7-20161030.orig/gcc/final.c
+++ gcc-7-20161030/gcc/final.c
@@ -1531,7 +1531,7 @@ add_debug_prefix_map (const char *arg)
   p = strchr (arg, '=');
   if (!p)
     {
-      error ("invalid argument %qs to -fdebug-prefix-map", arg);
+      error ("invalid value %qs for debug-prefix-map", arg);
       return;
     }
   map = XNEW (debug_prefix_map);
Index: gcc-7-20161030/gcc/doc/invoke.texi
===================================================================
--- gcc-7-20161030.orig/gcc/doc/invoke.texi
+++ gcc-7-20161030/gcc/doc/invoke.texi
@@ -26222,6 +26222,23 @@ Recognize EUCJP characters.
 If @env{LANG} is not defined, or if it has some other value, then the
 compiler uses @code{mblen} and @code{mbtowc} as defined by the default locale to
 recognize and translate multibyte characters.
+
+@item SOURCE_PREFIX_MAP If this variable is set, it specifies a mapping
+that is used to transform filepaths that are output in debug symbols.
+This helps the embedded paths become reproducible, without having the
+unreproducible value be visible in other input sources - such as GCC
+command-line flags or standardised build-time environment variables like
+@code{CFLAGS} - that are commonly legitimately-embedded in the build
+output by higher-level build processes.
+
+The form and behaviour is similar to @option{-fdebug-prefix-map}. That
+is, the value of @env{SOURCE_PREFIX_MAP} must be of the form
+@samp{@var{old}=@var{new}}. The split occurs on the first @code{=}
+character, so that @var{old} cannot itself contain a @code{=}.
+
+Whenever an absolute source- or build-related filepath is to be emitted
+in a final end-result output, GCC will replace @var{old} with @var{new}
+if that filepath starts with @var{old}.
 @end table
 
 @noindent
Index: gcc-7-20161030/gcc/testsuite/gcc.dg/debug/dwarf2/source_prefix_map-1.c
===================================================================
--- /dev/null
+++ gcc-7-20161030/gcc/testsuite/gcc.dg/debug/dwarf2/source_prefix_map-1.c
@@ -0,0 +1,9 @@
+/* DW_AT_comp_dir should be relative if SOURCE_PREFIX_MAP is a prefix of it. */
+/* { dg-do compile } */
+/* { dg-options "-gdwarf -dA" } */
+/* { dg-set-compiler-env-var SOURCE_PREFIX_MAP "[file dirname [pwd]]=DWARF2TEST" } */
+/* { dg-final { scan-assembler-dem "DW_AT_comp_dir: \"DWARF2TEST/gcc" } } */
+
+void func (void)
+{
+}
Index: gcc-7-20161030/gcc/testsuite/gcc.dg/debug/dwarf2/source_prefix_map-2.c
===================================================================
--- /dev/null
+++ gcc-7-20161030/gcc/testsuite/gcc.dg/debug/dwarf2/source_prefix_map-2.c
@@ -0,0 +1,8 @@
+/* DW_AT_comp_dir should be absolute if SOURCE_PREFIX_MAP is not set. */
+/* { dg-do compile } */
+/* { dg-options "-gdwarf -dA" } */
+/* { dg-final { scan-assembler "DW_AT_comp_dir: \"/" } } */
+
+void func (void)
+{
+}

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH] Generate reproducible output independently of the build-path
@ 2016-11-02 14:24 Ximin Luo
  2016-11-02 14:24 ` [PATCH 2/4] Split prefix-map values on the last '=' character, not the first Ximin Luo
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Ximin Luo @ 2016-11-02 14:24 UTC (permalink / raw)
  To: GCC Patches; +Cc: Ximin Luo

(Please keep me on CC, I am not subscribed)

Background
==========

We are on a long journey to make build processes be able to reproduce the build
outputs independently of which filesystem path the build is being executed from
- e.g. if the executing user doesn't have root access to be able to execute it
under a standard path such as /build. This currently is making about 2k-3k [1]
packages in Debian unreproducible when build-paths are varied across builds.

[1] https://tests.reproducible-builds.org/debian/issues/unstable/captures_build_path_issue.html

Previous attempts have involved using -fdebug-prefix-map to strip away the
prefix of an absolute path, leaving behind the part relative to the top-level
directory of the source code, which is reproducible. But this flag was itself
stored in DW_AT_producer, which makes the final output unreproducible. This was
pointed out in bug 68848 and fixed in r231835.

However, through more testing, we have found out that the fix just mentioned is
not enough to achieve reproducibility in practice. The main issue is that many
different packages like to store CFLAGS et. al. in arbitrary ways. So if we add
an explicit -fdebug-prefix-map flag to the system-level CFLAGS etc, this will
often propagate into the build result, making it again dependent on the
build-path, and not reproducible. For example:

Some packages embed compiler flags into their pkg-config files (or equivalent):
https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/diffoscope-results/curl.html
https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/diffoscope-results/perl.html
https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/diffoscope-results/qt4-x11.html
https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/diffoscope-results/fflas-ffpack.html
https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/diffoscope-results/sip4.html

Other packages embed compiler flags directly into the binary:
https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/diffoscope-results/singular.html
https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/diffoscope-results/mutt.html

etc etc.

We think it's not appropriate to patch all (3k+) of these packages to strip out
-fdebug-prefix-map flags. This would involve adding quite complex logic to
everyone's build scripts, and we have to adapt this logic every single time to
that particular package. Also, in general CFLAGS is *supposed* to affect the
compiler output, and saving it unconditionally is quite a reasonable thing for
packages to do. If we tried to patch all of these packages, we would be turning
"reproducible builds" in to a costly opt-in feature, rather than on-by-default
that everyone can easily benefit from.

So, we believe it is better to patch GCC centrally. Our proposed solution is 
similar to (a) the SOURCE_DATE_EPOCH environment variable which was previously 
accepted into GCC and was used to successfully make 400+ packages reproducible, 
and (b) the -fdebug-prefix-map mechanism that already exists in GCC and which 
nearly but not quite, achieves at-scale build-path-independent reproducibility.

Proposal
========

This patch series adds a new environment variable SOURCE_PREFIX_MAP. When this
is set, GCC will treat this as an implicit "-fdebug-prefix-map=$value"
command-line argument. This makes the final binary output reproducible, and
also hides the unreproducible value (the build path prefix) from CFLAGS et. al.
which everyone is (understandably) embedding as-is into their build output.

This environment variable also acts on the __FILE__ macro, mapping it in the
same way that debug-prefix-map works for debug symbols. We have seen that
__FILE__ is also a very large source of unreproducibility, and is represented
quite heavily in the 3k+ figure given above.

Finally, we tweak the __TIMESTAMP__ macro so it honours SOURCE_DATE_EPOCH, in a
similar way to how __DATE__ and __TIME__ do so already.

More details are given in the headers of the patch files themselves.

Testing
=======

I've tested these patches on a Debian testing/unstable x86_64-linux-gnu system.
So far I've only run the new tests that this patch adds, on a disable-bootstrap
build. I will do a full bootstrap and run the full testsuite over the next few
days, both with and without this patch, and report back.

Copyright disclaimer
====================

I dedicate these patches to the public domain by waiving all of my rights to
the work worldwide under copyright law, including all related and neighboring
rights, to the extent allowed by law.

See https://creativecommons.org/publicdomain/zero/1.0/legalcode for full text.

Please let me know if the above is insufficient and I will be happy to sign any
relevant forms.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/4] Use SOURCE_PREFIX_MAP envvar as an implicit debug-prefix-map
  2016-11-02 14:24 ` [PATCH 1/4] Use SOURCE_PREFIX_MAP envvar as an implicit debug-prefix-map Ximin Luo
@ 2016-11-02 16:25   ` Joseph Myers
  0 siblings, 0 replies; 12+ messages in thread
From: Joseph Myers @ 2016-11-02 16:25 UTC (permalink / raw)
  To: Ximin Luo; +Cc: GCC Patches

On Wed, 2 Nov 2016, Ximin Luo wrote:

> +@item SOURCE_PREFIX_MAP If this variable is set, it specifies a mapping

The text should start on a separate line from the @item.

> +that is used to transform filepaths that are output in debug symbols.
> +This helps the embedded paths become reproducible, without having the
> +unreproducible value be visible in other input sources - such as GCC

Use a TeX em dash, ---, instead of " - ".

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] Generate reproducible output independently of the build-path
  2016-11-02 14:24 [PATCH] Generate reproducible output independently of the build-path Ximin Luo
                   ` (3 preceding siblings ...)
  2016-11-02 14:24 ` [PATCH 3/4] Use SOURCE_PREFIX_MAP envvar to transform __FILE__ Ximin Luo
@ 2016-11-02 16:28 ` Joseph Myers
  2016-11-02 16:53   ` Ximin Luo
  2016-11-03 20:01 ` Ximin Luo
  5 siblings, 1 reply; 12+ messages in thread
From: Joseph Myers @ 2016-11-02 16:28 UTC (permalink / raw)
  To: Ximin Luo; +Cc: GCC Patches

On Wed, 2 Nov 2016, Ximin Luo wrote:

> This patch series adds a new environment variable SOURCE_PREFIX_MAP. When this
> is set, GCC will treat this as an implicit "-fdebug-prefix-map=$value"
> command-line argument. This makes the final binary output reproducible, and

Only one argument?  Sometimes you may want multiple -fdebug-prefix-map 
options (for both source and build directories, for example).  Perhaps the 
value should be split on spaces to provide multiple such mappings?

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] Generate reproducible output independently of the build-path
  2016-11-02 16:28 ` [PATCH] Generate reproducible output independently of the build-path Joseph Myers
@ 2016-11-02 16:53   ` Ximin Luo
  2016-11-02 17:56     ` Ximin Luo
  0 siblings, 1 reply; 12+ messages in thread
From: Ximin Luo @ 2016-11-02 16:53 UTC (permalink / raw)
  To: Joseph Myers; +Cc: GCC Patches

Joseph Myers:
> On Wed, 2 Nov 2016, Ximin Luo wrote:
> 
>> This patch series adds a new environment variable SOURCE_PREFIX_MAP. When this
>> is set, GCC will treat this as an implicit "-fdebug-prefix-map=$value"
>> command-line argument. This makes the final binary output reproducible, and
> 
> Only one argument?  Sometimes you may want multiple -fdebug-prefix-map 
> options (for both source and build directories, for example).  Perhaps the 
> value should be split on spaces to provide multiple such mappings?
> 

We wanted to keep this environment variable simple, and allowing this would make it more costly for other projects to adopt.

Whichever separator character we choose, we would have to either (a) disallow it within the oldprefix/newprefix strings like what PATH does or (b) think of an escaping scheme. Neither choice is great - with (a) since we want to map *arbitrary* paths the restriction is less acceptable here than in PATH, and with (b) it adds complexity to the spec, for uncommon use-cases.

In the case of an out-of-tree build, it is still possible with the current proposal. Instead of:

SOURCE_PREFIX_MAP="srcprefix=srcname:buildprefix=buildname"

One could arrange the tree like:

commonprefix/srcname
commonprefix/buildname

then set SOURCE_PREFIX_MAP="commonprefix=." or SOURCE_PREFIX_MAP="commonprefix/=".

X

-- 
GPG: ed25519/56034877E1F87C35
GPG: rsa4096/1318EFAC5FBBDBCE
https://github.com/infinity0/pubkeys.git

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] Generate reproducible output independently of the build-path
  2016-11-02 16:53   ` Ximin Luo
@ 2016-11-02 17:56     ` Ximin Luo
  0 siblings, 0 replies; 12+ messages in thread
From: Ximin Luo @ 2016-11-02 17:56 UTC (permalink / raw)
  To: Joseph Myers; +Cc: GCC Patches

Ximin Luo:
> Joseph Myers:
>> On Wed, 2 Nov 2016, Ximin Luo wrote:
>>
>>> This patch series adds a new environment variable SOURCE_PREFIX_MAP. When this
>>> is set, GCC will treat this as an implicit "-fdebug-prefix-map=$value"
>>> command-line argument. This makes the final binary output reproducible, and
>>
>> Only one argument?  Sometimes you may want multiple -fdebug-prefix-map 
>> options (for both source and build directories, for example).  Perhaps the 
>> value should be split on spaces to provide multiple such mappings?
>>
> 
> We wanted to keep this environment variable simple, and allowing this would make it more costly for other projects to adopt.
> 
> Whichever separator character we choose, we would have to either (a) disallow it within the oldprefix/newprefix strings like what PATH does or (b) think of an escaping scheme. Neither choice is great - with (a) since we want to map *arbitrary* paths the restriction is less acceptable here than in PATH, and with (b) it adds complexity to the spec, for uncommon use-cases.
> 

If we picked '\n' as the separator character, we could perhaps live with the (a) restriction. I'll wait a while for others to comment some more.

> In the case of an out-of-tree build, it is still possible with the current proposal. Instead of:
> 
> SOURCE_PREFIX_MAP="srcprefix=srcname:buildprefix=buildname"
> 
> One could arrange the tree like:
> 
> commonprefix/srcname
> commonprefix/buildname
> 
> then set SOURCE_PREFIX_MAP="commonprefix=." or SOURCE_PREFIX_MAP="commonprefix/=".
> 

-- 
GPG: ed25519/56034877E1F87C35
GPG: rsa4096/1318EFAC5FBBDBCE
https://github.com/infinity0/pubkeys.git

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] Generate reproducible output independently of the build-path
  2016-11-02 14:24 [PATCH] Generate reproducible output independently of the build-path Ximin Luo
                   ` (4 preceding siblings ...)
  2016-11-02 16:28 ` [PATCH] Generate reproducible output independently of the build-path Joseph Myers
@ 2016-11-03 20:01 ` Ximin Luo
  2016-11-03 21:37   ` Mike Stump
  5 siblings, 1 reply; 12+ messages in thread
From: Ximin Luo @ 2016-11-03 20:01 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 1450 bytes --]

Ximin Luo:
> Testing
> =======
> 
> I've tested these patches on a Debian testing/unstable x86_64-linux-gnu system.
> So far I've only run the new tests that this patch adds, on a disable-bootstrap
> build. I will do a full bootstrap and run the full testsuite over the next few
> days, both with and without this patch, and report back.
> 

Tested with a full bootstrap on a Debian unstable x86_64-linux-gnu system.

Log snippets attached. These were produced by running the below shell command in each of the respective build directories (0 = without, 1 = with the patches):

find . -name '*.log' -a -not -name 'config.log' | sort | while read x; do echo "== $x =="; grep -a '^FAIL: \|^# of' "$x"; done > ../gcc-build-X.snippets

Due to make -j22, they didn't run the tests in the same order. However in between doing this:

$ diff -ru <(sort gcc-build-0.snippets) <(sort gcc-build-1.snippets)
--- /dev/fd/63	2016-11-03 20:58:02.892334031 +0100
+++ /dev/fd/62	2016-11-03 20:58:02.892334031 +0100
@@ -323,7 +323,7 @@
 # of expected failures		76
 # of expected passes		110511
 # of expected passes		11259
-# of expected passes		127561
+# of expected passes		127573
 # of expected passes		2797
 # of expected passes		42
 # of expected passes		43915
1

and a manual review of the unsorted diffs, hopefully you can see that everything is good.

X

-- 
GPG: ed25519/56034877E1F87C35
GPG: rsa4096/1318EFAC5FBBDBCE
https://github.com/infinity0/pubkeys.git

[-- Attachment #2: gcc-build-0.snippets --]
[-- Type: text/plain, Size: 14344 bytes --]

== ./gcc/testsuite/g++/g++.log ==
FAIL: g++.dg/guality/pr55665.C   -O2  line 23 p == 40
FAIL: g++.dg/guality/pr55665.C   -O3 -g  line 23 p == 40
# of expected passes		110511
# of unexpected failures	2
# of unexpected successes	2
# of expected failures		333
# of unsupported tests		3989
== ./gcc/testsuite/gcc/gcc.log ==
FAIL: gcc.dg/guality/pr54200.c   -Os  line 20 z == 3
FAIL: gcc.dg/guality/pr54519-1.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 20 y == 25
FAIL: gcc.dg/guality/pr54519-1.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 20 z == 6
FAIL: gcc.dg/guality/pr54519-1.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 23 y == 117
FAIL: gcc.dg/guality/pr54519-1.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 23 z == 8
FAIL: gcc.dg/guality/pr54519-2.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 17 y == 25
FAIL: gcc.dg/guality/pr54519-2.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 17 y == 25
FAIL: gcc.dg/guality/pr54519-3.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 20 y == 25
FAIL: gcc.dg/guality/pr54519-3.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 20 z == 6
FAIL: gcc.dg/guality/pr54519-3.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 23 y == 117
FAIL: gcc.dg/guality/pr54519-3.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 23 z == 8
FAIL: gcc.dg/guality/pr54519-3.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 20 y == 25
FAIL: gcc.dg/guality/pr54519-3.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 20 z == 6
FAIL: gcc.dg/guality/pr54519-3.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 23 y == 117
FAIL: gcc.dg/guality/pr54519-3.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 23 z == 8
FAIL: gcc.dg/guality/pr54519-4.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 17 y == 25
FAIL: gcc.dg/guality/pr54519-4.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 17 y == 25
FAIL: gcc.dg/guality/pr54519-5.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 17 y == 25
FAIL: gcc.dg/guality/pr54519-5.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 17 y == 25
FAIL: gcc.dg/guality/pr43051-1.c   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  line 34 c == &a[0]
FAIL: gcc.dg/guality/pr43051-1.c   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  line 36 e == &a[1]
FAIL: gcc.dg/guality/pr45882.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 16 d == 112
FAIL: gcc.dg/guality/pr45882.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 16 e == 142
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 14 arg1 == 1
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 14 arg2 == 2
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 14 arg3 == 3
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 14 arg4 == 4
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 14 arg5 == 5
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 14 arg6 == 6
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 16 arg1 == 1
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 16 arg2 == 2
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 16 arg3 == 3
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 16 arg4 == 4
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 16 arg5 == 5
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 16 arg6 == 6
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 14 arg1 == 1
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 14 arg2 == 2
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 14 arg3 == 3
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 14 arg4 == 4
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 14 arg5 == 5
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 14 arg6 == 6
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 16 arg1 == 1
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 16 arg2 == 2
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 16 arg3 == 3
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 16 arg4 == 4
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 16 arg5 == 5
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 16 arg6 == 6
FAIL: gcc.dg/guality/vla-1.c   -O1  line 17 sizeof (a) == 6
FAIL: gcc.dg/guality/vla-1.c   -O2  line 17 sizeof (a) == 6
FAIL: gcc.dg/guality/vla-1.c   -O3 -g  line 17 sizeof (a) == 6
FAIL: gcc.dg/guality/vla-1.c   -Os  line 17 sizeof (a) == 6
FAIL: gcc.dg/guality/vla-1.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 17 sizeof (a) == 6
FAIL: gcc.dg/guality/vla-1.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 17 sizeof (a) == 6
FAIL: b is -1, not 1
FAIL: 1 PASS, 1 FAIL, 0 UNRESOLVED
FAIL: gcc.dg/guality/pr41616-1.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  execution test
FAIL: c is -1, not 6303904
FAIL: v is -1, not 13
FAIL: e is -1, not 6304000
FAIL: c is -1, not 6303904
FAIL: v is -1, not 13
FAIL: e is -1, not 6304000
FAIL: c is -1, not 6303920
FAIL: v is -1, not 13
FAIL: e is -1, not 6304000
FAIL: c is -1, not 6303920
FAIL: v is -1, not 13
FAIL: e is -1, not 6304000
FAIL: c is -1, not 6303936
FAIL: v is -1, not 13
FAIL: e is -1, not 6304000
FAIL: c is -1, not 6303936
FAIL: v is -1, not 13
FAIL: e is -1, not 6304000
FAIL: c is -1, not 6303952
FAIL: v is -1, not 13
FAIL: e is -1, not 6304000
FAIL: c is -1, not 6303952
FAIL: v is -1, not 13
FAIL: e is -1, not 6304000
FAIL: c is -1, not 6303968
FAIL: v is -1, not 13
FAIL: e is -1, not 6304000
FAIL: c is -1, not 6303968
FAIL: v is -1, not 13
FAIL: e is -1, not 6304000
FAIL: c is -1, not 6303984
FAIL: v is -1, not 13
FAIL: e is -1, not 6304000
FAIL: ret is -1, not 6303984
FAIL: c is -1, not 6303920
FAIL: o is -1, not 6303904
FAIL: w is -1, not 6303984
FAIL: c is -1, not 6303920
FAIL: o is -1, not 6303904
FAIL: w is -1, not 6303984
FAIL: c is -1, not 6303936
FAIL: o is -1, not 6303920
FAIL: w is -1, not 6303984
FAIL: c is -1, not 6303936
FAIL: o is -1, not 6303920
FAIL: w is -1, not 6303984
FAIL: c is -1, not 6303952
FAIL: o is -1, not 6303936
FAIL: w is -1, not 6303984
FAIL: c is -1, not 6303952
FAIL: o is -1, not 6303936
FAIL: w is -1, not 6303984
FAIL: c is -1, not 6303968
FAIL: o is -1, not 6303952
FAIL: w is -1, not 6303984
FAIL: c is -1, not 6303968
FAIL: o is -1, not 6303952
FAIL: w is -1, not 6303984
FAIL: c is -1, not 6303984
FAIL: o is -1, not 6303968
FAIL: w is -1, not 6303984
FAIL: ret is -1, not 6303968
FAIL: c is -1, not 6303904
FAIL: e is -1, not 6303984
FAIL: c is -1, not 6303904
FAIL: e is -1, not 6303984
FAIL: c is -1, not 6303920
FAIL: e is -1, not 6303984
FAIL: c is -1, not 6303920
FAIL: e is -1, not 6303984
FAIL: c is -1, not 6303936
FAIL: e is -1, not 6303984
FAIL: c is -1, not 6303936
FAIL: e is -1, not 6303984
FAIL: c is -1, not 6303952
FAIL: e is -1, not 6303984
FAIL: c is -1, not 6303952
FAIL: e is -1, not 6303984
FAIL: c is -1, not 6303968
FAIL: e is -1, not 6303984
FAIL: c is -1, not 6303968
FAIL: e is -1, not 6303984
FAIL: ret is -1, not 0
FAIL: c is -1, not 6303904
FAIL: n is -1, not 6303920
FAIL: t is -1, not 6303984
FAIL: c is -1, not 6303904
FAIL: n is -1, not 6303920
FAIL: t is -1, not 6303984
FAIL: c is -1, not 6303920
FAIL: n is -1, not 6303936
FAIL: t is -1, not 6303984
FAIL: c is -1, not 6303920
FAIL: n is -1, not 6303936
FAIL: t is -1, not 6303984
FAIL: c is -1, not 6303936
FAIL: n is -1, not 6303952
FAIL: t is -1, not 6303984
FAIL: c is -1, not 6303936
FAIL: n is -1, not 6303952
FAIL: t is -1, not 6303984
FAIL: c is -1, not 6303952
FAIL: n is -1, not 6303968
FAIL: t is -1, not 6303984
FAIL: c is -1, not 6303952
FAIL: n is -1, not 6303968
FAIL: t is -1, not 6303984
FAIL: c is -1, not 6303968
FAIL: n is -1, not 6303984
FAIL: t is -1, not 6303984
FAIL: c is -1, not 6303968
FAIL: n is -1, not 6303984
FAIL: t is -1, not 6303984
FAIL: ret is -1, not 0
FAIL: 5 PASS, 114 FAIL, 0 UNRESOLVED
FAIL: ret is -1, not 6299888
FAIL: o is -1, not 6299808
FAIL: w is -1, not 6299888
FAIL: o is -1, not 6299808
FAIL: w is -1, not 6299888
FAIL: o is -1, not 6299824
FAIL: w is -1, not 6299888
FAIL: o is -1, not 6299824
FAIL: w is -1, not 6299888
FAIL: o is -1, not 6299840
FAIL: w is -1, not 6299888
FAIL: o is -1, not 6299840
FAIL: w is -1, not 6299888
FAIL: o is -1, not 6299856
FAIL: w is -1, not 6299888
FAIL: o is -1, not 6299856
FAIL: w is -1, not 6299888
FAIL: o is -1, not 6299872
FAIL: w is -1, not 6299888
FAIL: ret is -1, not 6299872
FAIL: e is -1, not 6299888
FAIL: e is -1, not 6299888
FAIL: e is -1, not 6299888
FAIL: e is -1, not 6299888
FAIL: e is -1, not 6299888
FAIL: e is -1, not 6299888
FAIL: e is -1, not 6299888
FAIL: e is -1, not 6299888
FAIL: e is -1, not 6299888
FAIL: e is -1, not 6299888
FAIL: ret is -1, not 0
FAIL: n is -1, not 6299824
FAIL: t is -1, not 6299888
FAIL: c is -1, not 6299808
FAIL: n is -1, not 6299824
FAIL: t is -1, not 6299888
FAIL: n is -1, not 6299840
FAIL: t is -1, not 6299888
FAIL: c is -1, not 6299824
FAIL: n is -1, not 6299840
FAIL: t is -1, not 6299888
FAIL: n is -1, not 6299856
FAIL: t is -1, not 6299888
FAIL: c is -1, not 6299840
FAIL: n is -1, not 6299856
FAIL: t is -1, not 6299888
FAIL: n is -1, not 6299872
FAIL: t is -1, not 6299888
FAIL: c is -1, not 6299856
FAIL: n is -1, not 6299872
FAIL: t is -1, not 6299888
FAIL: n is -1, not 6299888
FAIL: t is -1, not 6299888
FAIL: c is -1, not 6299872
FAIL: n is -1, not 6299888
FAIL: t is -1, not 6299888
FAIL: ret is -1, not 0
FAIL: 62 PASS, 57 FAIL, 0 UNRESOLVED
FAIL: e is 6299904, not 6299888
FAIL: e is 6299904, not 6299888
FAIL: e is 6299904, not 6299888
FAIL: e is 6299904, not 6299888
FAIL: e is 6299904, not 6299888
FAIL: e is 6299904, not 6299888
FAIL: e is 6299904, not 6299888
FAIL: e is 6299904, not 6299888
FAIL: e is 6299904, not 6299888
FAIL: e is 6299904, not 6299888
FAIL: 109 PASS, 10 FAIL, 0 UNRESOLVED
FAIL: v is -1, not 13
FAIL: e is -1, not 6299904
FAIL: v is -1, not 13
FAIL: e is -1, not 6299904
FAIL: v is -1, not 13
FAIL: e is -1, not 6299904
FAIL: v is -1, not 13
FAIL: e is -1, not 6299904
FAIL: v is -1, not 13
FAIL: e is -1, not 6299904
FAIL: v is -1, not 13
FAIL: e is -1, not 6299904
FAIL: v is -1, not 13
FAIL: e is -1, not 6299904
FAIL: v is -1, not 13
FAIL: e is -1, not 6299904
FAIL: v is -1, not 13
FAIL: e is -1, not 6299904
FAIL: v is -1, not 13
FAIL: e is -1, not 6299904
FAIL: v is -1, not 13
FAIL: e is -1, not 6299904
FAIL: ret is -1, not 6299888
FAIL: w is -1, not 6299888
FAIL: w is -1, not 6299888
FAIL: w is -1, not 6299888
FAIL: w is -1, not 6299888
FAIL: w is -1, not 6299888
FAIL: w is -1, not 6299888
FAIL: w is -1, not 6299888
FAIL: w is -1, not 6299888
FAIL: w is -1, not 6299888
FAIL: ret is -1, not 6299872
FAIL: e is -1, not 6299888
FAIL: e is -1, not 6299888
FAIL: e is -1, not 6299888
FAIL: e is -1, not 6299888
FAIL: e is -1, not 6299888
FAIL: e is -1, not 6299888
FAIL: e is -1, not 6299888
FAIL: e is -1, not 6299888
FAIL: e is -1, not 6299888
FAIL: e is -1, not 6299888
FAIL: ret is -1, not 0
FAIL: t is -1, not 6299888
FAIL: c is -1, not 6299808
FAIL: t is -1, not 6299888
FAIL: t is -1, not 6299888
FAIL: c is -1, not 6299824
FAIL: t is -1, not 6299888
FAIL: t is -1, not 6299888
FAIL: c is -1, not 6299840
FAIL: t is -1, not 6299888
FAIL: t is -1, not 6299888
FAIL: c is -1, not 6299856
FAIL: t is -1, not 6299888
FAIL: t is -1, not 6299888
FAIL: c is -1, not 6299872
FAIL: t is -1, not 6299888
FAIL: ret is -1, not 0
FAIL: 59 PASS, 60 FAIL, 0 UNRESOLVED
FAIL: b is 4589168020290535424, not 3003
FAIL: ab is not computable, expected 6299768
FAIL: ac is not computable, expected 6299772
FAIL: msg is not computable, expected 4197965
FAIL: 0 PASS, 4 FAIL, 0 UNRESOLVED
FAIL: gcc.dg/tree-ssa/pr69270-3.c scan-tree-dump-times uncprop1 ", 1" 4
FAIL: gcc.dg/tree-ssa/slsr-8.c scan-tree-dump-times optimized " w?\\* " 7
# of expected passes		127561
# of unexpected failures	56
# of unexpected successes	22
# of expected failures		343
# of unsupported tests		2056
== ./gcc/testsuite/gfortran/gfortran.log ==
FAIL: gfortran.dg/graphite/pr68279.f90   -O  (internal compiler error)
FAIL: gfortran.dg/graphite/pr68279.f90   -O  (test for excess errors)
# of expected passes		43915
# of unexpected failures	2
# of expected failures		76
# of unsupported tests		67
== ./gcc/testsuite/objc/objc.log ==
# of expected passes		2797
# of expected failures		6
# of unsupported tests		68
== ./x86_64-pc-linux-gnu/libatomic/testsuite/libatomic.log ==
# of expected passes		54
== ./x86_64-pc-linux-gnu/libgomp/testsuite/libgomp.log ==
# of expected passes		5098
# of unsupported tests		319
== ./x86_64-pc-linux-gnu/libitm/testsuite/libitm.log ==
# of expected passes		42
# of expected failures		3
# of unsupported tests		1
== ./x86_64-pc-linux-gnu/libstdc++-v3/testsuite/libstdc++.log ==
# of added symbols:		 26
# of missing symbols:		 0
# of undesignated symbols:	 2
# of incompatible symbols:	 0
# of expected passes		11259
# of expected failures		65
# of unsupported tests		586

[-- Attachment #3: gcc-build-1.snippets --]
[-- Type: text/plain, Size: 14344 bytes --]

== ./gcc/testsuite/g++/g++.log ==
FAIL: g++.dg/guality/pr55665.C   -O2  line 23 p == 40
FAIL: g++.dg/guality/pr55665.C   -O3 -g  line 23 p == 40
# of expected passes		110511
# of unexpected failures	2
# of unexpected successes	2
# of expected failures		333
# of unsupported tests		3989
== ./gcc/testsuite/gcc/gcc.log ==
FAIL: b is -1, not 1
FAIL: 1 PASS, 1 FAIL, 0 UNRESOLVED
FAIL: gcc.dg/guality/pr41616-1.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  execution test
FAIL: gcc.dg/guality/pr43051-1.c   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  line 34 c == &a[0]
FAIL: gcc.dg/guality/pr43051-1.c   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  line 36 e == &a[1]
FAIL: c is -1, not 6303904
FAIL: v is -1, not 13
FAIL: e is -1, not 6304000
FAIL: c is -1, not 6303904
FAIL: v is -1, not 13
FAIL: e is -1, not 6304000
FAIL: c is -1, not 6303920
FAIL: v is -1, not 13
FAIL: e is -1, not 6304000
FAIL: c is -1, not 6303920
FAIL: v is -1, not 13
FAIL: e is -1, not 6304000
FAIL: c is -1, not 6303936
FAIL: v is -1, not 13
FAIL: e is -1, not 6304000
FAIL: c is -1, not 6303936
FAIL: v is -1, not 13
FAIL: e is -1, not 6304000
FAIL: c is -1, not 6303952
FAIL: v is -1, not 13
FAIL: e is -1, not 6304000
FAIL: c is -1, not 6303952
FAIL: v is -1, not 13
FAIL: e is -1, not 6304000
FAIL: c is -1, not 6303968
FAIL: v is -1, not 13
FAIL: e is -1, not 6304000
FAIL: c is -1, not 6303968
FAIL: v is -1, not 13
FAIL: e is -1, not 6304000
FAIL: c is -1, not 6303984
FAIL: v is -1, not 13
FAIL: e is -1, not 6304000
FAIL: ret is -1, not 6303984
FAIL: c is -1, not 6303920
FAIL: o is -1, not 6303904
FAIL: w is -1, not 6303984
FAIL: c is -1, not 6303920
FAIL: o is -1, not 6303904
FAIL: w is -1, not 6303984
FAIL: c is -1, not 6303936
FAIL: o is -1, not 6303920
FAIL: w is -1, not 6303984
FAIL: c is -1, not 6303936
FAIL: o is -1, not 6303920
FAIL: w is -1, not 6303984
FAIL: c is -1, not 6303952
FAIL: o is -1, not 6303936
FAIL: w is -1, not 6303984
FAIL: c is -1, not 6303952
FAIL: o is -1, not 6303936
FAIL: w is -1, not 6303984
FAIL: c is -1, not 6303968
FAIL: o is -1, not 6303952
FAIL: w is -1, not 6303984
FAIL: c is -1, not 6303968
FAIL: o is -1, not 6303952
FAIL: w is -1, not 6303984
FAIL: c is -1, not 6303984
FAIL: o is -1, not 6303968
FAIL: w is -1, not 6303984
FAIL: ret is -1, not 6303968
FAIL: c is -1, not 6303904
FAIL: e is -1, not 6303984
FAIL: c is -1, not 6303904
FAIL: e is -1, not 6303984
FAIL: c is -1, not 6303920
FAIL: e is -1, not 6303984
FAIL: c is -1, not 6303920
FAIL: e is -1, not 6303984
FAIL: c is -1, not 6303936
FAIL: e is -1, not 6303984
FAIL: c is -1, not 6303936
FAIL: e is -1, not 6303984
FAIL: c is -1, not 6303952
FAIL: e is -1, not 6303984
FAIL: c is -1, not 6303952
FAIL: e is -1, not 6303984
FAIL: c is -1, not 6303968
FAIL: e is -1, not 6303984
FAIL: c is -1, not 6303968
FAIL: e is -1, not 6303984
FAIL: ret is -1, not 0
FAIL: c is -1, not 6303904
FAIL: n is -1, not 6303920
FAIL: t is -1, not 6303984
FAIL: c is -1, not 6303904
FAIL: n is -1, not 6303920
FAIL: t is -1, not 6303984
FAIL: c is -1, not 6303920
FAIL: n is -1, not 6303936
FAIL: t is -1, not 6303984
FAIL: c is -1, not 6303920
FAIL: n is -1, not 6303936
FAIL: t is -1, not 6303984
FAIL: c is -1, not 6303936
FAIL: n is -1, not 6303952
FAIL: t is -1, not 6303984
FAIL: c is -1, not 6303936
FAIL: n is -1, not 6303952
FAIL: t is -1, not 6303984
FAIL: c is -1, not 6303952
FAIL: n is -1, not 6303968
FAIL: t is -1, not 6303984
FAIL: c is -1, not 6303952
FAIL: n is -1, not 6303968
FAIL: t is -1, not 6303984
FAIL: c is -1, not 6303968
FAIL: n is -1, not 6303984
FAIL: t is -1, not 6303984
FAIL: c is -1, not 6303968
FAIL: n is -1, not 6303984
FAIL: t is -1, not 6303984
FAIL: ret is -1, not 0
FAIL: 5 PASS, 114 FAIL, 0 UNRESOLVED
FAIL: ret is -1, not 6299888
FAIL: o is -1, not 6299808
FAIL: w is -1, not 6299888
FAIL: o is -1, not 6299808
FAIL: w is -1, not 6299888
FAIL: o is -1, not 6299824
FAIL: w is -1, not 6299888
FAIL: o is -1, not 6299824
FAIL: w is -1, not 6299888
FAIL: o is -1, not 6299840
FAIL: w is -1, not 6299888
FAIL: o is -1, not 6299840
FAIL: w is -1, not 6299888
FAIL: o is -1, not 6299856
FAIL: w is -1, not 6299888
FAIL: o is -1, not 6299856
FAIL: w is -1, not 6299888
FAIL: o is -1, not 6299872
FAIL: w is -1, not 6299888
FAIL: ret is -1, not 6299872
FAIL: e is -1, not 6299888
FAIL: e is -1, not 6299888
FAIL: e is -1, not 6299888
FAIL: e is -1, not 6299888
FAIL: e is -1, not 6299888
FAIL: e is -1, not 6299888
FAIL: e is -1, not 6299888
FAIL: e is -1, not 6299888
FAIL: e is -1, not 6299888
FAIL: e is -1, not 6299888
FAIL: ret is -1, not 0
FAIL: n is -1, not 6299824
FAIL: t is -1, not 6299888
FAIL: c is -1, not 6299808
FAIL: n is -1, not 6299824
FAIL: t is -1, not 6299888
FAIL: n is -1, not 6299840
FAIL: t is -1, not 6299888
FAIL: c is -1, not 6299824
FAIL: n is -1, not 6299840
FAIL: t is -1, not 6299888
FAIL: n is -1, not 6299856
FAIL: t is -1, not 6299888
FAIL: c is -1, not 6299840
FAIL: n is -1, not 6299856
FAIL: t is -1, not 6299888
FAIL: n is -1, not 6299872
FAIL: t is -1, not 6299888
FAIL: c is -1, not 6299856
FAIL: n is -1, not 6299872
FAIL: t is -1, not 6299888
FAIL: n is -1, not 6299888
FAIL: t is -1, not 6299888
FAIL: c is -1, not 6299872
FAIL: n is -1, not 6299888
FAIL: t is -1, not 6299888
FAIL: ret is -1, not 0
FAIL: 62 PASS, 57 FAIL, 0 UNRESOLVED
FAIL: e is 6299904, not 6299888
FAIL: e is 6299904, not 6299888
FAIL: e is 6299904, not 6299888
FAIL: e is 6299904, not 6299888
FAIL: e is 6299904, not 6299888
FAIL: e is 6299904, not 6299888
FAIL: e is 6299904, not 6299888
FAIL: e is 6299904, not 6299888
FAIL: e is 6299904, not 6299888
FAIL: e is 6299904, not 6299888
FAIL: 109 PASS, 10 FAIL, 0 UNRESOLVED
FAIL: v is -1, not 13
FAIL: e is -1, not 6299904
FAIL: v is -1, not 13
FAIL: e is -1, not 6299904
FAIL: v is -1, not 13
FAIL: e is -1, not 6299904
FAIL: v is -1, not 13
FAIL: e is -1, not 6299904
FAIL: v is -1, not 13
FAIL: e is -1, not 6299904
FAIL: v is -1, not 13
FAIL: e is -1, not 6299904
FAIL: v is -1, not 13
FAIL: e is -1, not 6299904
FAIL: v is -1, not 13
FAIL: e is -1, not 6299904
FAIL: v is -1, not 13
FAIL: e is -1, not 6299904
FAIL: v is -1, not 13
FAIL: e is -1, not 6299904
FAIL: v is -1, not 13
FAIL: e is -1, not 6299904
FAIL: ret is -1, not 6299888
FAIL: w is -1, not 6299888
FAIL: w is -1, not 6299888
FAIL: w is -1, not 6299888
FAIL: w is -1, not 6299888
FAIL: w is -1, not 6299888
FAIL: w is -1, not 6299888
FAIL: w is -1, not 6299888
FAIL: w is -1, not 6299888
FAIL: w is -1, not 6299888
FAIL: ret is -1, not 6299872
FAIL: e is -1, not 6299888
FAIL: e is -1, not 6299888
FAIL: e is -1, not 6299888
FAIL: e is -1, not 6299888
FAIL: e is -1, not 6299888
FAIL: e is -1, not 6299888
FAIL: e is -1, not 6299888
FAIL: e is -1, not 6299888
FAIL: e is -1, not 6299888
FAIL: e is -1, not 6299888
FAIL: ret is -1, not 0
FAIL: t is -1, not 6299888
FAIL: c is -1, not 6299808
FAIL: t is -1, not 6299888
FAIL: t is -1, not 6299888
FAIL: c is -1, not 6299824
FAIL: t is -1, not 6299888
FAIL: t is -1, not 6299888
FAIL: c is -1, not 6299840
FAIL: t is -1, not 6299888
FAIL: t is -1, not 6299888
FAIL: c is -1, not 6299856
FAIL: t is -1, not 6299888
FAIL: t is -1, not 6299888
FAIL: c is -1, not 6299872
FAIL: t is -1, not 6299888
FAIL: ret is -1, not 0
FAIL: 59 PASS, 60 FAIL, 0 UNRESOLVED
FAIL: b is 4589168020290535424, not 3003
FAIL: ab is not computable, expected 6299768
FAIL: ac is not computable, expected 6299772
FAIL: msg is not computable, expected 4197965
FAIL: 0 PASS, 4 FAIL, 0 UNRESOLVED
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 14 arg1 == 1
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 14 arg2 == 2
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 14 arg3 == 3
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 14 arg4 == 4
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 14 arg5 == 5
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 14 arg6 == 6
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 16 arg1 == 1
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 16 arg2 == 2
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 16 arg3 == 3
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 16 arg4 == 4
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 16 arg5 == 5
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 16 arg6 == 6
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 14 arg1 == 1
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 14 arg2 == 2
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 14 arg3 == 3
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 14 arg4 == 4
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 14 arg5 == 5
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 14 arg6 == 6
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 16 arg1 == 1
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 16 arg2 == 2
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 16 arg3 == 3
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 16 arg4 == 4
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 16 arg5 == 5
FAIL: gcc.dg/guality/pr68860-1.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 16 arg6 == 6
FAIL: gcc.dg/guality/vla-1.c   -O1  line 17 sizeof (a) == 6
FAIL: gcc.dg/guality/vla-1.c   -O2  line 17 sizeof (a) == 6
FAIL: gcc.dg/guality/vla-1.c   -O3 -g  line 17 sizeof (a) == 6
FAIL: gcc.dg/guality/vla-1.c   -Os  line 17 sizeof (a) == 6
FAIL: gcc.dg/guality/vla-1.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 17 sizeof (a) == 6
FAIL: gcc.dg/guality/vla-1.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 17 sizeof (a) == 6
FAIL: gcc.dg/guality/pr54519-1.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 20 y == 25
FAIL: gcc.dg/guality/pr54519-1.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 20 z == 6
FAIL: gcc.dg/guality/pr54519-1.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 23 y == 117
FAIL: gcc.dg/guality/pr54519-1.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 23 z == 8
FAIL: gcc.dg/guality/pr54519-2.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 17 y == 25
FAIL: gcc.dg/guality/pr54519-2.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 17 y == 25
FAIL: gcc.dg/guality/pr54519-3.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 20 y == 25
FAIL: gcc.dg/guality/pr54519-3.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 20 z == 6
FAIL: gcc.dg/guality/pr54519-3.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 23 y == 117
FAIL: gcc.dg/guality/pr54519-3.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 23 z == 8
FAIL: gcc.dg/guality/pr54519-3.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 20 y == 25
FAIL: gcc.dg/guality/pr54519-3.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 20 z == 6
FAIL: gcc.dg/guality/pr54519-3.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 23 y == 117
FAIL: gcc.dg/guality/pr54519-3.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 23 z == 8
FAIL: gcc.dg/guality/pr54519-4.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 17 y == 25
FAIL: gcc.dg/guality/pr54519-4.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 17 y == 25
FAIL: gcc.dg/guality/pr54519-5.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  line 17 y == 25
FAIL: gcc.dg/guality/pr54519-5.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 17 y == 25
FAIL: gcc.dg/guality/pr45882.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 16 d == 112
FAIL: gcc.dg/guality/pr45882.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 16 e == 142
FAIL: gcc.dg/guality/pr54200.c   -Os  line 20 z == 3
FAIL: gcc.dg/tree-ssa/pr69270-3.c scan-tree-dump-times uncprop1 ", 1" 4
FAIL: gcc.dg/tree-ssa/slsr-8.c scan-tree-dump-times optimized " w?\\* " 7
# of expected passes		127573
# of unexpected failures	56
# of unexpected successes	22
# of expected failures		343
# of unsupported tests		2056
== ./gcc/testsuite/gfortran/gfortran.log ==
FAIL: gfortran.dg/graphite/pr68279.f90   -O  (internal compiler error)
FAIL: gfortran.dg/graphite/pr68279.f90   -O  (test for excess errors)
# of expected passes		43915
# of unexpected failures	2
# of expected failures		76
# of unsupported tests		67
== ./gcc/testsuite/objc/objc.log ==
# of expected passes		2797
# of expected failures		6
# of unsupported tests		68
== ./x86_64-pc-linux-gnu/libatomic/testsuite/libatomic.log ==
# of expected passes		54
== ./x86_64-pc-linux-gnu/libgomp/testsuite/libgomp.log ==
# of expected passes		5098
# of unsupported tests		319
== ./x86_64-pc-linux-gnu/libitm/testsuite/libitm.log ==
# of expected passes		42
# of expected failures		3
# of unsupported tests		1
== ./x86_64-pc-linux-gnu/libstdc++-v3/testsuite/libstdc++.log ==
# of added symbols:		 26
# of missing symbols:		 0
# of undesignated symbols:	 2
# of incompatible symbols:	 0
# of expected passes		11259
# of expected failures		65
# of unsupported tests		586

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] Generate reproducible output independently of the build-path
  2016-11-03 20:01 ` Ximin Luo
@ 2016-11-03 21:37   ` Mike Stump
  2016-11-04 11:08     ` Ximin Luo
  0 siblings, 1 reply; 12+ messages in thread
From: Mike Stump @ 2016-11-03 21:37 UTC (permalink / raw)
  To: Ximin Luo; +Cc: GCC Patches

On Nov 3, 2016, at 1:01 PM, Ximin Luo <infinity0@pwned.gg> wrote:
> Log snippets attached.

Ick.  You missed the utility of contrib/compare_tests.  :-)

If you say:

  contrib/compare_tests oldbuilddir newbuilddir

You can then sit back and see everything as you'd expect and want.  The output is priority sorted and usually around 0 lines line or so.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] Generate reproducible output independently of the build-path
  2016-11-03 21:37   ` Mike Stump
@ 2016-11-04 11:08     ` Ximin Luo
  0 siblings, 0 replies; 12+ messages in thread
From: Ximin Luo @ 2016-11-04 11:08 UTC (permalink / raw)
  To: Mike Stump; +Cc: GCC Patches

Mike Stump:
> On Nov 3, 2016, at 1:01 PM, Ximin Luo <infinity0@pwned.gg> wrote:
>> Log snippets attached.
> 
> Ick.  You missed the utility of contrib/compare_tests.  :-)
> 
> If you say:
> 
>   contrib/compare_tests oldbuilddir newbuilddir
> 
> You can then sit back and see everything as you'd expect and want.  The output is priority sorted and usually around 0 lines line or so.
> 

Oh, thanks! Here is the output:

~/reproducible/gcc-7-20161030$ contrib/compare_tests ../gcc-build-0/ ../gcc-build-1/
# Comparing directories
## Dir1=../gcc-build-0/: 8 sum files
## Dir2=../gcc-build-1/: 8 sum files

# Comparing 8 common sum files
## /bin/sh contrib/compare_tests  /tmp/gxx-sum1.9339 /tmp/gxx-sum2.9339
New tests that PASS:

gcc.dg/cpp/source_date_epoch-4.c (test for excess errors)
gcc.dg/cpp/source_date_epoch-4.c execution test
gcc.dg/cpp/source_date_epoch-5.c (test for excess errors)
gcc.dg/cpp/source_date_epoch-5.c execution test
gcc.dg/cpp/source_prefix_map-1.c (test for excess errors)
gcc.dg/cpp/source_prefix_map-1.c execution test
gcc.dg/cpp/source_prefix_map-2.c (test for excess errors)
gcc.dg/cpp/source_prefix_map-2.c execution test
gcc.dg/debug/dwarf2/source_prefix_map-1.c (test for excess errors)
gcc.dg/debug/dwarf2/source_prefix_map-1.c scan-assembler-dem DW_AT_comp_dir: "DWARF2TEST/gcc
gcc.dg/debug/dwarf2/source_prefix_map-2.c (test for excess errors)
gcc.dg/debug/dwarf2/source_prefix_map-2.c scan-assembler DW_AT_comp_dir: "/

# No differences found in 8 common sum files


-- 
GPG: ed25519/56034877E1F87C35
GPG: rsa4096/1318EFAC5FBBDBCE
https://github.com/infinity0/pubkeys.git

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-11-04 11:08 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-02 14:24 [PATCH] Generate reproducible output independently of the build-path Ximin Luo
2016-11-02 14:24 ` [PATCH 2/4] Split prefix-map values on the last '=' character, not the first Ximin Luo
2016-11-02 14:24 ` [PATCH 4/4] Use SOURCE_DATE_EPOCH in place of __TIMESTAMP__ if the latter is newer Ximin Luo
2016-11-02 14:24 ` [PATCH 1/4] Use SOURCE_PREFIX_MAP envvar as an implicit debug-prefix-map Ximin Luo
2016-11-02 16:25   ` Joseph Myers
2016-11-02 14:24 ` [PATCH 3/4] Use SOURCE_PREFIX_MAP envvar to transform __FILE__ Ximin Luo
2016-11-02 16:28 ` [PATCH] Generate reproducible output independently of the build-path Joseph Myers
2016-11-02 16:53   ` Ximin Luo
2016-11-02 17:56     ` Ximin Luo
2016-11-03 20:01 ` Ximin Luo
2016-11-03 21:37   ` Mike Stump
2016-11-04 11:08     ` Ximin Luo

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