> I have to correct my last statement. It is still necessary to add
> -flto-partition=none when using -flto in a package. My earlier statement
> came from the wrong understanding of buildid as explained in the gcc bug [3].

A new patch [4] was submitted by Richard Biener. Together these patches [1,2,3]
were enough to fix all my testcases and at least build some of the affected
packages reproducible (I haven't tested all of them). 

-flto-partition=none wasn't necessary anymore in my tests

The gcc-4.9 patch used for this test is attached.

[1] https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=220678
[2] https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=220613
[3] https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=220735
[4] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65015#c22
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,46 @@
+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,13 @@ 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.
++     For LTO produced units use a fixed artificial name to avoid
++     leaking tempfile names into the dwarf.  */
++  if (!in_lto_p)
++    add_name_attribute (comp_unit_die (), remap_debug_filename (filename));
++  else
++    add_name_attribute (comp_unit_die (), "<artificial>");
+   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)
+--- a/src//gcc/varasm.c
++++ b/src//gcc/varasm.c
+@@ -6964,7 +6964,12 @@ default_file_start (void)
+     fputs (ASM_APP_OFF, asm_out_file);
+ 
+   if (targetm.asm_file_start_file_directive)
+-    output_file_directive (asm_out_file, main_input_filename);
++    {
++      if (in_lto_p)
++        output_file_directive (asm_out_file, "<artificial>");
++      else
++        output_file_directive (asm_out_file, main_input_filename);
++    }
+ }
+ 
+ /* This is a generic routine suitable for use as TARGET_ASM_FILE_END

Reply via email to