Subject: lib/8283: mips libc missing _isnan/_isinf
To: None <gnats-bugs@gnats.netbsd.org>
From: None <erik@mediator.uni-c.dk>
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
>Last-Modified:
>Originator:     Erik Bertelsen
>Organization:
	
>Release:        NetBSD-current 26 Aug 1999
>Environment:
	
System: NetBSD sockdev.uni-c.dk 1.4K NetBSD 1.4K (SOCKDEV) #83: Thu Aug 26 18:46:47 CEST 1999 erik@sockdev.uni-c.dk:/usr/src/sys/arch/pmax/compile/SOCKDEV pmax


>Description:
	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 */
	WEAK_ALIAS(isnan,_isnan);
	WEAK_ALIAS(isinf,_isinf);
	#endif
	
	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.


>How-To-Repeat:
	
>Fix:
Index: isinf.S
===================================================================
RCS file: /sw/cvs-base/src/lib/libc/arch/mips/gen/isinf.S,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 isinf.S
*** isinf.S	1998/10/14 16:02:31	1.1.1.2
--- isinf.S	1999/08/27 14:42:58
***************
*** 65,70 ****
--- 65,71 ----
   * Return true if x is a NAN.
   */
  LEAF(isnan)
+ 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.
   */
  LEAF(isinf)
+ XLEAF(_isinf)
  	mfc1	v1, $f13		# get MSW of x
  	mfc1	t3, $f12		# get LSW of x
  	sll	t1, v1, 1		# get x exponent


	regards
	Erik Bertelsen
>Audit-Trail:
>Unformatted: