On Fri, Jul 9, 2021 at 9:41 AM Eric Botcazou <botca...@adacore.com> wrote: > > Hi, > > 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. > > The attached patch is a minimal fix to plug the hole, and I don't think that > anything more sophisticated is worth the hassle since 2.37 supports DWARF 5, > i.e. HAVE_AS_GDWARF_5_DEBUG_FLAG and HAVE_AS_WORKING_DWARF_N_FLAG are defined > and HAVE_LD_BROKEN_PE_DWARF5 is not with it. > > Tested on x86-64/Linux and x86[-64]/Windows, OK for mainline and 11 branch?
OK. Thanks, Richard. > > 2021-07-07 Eric Botcazou <ebotca...@adacore.com> > > PR target/101377 > * gcc.c.c (ASM_DEBUG_DWARF_OPTION): Set again to --gdwarf2 > if HAVE_AS_WORKING_DWARF_N_FLAG is not defined > and HAVE_LD_BROKEN_PE_DWARF5 is defined. > > -- > Eric Botcazou