Hi.

We're using LTO in openSUSE package builds and we use -flto=N based on number
of CPU that a builder machine has. That leads to debug info divergence and
so that I would like to canonize the option in producer string.

Ready to be installed after tests & bootstrap?
Thanks,
Martin

gcc/ChangeLog:

2019-07-10  Martin Liska  <mli...@suse.cz>

        * dwarf2out.c (gen_producer_string): Canonize -flto=N
        to -flto in dwarf producer string.
---
 gcc/dwarf2out.c | 7 +++++++
 1 file changed, 7 insertions(+)


diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 0449c2b2912..dccfe088de2 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -24460,6 +24460,13 @@ gen_producer_string (void)
       case OPT_fchecking_:
 	/* Ignore these.  */
 	continue;
+      case OPT_flto_:
+	  {
+	    const char *lto_canonical = "-flto";
+	    switches.safe_push (lto_canonical);
+	    len += strlen (lto_canonical) + 1;
+	    break;
+	  }
       default:
         if (cl_options[save_decoded_options[j].opt_index].flags
 	    & CL_NO_DWARF_RECORD)

Reply via email to