Hi, On Tue, 2020-09-15 at 20:40 +0200, Jakub Jelinek wrote: > Ok, here it is in patch form. > I've briefly tested it, with the older binutils I have around (no --gdwarf-N > support), with latest gas (--gdwarf-N that can be passed to as even when > compiling C/C++ etc. code and emitting .debug_line) and latest gas with > Mark's fix > reverted (--gdwarf-N support, but can only pass it to as when assembling > user .s/.S files, not when compiling C/C++ etc.). > Will bootstrap/regtest (with the older binutils) later tonight. > > 2020-09-15 Jakub Jelinek <ja...@redhat.com> > > * configure.ac (HAVE_AS_GDWARF_5_DEBUG_FLAG, > HAVE_AS_WORKING_DWARF_4_FLAG): New tests. > * gcc.c (ASM_DEBUG_DWARF_OPTION): Define. > (ASM_DEBUG_SPEC): Use ASM_DEBUG_DWARF_OPTION instead of > "--gdwarf2". Use %{cond:opt1;:opt2} style. > (ASM_DEBUG_OPTION_DWARF_OPT): Define. > (ASM_DEBUG_OPTION_SPEC): Define. > (asm_debug_option): New variable. > (asm_options): Add "%(asm_debug_option)". > (static_specs): Add asm_debug_option entry. > (static_spec_functions): Add dwarf-version-gt. > (debug_level_greater_than_spec_func): New function. > * config/darwin.h (ASM_DEBUG_OPTION_SPEC): Define. > * config/darwin9.h (ASM_DEBUG_OPTION_SPEC): Redefine. > * config.in: Regenerated. > * configure: Regenerated.
I tested against the binutils-2_35-branch which will become 2.35.1 next week. The configure tests succeed there. So I think you can change the [elf,2,36,0] to [elf,2,35,1]. Also tested that they fail with an older binutils (2.32). Cheers, Mark