Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/compiler_rt On sh3 __udivsi3 is gcc "millicode" wit...



details:   https://anonhg.NetBSD.org/src/rev/7de6aeb4ec65
branches:  trunk
changeset: 794616:7de6aeb4ec65
user:      uwe <uwe%NetBSD.org@localhost>
date:      Wed Mar 19 20:30:53 2014 +0000

description:
On sh3 __udivsi3 is gcc "millicode" with special calling convention
(less registers clobbered than usual).  Each DSO that needs it gets
its own hidden copy from libgcc.a.  Do not compile udivsi3.c for sh3
here since this C version doesn't conform to what gcc expects and
overrides the libgcc.a version.

This makes binaries compiled with gcc4.8 work.  The issue was not
exposed with gcc4.5 since it uses different division strategy by
default.

diffstat:

 lib/libc/compiler_rt/Makefile.inc |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r 57de58f8e12e -r 7de6aeb4ec65 lib/libc/compiler_rt/Makefile.inc
--- a/lib/libc/compiler_rt/Makefile.inc Wed Mar 19 18:21:39 2014 +0000
+++ b/lib/libc/compiler_rt/Makefile.inc Wed Mar 19 20:30:53 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.16 2014/03/02 03:04:52 matt Exp $
+# $NetBSD: Makefile.inc,v 1.17 2014/03/19 20:30:53 uwe Exp $
 
 COMPILER_RT_SRCDIR=    ${NETBSDSRCDIR}/sys/external/bsd/compiler_rt/dist
 
@@ -127,11 +127,18 @@
        ucmpti2.c \
        udivmodsi4.c \
        udivmodti4.c \
-       udivsi3.c \
        udivti3.c \
        umodsi3.c \
        umodti3.c
 
+.if ${MACHINE_CPU} != "sh3"
+# On sh3 __udivsi3 is gcc "millicode" with special calling convention
+# (less registers clobbered than usual).  Each DSO that needs it gets
+# its own hidden copy from libgcc.a.
+GENERIC_SRCS+= \
+       udivsi3.c
+.endif
+
 GENERIC_SRCS+= \
        absvdi2.c \
        addvdi3.c \



Home | Main Index | Thread Index | Old Index