Committed: Fix mmixware isatty support

Hans-Peter Nilsson
Tue Jan 29 17:42:00 GMT 2008

Missed at the _isatty cleanup.  Manifests as thousands of
regressions running the gcc testsuites, all the same:
x/obj/mmix-knuth-mmixware/./newlib/libc.a(lib_a-isattyr.o): In function `_isatty_r':
x/combined/newlib/libc/reent/isattyr.c:58: undefined reference to `_isatty'

For some reason the generic(?) isatty is picked up instead of
the one in libc/sys/mmixware/isatty.c, and for some reason the
libgloss _isatty isn't picked up (to cause execution failures
instead).  I just barely dodged the urge to investigate and
instead manage to say "whatever".  Either way, this is a correct
fix.  Though I couldn't help thinking that *maybe* there could
be some kind of safety net in the build framework, checking that
all global symbols in newlib are unique.  (But if I'm to do it,
it will happen some other year.)  No regressions in the gcc
testuite, compared to before an update (of both gcc and newlib).

	* libc/sys/mmixware/isatty.c (_isatty): Renamed from isatty.
	Make ISO C.

Index: libc/sys/mmixware/isatty.c
RCS file: /cvs/src/src/newlib/libc/sys/mmixware/isatty.c,v
retrieving revision 1.3
diff -p -u -r1.3 isatty.c
--- libc/sys/mmixware/isatty.c	18 Nov 2001 23:47:59 -0000	1.3
+++ libc/sys/mmixware/isatty.c	25 Jan 2008 04:16:51 -0000
@@ -1,6 +1,6 @@
 /* isatty for MMIXware.

-   Copyright (C) 2001 Hans-Peter Nilsson
+   Copyright (C) 2001, 2008 Hans-Peter Nilsson

    Permission to use, copy, modify, and distribute this software is
    freely granted, provided that the above copyright notice, this notice
@@ -16,8 +16,8 @@
 #include <sys/stat.h>
 #include "sys/syscall.h"

-isatty (fd)
-     int fd;
+_isatty (int fd)
   return fd == 0 || fd == 1 || fd == 2;

brgds, H-P

More information about the Newlib mailing list