aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2021-07-09 12:08:52 +0200
committerEric Botcazou <ebotcazou@adacore.com>2021-07-09 12:13:39 +0200
commite37e175e7dc3376244eb7705269ada6755616831 (patch)
tree8af34b7a644ba69760008683df434f2f0ac4475b /gcc/gcc.c
parent10722fb36de944c2385a275bb2b270727f7c93a4 (diff)
downloadgcc-e37e175e7dc3376244eb7705269ada6755616831.zip
gcc-e37e175e7dc3376244eb7705269ada6755616831.tar.gz
gcc-e37e175e7dc3376244eb7705269ada6755616831.tar.bz2
Fix build failure on Windows with older binutils
This is the build failure on Windows with binutils for which GNU as accepts the --gdwarf-5 switch but GNU ld generates broken binaries with DWARF 5. We already have the HAVE_LD_BROKEN_PE_DWARF5 kludge to disable DWARF 5 in this case but it only tames the DWARF version in the compiler, so the driver still passes --gdwarf-5 when invoked on an assembly file with -g. gcc/ PR target/101377 * gcc.c (ASM_DEBUG_DWARF_OPTION): Set again to --gdwarf2 in the case where HAVE_AS_WORKING_DWARF_N_FLAG is not defined and HAVE_LD_BROKEN_PE_DWARF5 is defined.
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 36a88fc..f086dd4 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -916,7 +916,7 @@ proper position among the other output files. */
than in ASM_DEBUG_SPEC, so that it applies to both .s and .c etc.
compilations. */
# define ASM_DEBUG_DWARF_OPTION ""
-# elif defined(HAVE_AS_GDWARF_5_DEBUG_FLAG)
+# elif defined(HAVE_AS_GDWARF_5_DEBUG_FLAG) && !defined(HAVE_LD_BROKEN_PE_DWARF5)
# define ASM_DEBUG_DWARF_OPTION "%{%:dwarf-version-gt(4):--gdwarf-5;" \
"%:dwarf-version-gt(3):--gdwarf-4;" \
"%:dwarf-version-gt(2):--gdwarf-3;" \