Source-Changes-HG archive

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

[src/trunk]: src/sys/lib/libkern for sh3 and GCC 7 pass -fnon-call-exceptions...



details:   https://anonhg.NetBSD.org/src/rev/933878df3147
branches:  trunk
changeset: 448687:933878df3147
user:      mrg <mrg%NetBSD.org@localhost>
date:      Thu Feb 07 04:33:24 2019 +0000

description:
for sh3 and GCC 7 pass -fnon-call-exceptions for udivmoddi4.c.
avoids it emitting a call to abort() for an explicit divide by zero.

diffstat:

 sys/lib/libkern/Makefile.compiler-rt |  9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diffs (20 lines):

diff -r 24459ff9de01 -r 933878df3147 sys/lib/libkern/Makefile.compiler-rt
--- a/sys/lib/libkern/Makefile.compiler-rt      Thu Feb 07 04:32:54 2019 +0000
+++ b/sys/lib/libkern/Makefile.compiler-rt      Thu Feb 07 04:33:24 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.compiler-rt,v 1.5 2014/08/10 05:57:31 matt Exp $
+# $NetBSD: Makefile.compiler-rt,v 1.6 2019/02/07 04:33:24 mrg Exp $
 
 COMPILER_RT_SRCDIR=    ${NETBSDSRCDIR}/sys/external/bsd/compiler_rt/dist
 
@@ -126,3 +126,10 @@
 .endfor
 
 CPPFLAGS.int_util.c+=  -DKERNEL_USE
+
+# XXX Explicit divide by zero in udivmoddi4.c -> abort().
+.if defined(HAVE_GCC) && ${HAVE_GCC} == 7 && ${ACTIVE_CC} == "gcc"
+. if ${MACHINE_CPU} == "sh3"
+COPTS.udivmoddi4.c+=   -fnon-call-exceptions
+. endif
+.endif



Home | Main Index | Thread Index | Old Index