Subject: lib/8283: mips libc missing _isnan/_isinf
To: None <>
From: None <>
List: netbsd-bugs
Date: 08/27/1999 10:20:53
>Number:         8283
>Category:       lib
>Synopsis:       mips libc missing _isnan/_isinf
>Confidential:   yes
>Severity:       serious
>Priority:       high
>Responsible:    lib-bug-people (Library Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Aug 27 10:20:00 1999
>Originator:     Erik Bertelsen
>Release:        NetBSD-current 26 Aug 1999
System: NetBSD 1.4K NetBSD 1.4K (SOCKDEV) #83: Thu Aug 26 18:46:47 CEST 1999 pmax

	On my pmax, libc was rebuilt based on 25 August sources. After sup'ing sources
	on 26 Aug, things were bad:

	* perl would coredump on each invocation
	* compilation of libc aborted with signal 11 when compiling strtod.c
	* compilation of several (most?) libm sources would die with signal 11
	* "fixing" libc by touch'ing strtod.s?o and installing it would cause
	  bin/cat to not link, but this time with a readable message, i.e. one of _isinf/_isnan
	  not being defined (I don't recall which of them).

	This lead me to look at libc/arch/mips/gen/isinf.S and propose the following patch.

	Furthermore this file contains the following lines:

	#ifdef WEAK_ALIAS
	#define isnan	_isnan	/* XXX */
	#define isinf	_isinf	/* XXX */
	These lines look suspicious and should be corrected, possibly by eradication.

	I suspect that the recent change to sys/cdefs_elf.h about allowing weak aliases
	was the provoking event.

Index: isinf.S
RCS file: /sw/cvs-base/src/lib/libc/arch/mips/gen/isinf.S,v
retrieving revision
diff -c -r1.1.1.2 isinf.S
*** isinf.S	1998/10/14 16:02:31
--- isinf.S	1999/08/27 14:42:58
*** 65,70 ****
--- 65,71 ----
   * Return true if x is a NAN.
+ XLEAF(_isnan)
  	mfc1	v1, $f13		# get MSW of x
  	mfc1	t3, $f12		# get LSW of x
  	sll	t1, v1, 1		# get x exponent
*** 90,95 ****
--- 91,97 ----
   * Return true if x is infinity.
+ XLEAF(_isinf)
  	mfc1	v1, $f13		# get MSW of x
  	mfc1	t3, $f12		# get LSW of x
  	sll	t1, v1, 1		# get x exponent

	Erik Bertelsen