Module Name:    src
Committed By:   rin
Date:           Mon May 31 22:33:19 UTC 2021

Modified Files:
        src/doc: HACKS
        src/external/gpl3/gdb.old/lib/libgdb: Makefile
        src/external/gpl3/gdb/lib/libgdb: Makefile

Log Message:
PR toolchain/55837

Get rid of -O0 hack for GDB for hard-float arm. This was necessary because
libunwind did not support s0-s31. Note that for *most* cases (not all!),
-O0 stops using VFP registers for general purposes.

Also note that this hack was incomplete. We had to compile every functions
with -O0, that can be unwinded. Otherwise, GDB crashed every time exceptions
were raised.


To generate a diff of this commit:
cvs rdiff -u -r1.217 -r1.218 src/doc/HACKS
cvs rdiff -u -r1.12 -r1.13 src/external/gpl3/gdb.old/lib/libgdb/Makefile
cvs rdiff -u -r1.30 -r1.31 src/external/gpl3/gdb/lib/libgdb/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/HACKS
diff -u src/doc/HACKS:1.217 src/doc/HACKS:1.218
--- src/doc/HACKS:1.217	Sat May  8 12:27:21 2021
+++ src/doc/HACKS	Mon May 31 22:33:19 2021
@@ -1,4 +1,4 @@
-# $NetBSD: HACKS,v 1.217 2021/05/08 12:27:21 christos Exp $
+# $NetBSD: HACKS,v 1.218 2021/05/31 22:33:19 rin Exp $
 #
 # This file is intended to document workarounds for currently unsolved
 # (mostly) compiler bugs.
@@ -975,19 +975,6 @@ descr	Disable optimization on tc.c, loge
 	function "__int64_t llvm::MachineFrameInfo::getObjectOffset(int) const"
 kcah
 
-port	arm
-hack	compile gdb/dwarf2{expr,loc}.c with -O0 for GCC[89] (PR/54820, 54877)
-cdate	Wed Apr 29 11:04:58 UTC 2020
-mdate	Thu Oct  8 17:00:00 JST 2020
-who	rin
-file	src/external/gpl3/gdb/lib/libgdb/Makefile: 1.22
-descr	For earmv7hf{,eb}, GCC 8.4 and 9.3 miscompile dwarf2expr.c with -O[21].
-	For earmv5hf{,eb}, GCC 9.3 miscompiles dwarf2{expr,loc}.c with -O2
-	(GCC9 -O1 and GCC8 -O2 work fine). These result in GDB crash with
-	``gdb_exception_RETURN_MASK_ERROR''. For everyone's safety, compile
-	these files with -O0 for all arm variants with GCC >= 8.
-kcah
-
 port	m68k
 hack	compile aes_ccm_tag() with -O0 for GCC8 and GCC9
 cdate	Mon Aug 10 06:27:29 UTC 2020

Index: src/external/gpl3/gdb.old/lib/libgdb/Makefile
diff -u src/external/gpl3/gdb.old/lib/libgdb/Makefile:1.12 src/external/gpl3/gdb.old/lib/libgdb/Makefile:1.13
--- src/external/gpl3/gdb.old/lib/libgdb/Makefile:1.12	Fri May  7 12:19:48 2021
+++ src/external/gpl3/gdb.old/lib/libgdb/Makefile	Mon May 31 22:33:19 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.12 2021/05/07 12:19:48 rin Exp $
+#	$NetBSD: Makefile,v 1.13 2021/05/31 22:33:19 rin Exp $
 
 NOCTF=
 HOSTPROG_CXX=   1
@@ -54,16 +54,6 @@ CFLAGS:=		${CXXFLAGS} -std=gnu++11 -Wno-
 
 ada-exp.c: ada-lex.c
 
-.if ${MACHINE_CPU} == "arm"
-. if ${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 8
-# GCC 8.4/9.3 miscompile this with -O[21] for earmv7hf{,eb}.
-# GCC 9.3 miscompile this with -O2 for earmv5hf{,eb}.
-COPTS.dwarf2expr.c+=	-O0
-# GCC 9.3 miscompile this with -O2 for earmv5hf{,eb}.
-COPTS.dwarf2loc.c+=	-O0
-. endif
-.endif
-
 # These are generated by implicit rules and are not easy to generate
 CLEANDIRFILES+= \
 	ada-exp.c ada-lex.c \

Index: src/external/gpl3/gdb/lib/libgdb/Makefile
diff -u src/external/gpl3/gdb/lib/libgdb/Makefile:1.30 src/external/gpl3/gdb/lib/libgdb/Makefile:1.31
--- src/external/gpl3/gdb/lib/libgdb/Makefile:1.30	Sun May 30 02:23:25 2021
+++ src/external/gpl3/gdb/lib/libgdb/Makefile	Mon May 31 22:33:19 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.30 2021/05/30 02:23:25 joerg Exp $
+#	$NetBSD: Makefile,v 1.31 2021/05/31 22:33:19 rin Exp $
 
 NOCTF=
 HOSTPROG_CXX=   1
@@ -59,17 +59,6 @@ CFLAGS:=		${CXXFLAGS} -std=gnu++17 -Wno-
 
 ada-exp.c: ada-lex.c
 
-.if ${MACHINE_CPU} == "arm"
-. if ${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 8
-# XXX taken from GDB 8.3; not tested for GDB 11:
-# GCC 8.4/9.3 miscompile this with -O[21] for earmv7hf{,eb}.
-# GCC 9.3 miscompile this with -O2 for earmv5hf{,eb}.
-COPTS.expr.c+=	-O0
-# GCC 9.3 miscompile this with -O2 for earmv5hf{,eb}.
-COPTS.loc.c+=	-O0
-. endif
-.endif
-
 .if ${MACHINE} == "vax"
 . if ${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 8
 COPTS.read.c+=	-O0

Reply via email to