Oops, forgot to note that this is only for 68010, and other
systems including m68k are not affected.

Thanks,
rin

On 2020/03/08 15:30, Rin Okuyama wrote:
Module Name:    src
Committed By:   rin
Date:           Sun Mar  8 06:30:06 UTC 2020

Modified Files:
        src/lib/libc/compiler_rt: Makefile.inc

Log Message:
Fix broken printf(3) %d output for numbers more than two digits, e.g.,

   printf("%d\n", 42) ---> "::" instead of "42"

Our __{,u}modsi3 codes assume that __udivsi3 returns remainder to
%d1 (volatile register). __udivsi3 in libgcc does not, and therefore
mixing them up results in mess.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/lib/libc/compiler_rt/Makefile.inc

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


Modified files:

Index: src/lib/libc/compiler_rt/Makefile.inc
diff -u src/lib/libc/compiler_rt/Makefile.inc:1.36 
src/lib/libc/compiler_rt/Makefile.inc:1.37
--- src/lib/libc/compiler_rt/Makefile.inc:1.36  Tue Oct 29 16:08:50 2019
+++ src/lib/libc/compiler_rt/Makefile.inc       Sun Mar  8 06:30:06 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.36 2019/10/29 16:08:50 joerg Exp $
+# $NetBSD: Makefile.inc,v 1.37 2020/03/08 06:30:06 rin Exp $
COMPILER_RT_SRCDIR= ${NETBSDSRCDIR}/sys/external/bsd/compiler_rt/dist @@ -170,9 +170,16 @@ GENERIC_SRCS+= \
  GENERIC_SRCS+= \
        divmodsi4.c \
        divsi3.c \
-       modsi3.c \
        udivmodsi4.c \
+
+. if ${LIBC_MACHINE_ARCH} != "m68000"
+# Our __{,u}modsi3 codes assume that __udivsi3 returns remainder to
+# %d1 (volatile register). __udivsi3 in libgcc does not, and therefore
+# mixing them up results in mess.
+GENERIC_SRCS+= \
+       modsi3.c \
        umodsi3.c
+. endif
. if ${LIBC_MACHINE_CPU} != "sh3"
  # On sh3 __udivsi3 is gcc "millicode" with special calling convention

Reply via email to