Subject: Re: Softfloat for MIPS
To: NetBSD Toolchain <tech-toolchain@NetBSD.org>
From: Valeriy E. Ushakov <uwe@ptc.spbu.ru>
List: tech-toolchain
Date: 06/09/2006 22:52:17
On Fri, Jun 09, 2006 at 11:05:48 -0700, Markus Mayer wrote:

> So far all attempts have failed one way or another. Either we ended up
> with libraries that still had floating-point instructions in them or
> linking just fails.
> 
> Running 'MKSOFTFLOAT=yes ./build.sh -U -u -m sbmips-eb build' resulted in
> 
> [...]

> /local/usr/src/destdir.sbmips/lib/libc.so: undefined reference to `__eqdf2'
> /local/usr/src/destdir.sbmips/lib/libc.so: undefined reference to `__divsf3'
> /local/usr/src/destdir.sbmips/lib/libc.so: undefined reference to
> `__fixsfsi'
> /local/usr/src/destdir.sbmips/lib/libc.so: undefined reference to `__gtdf2'
> /local/usr/src/destdir.sbmips/lib/libc.so: undefined reference to
> `__floatsidf'
> [...]
> collect2: ld returned 1 exit status
> 
> The toolchain that created this error was built with 'MKSOFTFLOAT=yes
> ./build.sh -m sbmips-eb tools'.
> 
> Does anybody have any hints or tips?

I wonder if that's caused by rev 1.2 of lib/libc/gmon.c (yes, back
from 1994 :)

revision 1.2
date: 1994/05/14 06:31:15;  author: cgd;  state: Exp;  lines: +3 -2
branches:  1.2.4;
rcsids.  also, avoid floating point when picking scale value.  doesn't
cost much, only done once.

-#ifndef hp300
+#ifndef notdef
 		s_scale = ((float)p->kcountsize / o ) * SCALE_1_TO_1;
 #else /* avoid floating point */
 		int quot = o / p->kcountsize;


I have that fixed to #ifdef in my tree for ~ages, b/c istr I once
encoutered similar softdep problems.

Please, can you confirm that it fixes the softfloat build for you?

Thanks.

SY, Uwe
-- 
uwe@ptc.spbu.ru                         |       Zu Grunde kommen
http://snark.ptc.spbu.ru/~uwe/          |       Ist zu Grunde gehen