[PATCH] don't enable DWARF5 by default on Windows (PR98860)

Mikael Pettersson mikpelinux@gmail.com
Mon Feb 8 21:44:26 GMT 2021


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?

2021-02-08  Mikael Pettersson  <mikpelinux@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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-cygming-DWARF5-does-not-work-on-Windows.patch
Type: text/x-patch
Size: 888 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210208/5e5936bc/attachment.bin>


More information about the Gcc-patches mailing list