On February 8, 2021 10:44:26 PM GMT+01:00, Mikael Pettersson via Gcc-patches <gcc-patches@gcc.gnu.org> wrote: >PR98860 is a gcc-11 regression where bootstrap fails on Windows since >the switch to enable DWARF5 by default. The symptoms are that >executables generated by the stage1 compiler fail to run with "Exec >format error", which confuses subsequent configure steps and causes >hard errors. This happens even with the very latest binutils master. > >Fixed by updating SUBTARGET_OVERRIDE_OPTIONS to set dwarf_version to 4 >unless the user explicitly requested another version. I see some other >targets did the same. > >Tested on Cygwin64 and mingw-w64. > >Ok for master?
It might be better to expose the default via configure (I've heard desires to control that elsewhere). Richard. >2021-02-08 Mikael Pettersson <mikpeli...@gmail.com> > > PR bootstrap/98860 > * config/i386/cygming.h (SUBTARGET_OVERRIDE_OPTIONS): Override > dwarf_version to 4. > >--- a/gcc/config/i386/cygming.h >+++ b/gcc/config/i386/cygming.h >@@ -209,6 +209,9 @@ along with GCC; see the file COPYING3. If not see >#define SUBTARGET_OVERRIDE_OPTIONS >\ >do { >\ >flag_pic = TARGET_64BIT ? 1 : 0; \ >+ /* DWARF5 currently does not work on Windows. */ >\ >+ if (!global_options_set.x_dwarf_version) >\ >+ dwarf_version = 4; >\ > } while (0) > > /* Define this macro if references to a symbol must be treated