From 266cc0c181549c2fb6b50f8f26213cdc89101026 Mon Sep 17 00:00:00 2001 From: Bernd Schmidt Date: Fri, 18 Dec 2015 19:48:26 +0000 Subject: [PATCH] Ignore -fdebug-prefix-map in producer string (by Daniel Kahn Gillmor) * dwarf2out.c (gen_producer_string): Ignore -fdebug-prefix-map. testsuite/ * gcc.dg/debug/dwarf2/prod-options.c: New test. From-SVN: r231835 --- gcc/ChangeLog | 4 ++++ gcc/dwarf2out.c | 1 + gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.dg/debug/dwarf2/prod-options.c | 12 ++++++++++++ 4 files changed, 21 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/debug/dwarf2/prod-options.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fec799200b1..11ee6206388 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2015-12-18 Daniel Kahn Gillmor + + * dwarf2out.c (gen_producer_string): Ignore -fdebug-prefix-map. + 2015-12-18 Nathan Sidwell * config/nvptx/nvptx.c (nvptx_option_override): Emit sorry for diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 067c4f23892..320a077c0c7 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -21498,6 +21498,7 @@ gen_producer_string (void) case OPT_fpreprocessed: case OPT_fltrans_output_list_: case OPT_fresolution_: + case OPT_fdebug_prefix_map_: /* Ignore these. */ continue; default: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5da1ce4bc2b..b2d9d3bcd50 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2015-12-18 Bernd Schmidt + + * gcc.dg/debug/dwarf2/prod-options.c: New test. + 2015-12-18 Eric Botcazou * gnat.dg/specs/debug1.ads: Bump final count to 18. diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/prod-options.c b/gcc/testsuite/gcc.dg/debug/dwarf2/prod-options.c new file mode 100644 index 00000000000..21449f92d6d --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/prod-options.c @@ -0,0 +1,12 @@ +/* Verify that the DW_AT_producer does not contain certain compiler options + such as -fdebug-prefix-map=; this is undesirable since path names make + the build not reproducible. Other skipped options could be tested here + as well. */ +/* { dg-do compile } */ +/* { dg-options "-O2 -gdwarf -dA -fdebug-prefix-map=a=b" } */ +/* { dg-final { scan-assembler "DW_AT_producer: \"GNU C" } } */ +/* { dg-final { scan-assembler-not "debug-prefix-map" } } */ + +void func (void) +{ +} -- 2.30.2