[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#777753: marked as done (gcc: LTO produces unreproducible debug information)



Your message dated Thu, 16 Apr 2015 19:49:21 +0200
with message-id <552FF621.1080803@debian.org>
and subject line Re: Bug#777753: [Reproducible-builds] Bug#777753: gcc: LTO produces unreproducible debug information
has caused the Debian Bug report #777753,
regarding gcc: LTO produces unreproducible debug information
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
777753: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=777753
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Source: gcc-4.9
Version: 4.9.2-10
Severity: normal
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: randomness toolchain
X-Debbugs-Cc: reproducible-builds@lists.alioth.debian.org
Forwarded: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65015

The GCC produced binaries seem to be only reproducible when not using
link time optimization. This was discussed on the mailing list [1]. Both
Jérémy Bobbio and Richard Biener pointed me in the direction of debug
information which contained artifacts from the randomly generated
temporary files of the LTO builds.

The last test [2] showed that these really seemed to be the culprit of
the problem. In the meantime, Richard Biener proposed patches which can
solve this problem. I've compiled my own version  of gcc-4.9 using the
attached patch and can confirm that the LTO builds are now working
perfectly fine and no changes to the affected packages are necessary
anymore.

Other versions of gcc might also have this problem but this is right now
only for the default gcc version used by the build infrastructure.

A small testcase is attached to the upstream bug.


[1] http://lists.alioth.debian.org/pipermail/reproducible-builds/Week-of-Mon-20150209/000933.html
[2] http://lists.alioth.debian.org/pipermail/reproducible-builds/Week-of-Mon-20150209/000942.html
diff -u gcc-4.9-4.9.2/debian/rules.patch gcc-4.9-4.9.2/debian/rules.patch
--- gcc-4.9-4.9.2/debian/rules.patch
+++ gcc-4.9-4.9.2/debian/rules.patch
@@ -232,6 +232,7 @@
 	sys-auxv-header \
 	libcilkrts-targets \
 	go-use-gold \
+	drop_opt \
 
 ifeq ($(with_softfloat),yes)
   debian_patches += arm-multilib-soft-float
only in patch2:
unchanged:
--- gcc-4.9-4.9.2.orig/debian/patches/drop_opt.diff
+++ gcc-4.9-4.9.2/debian/patches/drop_opt.diff
@@ -0,0 +1,28 @@
+Bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65015
+
+--- a/src/gcc/dwarf2out.c
++++ b/src/gcc/dwarf2out.c
+@@ -19196,6 +19196,9 @@ gen_producer_string (void)
+       case OPT__sysroot_:
+       case OPT_nostdinc:
+       case OPT_nostdinc__:
++      case OPT_fpreprocessed:
++      case OPT_fltrans_output_list_:
++      case OPT_fresolution_:
+ 	/* Ignore these.  */
+ 	continue;
+       default:
+@@ -23984,8 +23987,11 @@ dwarf2out_finish (const char *filename)
+   gen_remaining_tmpl_value_param_die_attribute ();
+ 
+   /* Add the name for the main input file now.  We delayed this from
+-     dwarf2out_init to avoid complications with PCH.  */
+-  add_name_attribute (comp_unit_die (), remap_debug_filename (filename));
++     dwarf2out_init to avoid complications with PCH.
++     Avoid doing this for LTO produced units as it adds random
++     tempfile names.  */
++  if (!in_lto_p)
++    add_name_attribute (comp_unit_die (), remap_debug_filename (filename));
+   if (!IS_ABSOLUTE_PATH (filename) || targetm.force_at_comp_dir)
+     add_comp_dir_attribute (comp_unit_die ());
+   else if (get_AT (comp_unit_die (), DW_AT_comp_dir) == NULL)

--- End Message ---
--- Begin Message ---
Version: 4.9.2-13

On 02/24/2015 12:57 PM, conchur@web.de wrote:
> tags 777753 + fixed-upstream
> thanks
> 
> Backport for 4.9.x: https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=220935
> Backport for 4.8.x: https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=220938
> 
> Versions including the fix: 4.8.5, 4.9.3, 5.0
> 
> 

--- End Message ---

Reply to: