Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Temporary hack to work around incorrect/missing unwind info for



details:   https://anonhg.NetBSD.org/src/rev/deed22dccde2
branches:  trunk
changeset: 1026418:deed22dccde2
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Tue Nov 23 23:29:55 2021 +0000

description:
Temporary hack to work around incorrect/missing unwind info for
the t_sig_backtrace test case on ARM when compiled with optimization.

diffstat:

 doc/HACKS                               |  13 ++++++++++++-
 tests/lib/libexecinfo/Makefile          |   8 +++++++-
 tests/lib/libexecinfo/t_sig_backtrace.c |  13 +++++++++++--
 3 files changed, 30 insertions(+), 4 deletions(-)

diffs (85 lines):

diff -r 6f00afebf608 -r deed22dccde2 doc/HACKS
--- a/doc/HACKS Tue Nov 23 18:45:53 2021 +0000
+++ b/doc/HACKS Tue Nov 23 23:29:55 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: HACKS,v 1.225 2021/10/13 20:11:54 nia Exp $
+# $NetBSD: HACKS,v 1.226 2021/11/23 23:29:55 thorpej Exp $
 #
 # This file is intended to document workarounds for currently unsolved
 # (mostly) compiler bugs.
@@ -1020,3 +1020,14 @@
 descr  GCC 10 fails to build blake2b.c with an internal compiler
        error unless optimization is disabled.
 kcah
+
+port   arm
+hack   compile t_sig_backtrace with -fno-omit-frame-pointer for arm
+cdate  Tue Nov 23 23:24:37 UTC 2021
+mdate  Tue Nov 23 23:24:37 UTC 2021
+who    thorpej
+file   src/tests/lib/libexecinfo/Makefile: 1.8
+file   src/tests/lib/libexecinfo/t_sig_backtrace: 1.2
+descr  Unit test fails to pass unless t_sig_backtrace.c is compiled
+       with -fno-omit-frame-pointer and -DNOINLINE_HACK.
+kcah
diff -r 6f00afebf608 -r deed22dccde2 tests/lib/libexecinfo/Makefile
--- a/tests/lib/libexecinfo/Makefile    Tue Nov 23 18:45:53 2021 +0000
+++ b/tests/lib/libexecinfo/Makefile    Tue Nov 23 23:29:55 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.7 2021/11/18 15:03:19 thorpej Exp $
+# $NetBSD: Makefile,v 1.8 2021/11/23 23:29:55 thorpej Exp $
 
 .include <bsd.own.mk>
 
@@ -13,4 +13,10 @@
 
 COPTS.t_backtrace.c=   -Wno-stack-protector
 
+# XXX temporary hack
+.if ${MACHINE_CPU} == "arm"
+COPTS.t_sig_backtrace.c=-fno-omit-frame-pointer
+CPPFLAGS.t_sig_backtrace.c=-DNOINLINE_HACK
+.endif
+
 .include <bsd.test.mk>
diff -r 6f00afebf608 -r deed22dccde2 tests/lib/libexecinfo/t_sig_backtrace.c
--- a/tests/lib/libexecinfo/t_sig_backtrace.c   Tue Nov 23 18:45:53 2021 +0000
+++ b/tests/lib/libexecinfo/t_sig_backtrace.c   Tue Nov 23 23:29:55 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_sig_backtrace.c,v 1.1 2021/11/18 15:03:19 thorpej Exp $      */
+/*     $NetBSD: t_sig_backtrace.c,v 1.2 2021/11/23 23:29:55 thorpej Exp $      */
 
 /*-
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_sig_backtrace.c,v 1.1 2021/11/18 15:03:19 thorpej Exp $");
+__RCSID("$NetBSD: t_sig_backtrace.c,v 1.2 2021/11/23 23:29:55 thorpej Exp $");
 
 #include <sys/mman.h>
 #include <execinfo.h>
@@ -51,6 +51,10 @@
 
 static int the_loop(int);
 
+#ifdef NOINLINE_HACK
+volatile int noinline;
+#endif
+
 static int __noinline
 func1(int i)
 {
@@ -85,6 +89,11 @@
                i = func2(i);
        }
 
+#ifdef NOINLINE_HACK
+       if (noinline)
+               vfork();
+#endif
+
        return i;
 }
 



Home | Main Index | Thread Index | Old Index