Skip to content

Commit 6fff86f

Browse files
committed
Default GCC debug format to DWARF 4
Even the latest GDB release does not correctly support DWARF 5 from GCC, most notably preprocessor macros. This is a bug in either GCC or GDB and is present across every platform tested. DWARF 4 works fine, so stick to it for now.
1 parent 2557f8c commit 6fff86f

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ WORKDIR /bootstrap
8888
RUN ln -s $ARCH mingw
8989

9090
WORKDIR /x-gcc
91-
RUN /gcc-$GCC_VERSION/configure \
91+
COPY src/gcc-*.patch $PREFIX/src/
92+
RUN cat $PREFIX/src/gcc-*.patch | patch -d/gcc-$GCC_VERSION -p1 \
93+
&& /gcc-$GCC_VERSION/configure \
9294
--prefix=/bootstrap \
9395
--with-sysroot=/bootstrap \
9496
--target=$ARCH \

src/gcc-000-dwarf4.patch

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
--- a/gcc/common.opt
2+
+++ b/gcc/common.opt
3+
@@ -3290,3 +3290,3 @@
4+
gdwarf-
5+
-Common Driver Joined UInteger Var(dwarf_version) Init(5) Negative(gstabs)
6+
+Common Driver Joined UInteger Var(dwarf_version) Init(4) Negative(gstabs)
7+
Generate debug information in DWARF v2 (or later) format.

0 commit comments

Comments
 (0)