summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/pty.c10
-rw-r--r--sysdeps/generic/sys/ucontext.h24
-rw-r--r--sysdeps/i386/Makefile6
-rw-r--r--sysdeps/i386/fpu/bits/mathinline.h117
-rw-r--r--sysdeps/ieee754/bits/nan.h2
-rw-r--r--sysdeps/libm-ieee754/s_remquo.c5
-rw-r--r--sysdeps/libm-ieee754/s_remquof.c5
-rw-r--r--sysdeps/libm-ieee754/s_remquol.c5
-rw-r--r--sysdeps/m68k/fpu/bits/mathinline.h106
-rw-r--r--sysdeps/m68k/fpu/e_acos.c2
-rw-r--r--sysdeps/m68k/fpu/e_atan2.c2
-rw-r--r--sysdeps/m68k/fpu/e_fmod.c2
-rw-r--r--sysdeps/m68k/fpu/e_pow.c2
-rw-r--r--sysdeps/m68k/fpu/e_scalb.c2
-rw-r--r--sysdeps/m68k/fpu/k_cos.c2
-rw-r--r--sysdeps/m68k/fpu/k_sin.c2
-rw-r--r--sysdeps/m68k/fpu/k_tan.c2
-rw-r--r--sysdeps/m68k/fpu/s_atan.c2
-rw-r--r--sysdeps/m68k/fpu/s_ccos.c2
-rw-r--r--sysdeps/m68k/fpu/s_ccosh.c2
-rw-r--r--sysdeps/m68k/fpu/s_cexp.c2
-rw-r--r--sysdeps/m68k/fpu/s_csin.c2
-rw-r--r--sysdeps/m68k/fpu/s_csinh.c2
-rw-r--r--sysdeps/m68k/fpu/s_frexp.c2
-rw-r--r--sysdeps/m68k/fpu/s_ilogb.c2
-rw-r--r--sysdeps/m68k/fpu/s_isinf.c2
-rw-r--r--sysdeps/m68k/fpu/s_llrint.c2
-rw-r--r--sysdeps/m68k/fpu/s_llrintf.c2
-rw-r--r--sysdeps/m68k/fpu/s_llrintl.c2
-rw-r--r--sysdeps/m68k/fpu/s_lrint.c2
-rw-r--r--sysdeps/m68k/fpu/s_modf.c2
-rw-r--r--sysdeps/m68k/fpu/s_remquo.c2
-rw-r--r--sysdeps/m68k/fpu/s_scalbn.c2
-rw-r--r--sysdeps/m68k/fpu/s_sincos.c2
-rw-r--r--sysdeps/posix/sysv_signal.c2
-rw-r--r--sysdeps/powerpc/Dist1
-rw-r--r--sysdeps/unix/sysv/linux/getcwd.c21
-rw-r--r--sysdeps/unix/sysv/linux/net/if.h3
-rw-r--r--sysdeps/unix/sysv/linux/pty.c3
39 files changed, 230 insertions, 130 deletions
diff --git a/sysdeps/generic/pty.c b/sysdeps/generic/pty.c
index 660602b25a..75c7857f47 100644
--- a/sysdeps/generic/pty.c
+++ b/sysdeps/generic/pty.c
@@ -49,6 +49,10 @@ static char sccsid[] = "@(#)pty.c	8.1 (Berkeley) 6/4/93";
 #include <pty.h>
 #include <utmp.h>
 
+#ifndef REVOKE
+# define REVOKE(Line) revoke (Line)
+#endif
+
 int
 openpty(amaster, aslave, name, termp, winp)
 	int *amaster, *aslave;
@@ -56,7 +60,7 @@ openpty(amaster, aslave, name, termp, winp)
 	struct termios *termp;
 	struct winsize *winp;
 {
-	static char line[] = "/dev/ptyXX";
+	char line[11];
 	register const char *cp1, *cp2;
 	register int master, slave, ttygid;
 	size_t buflen = sysconf (_SC_GETGR_R_SIZE_MAX);
@@ -64,6 +68,8 @@ openpty(amaster, aslave, name, termp, winp)
 	struct group grbuffer;
 	struct group *gr;
 
+	strcpy (line, "/dev/ptyXX");
+
 	if (getgrnam_r("tty", &grbuffer, buffer, buflen, &gr) >= 0)
 		ttygid = gr->gr_gid;
 	else
@@ -80,7 +86,7 @@ openpty(amaster, aslave, name, termp, winp)
 				line[5] = 't';
 				(void) chown(line, getuid(), ttygid);
 				(void) chmod(line, S_IRUSR|S_IWUSR|S_IWGRP);
-				(void) revoke(line);
+				REVOKE(line);
 				if ((slave = open(line, O_RDWR, 0)) != -1) {
 					*amaster = master;
 					*aslave = slave;
diff --git a/sysdeps/generic/sys/ucontext.h b/sysdeps/generic/sys/ucontext.h
new file mode 100644
index 0000000000..cdfeb2cb81
--- /dev/null
+++ b/sysdeps/generic/sys/ucontext.h
@@ -0,0 +1,24 @@
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H	1
+
+#error "No system dependent context structure definitions"
+
+#endif /* sys/ucontext.h */
diff --git a/sysdeps/i386/Makefile b/sysdeps/i386/Makefile
index bb2d8f7b41..b97f95f6a8 100644
--- a/sysdeps/i386/Makefile
+++ b/sysdeps/i386/Makefile
@@ -1,6 +1,6 @@
 # The mpn functions need a #define for asm syntax flavor.
 # Every i386 port in use uses gas syntax (I think).
-asm-CPPFLAGS := $(asm-CPPFLAGS) -DGAS_SYNTAX
+asm-CPPFLAGS += -DGAS_SYNTAX
 
 # The i386 `long double' is a distinct type we support.
 long-double-fcts = yes
@@ -18,3 +18,7 @@ CFLAGS-rtld.c += -Wno-uninitialized -Wno-unused
 CFLAGS-dl-load.c += -Wno-unused
 CFLAGS-dl-reloc.c += -Wno-unused
 endif
+
+ifeq ($(subdir),math)
+CPPFLAGS += -D__LIBC_INTERNAL_MATH_INLINES
+endif
diff --git a/sysdeps/i386/fpu/bits/mathinline.h b/sysdeps/i386/fpu/bits/mathinline.h
index 482b47e3b3..5823055c30 100644
--- a/sysdeps/i386/fpu/bits/mathinline.h
+++ b/sysdeps/i386/fpu/bits/mathinline.h
@@ -22,64 +22,123 @@
 # error "Never use <bits/mathinline.h> directly; include <math.h> instead."
 #endif
 
+#ifdef __cplusplus
+# define __MATH_INLINE __inline
+#else
+# define __MATH_INLINE extern __inline
+#endif
+
 
 #if defined __USE_ISOC9X && defined __GNUC__ && __GNUC__ >= 2
 /* ISO C 9X defines some macros to perform unordered comparisons.  The
    ix87 FPU supports this with special opcodes and we should use them.
    These must not be inline functions since we have to be able to handle
    all floating-point types.  */
-# define isgreater(x, y) \
+# ifdef __i686__
+/* For the PentiumPro and more recent processors we can provide
+   better code.  */
+#  define isgreater(x, y) \
+     ({ register char __result;						      \
+	__asm__ ("fucomip; seta %%al"					      \
+		 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st");	      \
+	__result; })
+#  define isgreaterequal(x, y) \
+     ({ register char __result;						      \
+	__asm__ ("fucomip; setae %%al"					      \
+		 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st");	      \
+	__result; })
+
+#  define isless(x, y) \
+     ({ register char __result;						      \
+	__asm__ ("fucomip; setb %%al"					      \
+		 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st");	      \
+	__result; })
+
+#  define islessequal(x, y) \
+     ({ register char __result;						      \
+	__asm__ ("fucomip; setbe %%al"					      \
+		 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st");	      \
+	__result; })
+
+#  define islessgreater(x, y) \
+     ({ register char __result;						      \
+	__asm__ ("fucomip; setne %%al"					      \
+		 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st");	      \
+	__result; })
+
+#  define isunordered(x, y) \
+     ({ register char __result;						      \
+	__asm__ ("fucomip; setp %%al"					      \
+		 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st");	      \
+	__result; })
+# else
+/* This is the dumb, portable code for i386 and above.  */
+#  define isgreater(x, y) \
      ({ register char __result;						      \
-	__asm__ ("fucompp; fnstsw; testb $0x45, %%ah; setz %%al;"	      \
+	__asm__ ("fucompp; fnstsw; testb $0x45, %%ah; setz %%al"	      \
 		 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
 	__result; })
 
-# define isgreaterequal(x, y) \
+#  define isgreaterequal(x, y) \
      ({ register char __result;						      \
-	__asm__ ("fucompp; fnstsw; testb $0x05, %%ah; setz %%al;"	      \
+	__asm__ ("fucompp; fnstsw; testb $0x05, %%ah; setz %%al"	      \
 		 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
 	__result; })
 
-# define isless(x, y) \
+#  define isless(x, y) \
      ({ register char __result;						      \
-	__asm__ ("fucompp; fnstsw; xorb $0x01, %%ah; testb $0x45, %%ah;"      \
-		 "setz %%al"						      \
+	__asm__ ("fucompp; fnstsw; sahf; setb %%al"			      \
 		 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
 	__result; })
 
-# define islessequal(x, y) \
+#  define islessequal(x, y) \
      ({ register char __result;						      \
-	__asm__ ("fucompp; fnstsw; xorb $0x01, %%ah; testb $0x05, %%ah;"      \
-		 "setz %%al"						      \
+	__asm__ ("fucompp; fnstsw; sahf; setbe %%al"			      \
 		 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
 	__result; })
 
-# define islessgreater(x, y) \
+#  define islessgreater(x, y) \
      ({ register char __result;						      \
-	__asm__ ("fucompp; fnstsw; testb $0x44, %%ah; setz %%al;"	      \
+	__asm__ ("fucompp; fnstsw; testb $0x44, %%ah; setz %%al"	      \
 		 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
 	__result; })
 
-# define isunordered(x, y) \
+#  define isunordered(x, y) \
      ({ register char __result;						      \
 	__asm__ ("fucompp; fnstsw; sahf; setp %%al"			      \
 		 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
 	__result; })
-#endif
+# endif	/* __i686__ */
 
+/* XXX Argh!!!  More compiler errors.  */
+#if 0
+/* Test for negative number.  Used in the signbit() macro.  */
+__MATH_INLINE int
+__signbitf (float __x)
+{
+  union { float __f; int __i; } __u = { __f: __x }; return __u.__i < 0;
+}
+__MATH_INLINE int
+__signbit (double __x)
+{
+  union { double __d; int __i[2]; } __u = { __d: __x }; return __u.__i[1] < 0;
+}
+__MATH_INLINE int
+__signbitl (long double __x)
+{
+  union { long double __l; int __i[3]; } __u = { __l: __x };
+  return (__u.__i[2] & 0x8000) != 0;
+}
+#endif
+#endif
 
-#ifdef	__GNUC__
-#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
 
 /* The gcc, version 2.7 or below, has problems with all this inlining
    code.  So disable it for this version of the compiler.  */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 7)
+#if defined __GNUC__ && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 7))
 
-#ifdef __cplusplus
-# define __MATH_INLINE __inline
-#else
-# define __MATH_INLINE extern __inline
-#endif
+#if ((!defined __NO_MATH_INLINES || defined __LIBC_INTERNAL_MATH_INLINES) \
+     && defined __OPTIMIZE__)
 
 /* A macro to define float, double, and long double versions of various
    math functions for the ix87 FPU.  FUNC is the function name (which will
@@ -163,8 +222,10 @@
   {									      \
     code;								      \
   }
+#endif
 
 
+#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
 /* Miscellaneous functions */
 
 __inline_mathcode (__sgn, __x, \
@@ -550,6 +611,16 @@ __inline_mathcode (__acosh1p, __x, \
 #undef __atan2_code
 #undef __sincos_code
 
-#endif /* Not gcc <= 2.7.  */
 #endif /* __NO_MATH_INLINES  */
+
+
+/* This code is used internally in the GNU libc.  */
+#if 0
+/* XXX I hate compiler bugs.  The current version produces wrong code
+   if this optimization is used.  */
+#ifdef __LIBC_INTERNAL_MATH_INLINES
+__inline_mathop (__ieee754_sqrt, "fsqrt")
+#endif
+#endif
+
 #endif /* __GNUC__  */
diff --git a/sysdeps/ieee754/bits/nan.h b/sysdeps/ieee754/bits/nan.h
index 05a9d6af2a..1f385ffc00 100644
--- a/sysdeps/ieee754/bits/nan.h
+++ b/sysdeps/ieee754/bits/nan.h
@@ -42,7 +42,7 @@
 #  define __nan_bytes		{ 0, 0, 0xc0, 0x7f }
 # endif
 
-static union { unsigned char __c[4]; double __d; } __nan = { __nan_bytes };
+static union { unsigned char __c[4]; float __d; } __nan = { __nan_bytes };
 # define NAN	(__nan.__d)
 
 #endif	/* GCC.  */
diff --git a/sysdeps/libm-ieee754/s_remquo.c b/sysdeps/libm-ieee754/s_remquo.c
index 39f6ceab2e..6e32efbba2 100644
--- a/sysdeps/libm-ieee754/s_remquo.c
+++ b/sysdeps/libm-ieee754/s_remquo.c
@@ -71,11 +71,6 @@ __remquo (double x, double y, int *quo)
       x -= 2 * y;
       cquo += 2;
     }
-  if (x >= y)
-    {
-      x -= y;
-      ++cquo;
-    }
 
   if (hy < 0x00200000)
     {
diff --git a/sysdeps/libm-ieee754/s_remquof.c b/sysdeps/libm-ieee754/s_remquof.c
index b3870f4b02..2ffd16c903 100644
--- a/sysdeps/libm-ieee754/s_remquof.c
+++ b/sysdeps/libm-ieee754/s_remquof.c
@@ -70,11 +70,6 @@ __remquof (float x, float y, int *quo)
       x -= 2 * y;
       cquo += 2;
     }
-  if (x >= y)
-    {
-      x -= y;
-      ++cquo;
-    }
 
   if (hy < 0x01000000)
     {
diff --git a/sysdeps/libm-ieee754/s_remquol.c b/sysdeps/libm-ieee754/s_remquol.c
index b7835e6dc7..88ff298eb6 100644
--- a/sysdeps/libm-ieee754/s_remquol.c
+++ b/sysdeps/libm-ieee754/s_remquol.c
@@ -71,11 +71,6 @@ __remquol (long double x, long double p, int *quo)
       x -= 2 * p;
       cquo += 2;
     }
-  if (x >= p)
-    {
-      x -= p;
-      ++cquo;
-    }
 
   if (ep < 0x0002)
     {
diff --git a/sysdeps/m68k/fpu/bits/mathinline.h b/sysdeps/m68k/fpu/bits/mathinline.h
index c3ed76c0de..827a8d603d 100644
--- a/sysdeps/m68k/fpu/bits/mathinline.h
+++ b/sysdeps/m68k/fpu/bits/mathinline.h
@@ -70,22 +70,22 @@
 
 
 #if (!defined __NO_MATH_INLINES && defined __OPTIMIZE__) \
-    || defined __LIBC_M81_MATH_INLINES
+    || defined __LIBC_INTERNAL_MATH_INLINES
 
-#ifdef	__LIBC_M81_MATH_INLINES
+#ifdef	__LIBC_INTERNAL_MATH_INLINES
 /* This is used when defining the functions themselves.  Define them with
    __ names, and with `static inline' instead of `extern inline' so the
    bodies will always be used, never an external function call.  */
-#define __m81_u(x)		__CONCAT(__,x)
-#define __m81_inline		static __inline
+# define __m81_u(x)		__CONCAT(__,x)
+# define __m81_inline		static __inline
 #else
-#define __m81_u(x)		x
-#ifdef __cplusplus
-#define __m81_inline		__inline
-#else
-#define __m81_inline		extern __inline
-#endif
-#define __M81_MATH_INLINES	1
+# define __m81_u(x)		x
+# ifdef __cplusplus
+#  define __m81_inline		__inline
+# else
+#  define __m81_inline		extern __inline
+# endif
+# define __M81_MATH_INLINES	1
 #endif
 
 /* Define a const math function.  */
@@ -99,12 +99,12 @@
    is the name of the fpu operation (without leading f).  */
 
 #if defined __USE_MISC || defined __USE_ISOC9X
-#define __inline_mathop(func, op)			\
+# define __inline_mathop(func, op)			\
   __inline_mathop1(double, func, op)			\
   __inline_mathop1(float, __CONCAT(func,f), op)		\
   __inline_mathop1(long double, __CONCAT(func,l), op)
 #else
-#define __inline_mathop(func, op)			\
+# define __inline_mathop(func, op)			\
   __inline_mathop1(double, func, op)
 #endif
 
@@ -116,7 +116,7 @@
     return __result;							      \
   }
 
-#ifdef __LIBC_M81_MATH_INLINES
+#ifdef __LIBC_INTERNAL_MATH_INLINES
 /* ieee style elementary functions */
 /* These are internal to the implementation of libm.  */
 __inline_mathop(__ieee754_acos, acos)
@@ -154,21 +154,21 @@ __inline_mathop(sin, sin)
 __inline_mathop(tan, tan)
 __inline_mathop(tanh, tanh)
 
-#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC9X
+# if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC9X
 __inline_mathop(rint, int)
 __inline_mathop(expm1, etoxm1)
 __inline_mathop(log1p, lognp1)
-#endif
+# endif
 
-#ifdef __USE_MISC
+# ifdef __USE_MISC
 __inline_mathop(significand, getman)
-#endif
+# endif
 
-#ifdef __USE_ISOC9X
+# ifdef __USE_ISOC9X
 __inline_mathop(log2, log2)
 __inline_mathop(exp2, twotox)
 __inline_mathop(trunc, intrz)
-#endif
+# endif
 
 #endif /* !__NO_MATH_INLINES && __OPTIMIZE__ */
 
@@ -176,9 +176,9 @@ __inline_mathop(trunc, intrz)
    functions, using __FLOAT_TYPE as the domain type and __S as the suffix
    for the function names.  */
 
-#ifdef __LIBC_M81_MATH_INLINES
+#ifdef __LIBC_INTERNAL_MATH_INLINES
 /* Internally used functions.  */
-#define __internal_inline_functions(float_type, s)			     \
+# define __internal_inline_functions(float_type, s)			     \
 __m81_defun (float_type, __CONCAT(__ieee754_remainder,s),		     \
 	     (float_type __x, float_type __y))				     \
 {									     \
@@ -198,7 +198,7 @@ __m81_defun (float_type, __CONCAT(__ieee754_fmod,s),			     \
 __internal_inline_functions (double,)
 __internal_inline_functions (float,f)
 __internal_inline_functions (long double,l)
-#undef __internal_inline_functions
+# undef __internal_inline_functions
 
 /* Get the m68881 condition codes, to quickly check multiple conditions.  */
 static __inline__ unsigned long
@@ -210,12 +210,12 @@ __m81_test (long double __val)
 }
 
 /* Bit values returned by __m81_test.  */
-#define __M81_COND_NAN (1 << 24)
-#define __M81_COND_INF (2 << 24)
-#define __M81_COND_ZERO (4 << 24)
-#define __M81_COND_NEG (8 << 24)
+# define __M81_COND_NAN (1 << 24)
+# define __M81_COND_INF (2 << 24)
+# define __M81_COND_ZERO (4 << 24)
+# define __M81_COND_NEG (8 << 24)
 
-#endif /* __LIBC_M81_MATH_INLINES */
+#endif /* __LIBC_INTENRAL_MATH_INLINES */
 
 /* The rest of the functions are available to the user.  */
 
@@ -374,14 +374,14 @@ __inline_functions (long double,l)
 
 /* Note that there must be no whitespace before the argument passed for
    NAME, to make token pasting work correctly with -traditional.  */
-#define __inline_forward_c(rettype, name, args1, args2)	\
+# define __inline_forward_c(rettype, name, args1, args2)	\
 extern __inline rettype __attribute__((__const__))	\
 name args1						\
 {							\
   return __CONCAT(__,name) args2;			\
 }
 
-#define __inline_forward(rettype, name, args1, args2)	\
+# define __inline_forward(rettype, name, args1, args2)	\
 extern __inline rettype name args1			\
 {							\
   return __CONCAT(__,name) args2;			\
@@ -391,76 +391,76 @@ __inline_forward(double,frexp, (double __value, int *__expptr),
 		 (__value, __expptr))
 __inline_forward_c(double,floor, (double __x), (__x))
 __inline_forward_c(double,ceil, (double __x), (__x))
-#ifdef __USE_MISC
+# ifdef __USE_MISC
 __inline_forward_c(int,isinf, (double __value), (__value))
 __inline_forward_c(int,finite, (double __value), (__value))
 __inline_forward_c(double,scalbn, (double __x, int __n), (__x, __n))
 __inline_forward_c(double,scalbln, (double __x, long int __n), (__x, __n))
-#endif
-#if defined __USE_MISC || defined __USE_XOPEN
-#ifndef __USE_ISOC9X /* Conflict with macro of same name.  */
+# endif
+# if defined __USE_MISC || defined __USE_XOPEN
+#  ifndef __USE_ISOC9X /* Conflict with macro of same name.  */
 __inline_forward_c(int,isnan, (double __value), (__value))
-#endif
-#endif
-#ifdef __USE_ISOC9X
+#  endif
+# endif
+# ifdef __USE_ISOC9X
 __inline_forward_c(double,nearbyint, (double __value), (__value))
 __inline_forward_c(long int,lrint, (double __value), (__value))
 __inline_forward_c(double,fma, (double __x, double __y, double __z),
 		   (__x, __y, __z))
-#endif
-#ifdef __USE_GNU
+# endif
+# ifdef __USE_GNU
 __inline_forward(void,sincos, (double __x, double *__sinx, double *__cosx),
 		 (__x, __sinx, __cosx))
-#endif
+# endif
 
-#if defined __USE_MISC || defined __USE_ISOC9X
+# if defined __USE_MISC || defined __USE_ISOC9X
 
 __inline_forward(float,frexpf, (float __value, int *__expptr),
 		 (__value, __expptr))
 __inline_forward_c(float,floorf, (float __x), (__x))
 __inline_forward_c(float,ceilf, (float __x), (__x))
-#ifdef __USE_MISC
+#  ifdef __USE_MISC
 __inline_forward_c(int,isinff, (float __value), (__value))
 __inline_forward_c(int,finitef, (float __value), (__value))
 __inline_forward_c(float,scalbnf, (float __x, int __n), (__x, __n))
 __inline_forward_c(float,scalblnf, (float __x, long int __n), (__x, __n))
 __inline_forward_c(int,isnanf, (float __value), (__value))
-#endif
-#ifdef __USE_ISOC9X
+#  endif
+# ifdef __USE_ISOC9X
 __inline_forward_c(float,nearbyintf, (float __value), (__value))
 __inline_forward_c(long int,lrintf, (float __value), (__value))
 __inline_forward_c(float,fmaf, (float __x, float __y, float __z),
 		   (__x, __y, __z))
-#endif
-#ifdef __USE_GNU
+# endif
+# ifdef __USE_GNU
 __inline_forward(void,sincosf, (float __x, float *__sinx, float *__cosx),
 		 (__x, __sinx, __cosx))
-#endif
+# endif
 
 __inline_forward(long double,frexpl, (long double __value, int *__expptr),
 		 (__value, __expptr))
 __inline_forward_c(long double,floorl, (long double __x), (__x))
 __inline_forward_c(long double,ceill, (long double __x), (__x))
-#ifdef __USE_MISC
+# ifdef __USE_MISC
 __inline_forward_c(int,isinfl, (long double __value), (__value))
 __inline_forward_c(int,finitel, (long double __value), (__value))
 __inline_forward_c(long double,scalbnl, (long double __x, int __n), (__x, __n))
 __inline_forward_c(long double,scalblnl, (long double __x, long int __n),
 		   (__x, __n))
 __inline_forward_c(int,isnanl, (long double __value), (__value))
-#endif
-#ifdef __USE_ISOC9X
+# endif
+# ifdef __USE_ISOC9X
 __inline_forward_c(long double,nearbyintl, (long double __value), (__value))
 __inline_forward_c(long int,lrintl, (long double __value), (__value))
 __inline_forward_c(long double,fmal,
 		   (long double __x, long double __y, long double __z),
 		   (__x, __y, __z))
-#endif
-#ifdef __USE_GNU
+# endif
+# ifdef __USE_GNU
 __inline_forward(void,sincosl,
 		 (long double __x, long double *__sinx, long double *__cosx),
 		 (__x, __sinx, __cosx))
-#endif
+# endif
 
 #endif /* Use misc or ISO C9X */
 
diff --git a/sysdeps/m68k/fpu/e_acos.c b/sysdeps/m68k/fpu/e_acos.c
index 7ea9fb014b..9c2d91f271 100644
--- a/sysdeps/m68k/fpu/e_acos.c
+++ b/sysdeps/m68k/fpu/e_acos.c
@@ -16,7 +16,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
 #include <math.h>
 #include "math_private.h"
 
diff --git a/sysdeps/m68k/fpu/e_atan2.c b/sysdeps/m68k/fpu/e_atan2.c
index 59bc990f5b..d23d4f90d1 100644
--- a/sysdeps/m68k/fpu/e_atan2.c
+++ b/sysdeps/m68k/fpu/e_atan2.c
@@ -16,7 +16,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
 #include <math.h>
 #include "math_private.h"
 
diff --git a/sysdeps/m68k/fpu/e_fmod.c b/sysdeps/m68k/fpu/e_fmod.c
index 1daa453618..505650a531 100644
--- a/sysdeps/m68k/fpu/e_fmod.c
+++ b/sysdeps/m68k/fpu/e_fmod.c
@@ -16,7 +16,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
 #include <math.h>
 #include "math_private.h"
 
diff --git a/sysdeps/m68k/fpu/e_pow.c b/sysdeps/m68k/fpu/e_pow.c
index b3d151fadc..c36b64316e 100644
--- a/sysdeps/m68k/fpu/e_pow.c
+++ b/sysdeps/m68k/fpu/e_pow.c
@@ -16,7 +16,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
 #include <math.h>
 #include "math_private.h"
 
diff --git a/sysdeps/m68k/fpu/e_scalb.c b/sysdeps/m68k/fpu/e_scalb.c
index a5923ab450..93b44ff130 100644
--- a/sysdeps/m68k/fpu/e_scalb.c
+++ b/sysdeps/m68k/fpu/e_scalb.c
@@ -17,7 +17,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
 #include <math.h>
 
 #ifndef SUFF
diff --git a/sysdeps/m68k/fpu/k_cos.c b/sysdeps/m68k/fpu/k_cos.c
index 516d45904e..5b263ec6ae 100644
--- a/sysdeps/m68k/fpu/k_cos.c
+++ b/sysdeps/m68k/fpu/k_cos.c
@@ -16,7 +16,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
 #include <math.h>
 #include "math_private.h"
 
diff --git a/sysdeps/m68k/fpu/k_sin.c b/sysdeps/m68k/fpu/k_sin.c
index 348bc8fd9d..41de73fde7 100644
--- a/sysdeps/m68k/fpu/k_sin.c
+++ b/sysdeps/m68k/fpu/k_sin.c
@@ -16,7 +16,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
 #include <math.h>
 #include "math_private.h"
 
diff --git a/sysdeps/m68k/fpu/k_tan.c b/sysdeps/m68k/fpu/k_tan.c
index c38327e571..7f87e09e00 100644
--- a/sysdeps/m68k/fpu/k_tan.c
+++ b/sysdeps/m68k/fpu/k_tan.c
@@ -16,7 +16,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
 #include <math.h>
 #include "math_private.h"
 
diff --git a/sysdeps/m68k/fpu/s_atan.c b/sysdeps/m68k/fpu/s_atan.c
index f3d6960dc1..e6b676ba58 100644
--- a/sysdeps/m68k/fpu/s_atan.c
+++ b/sysdeps/m68k/fpu/s_atan.c
@@ -16,7 +16,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
 #include <math.h>
 
 #ifndef FUNC
diff --git a/sysdeps/m68k/fpu/s_ccos.c b/sysdeps/m68k/fpu/s_ccos.c
index 53f8286b14..095aa9803f 100644
--- a/sysdeps/m68k/fpu/s_ccos.c
+++ b/sysdeps/m68k/fpu/s_ccos.c
@@ -18,7 +18,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
 #include <complex.h>
 #include <math.h>
 
diff --git a/sysdeps/m68k/fpu/s_ccosh.c b/sysdeps/m68k/fpu/s_ccosh.c
index 85e73b87e3..3d560b3093 100644
--- a/sysdeps/m68k/fpu/s_ccosh.c
+++ b/sysdeps/m68k/fpu/s_ccosh.c
@@ -18,7 +18,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
 #include <complex.h>
 #include <math.h>
 
diff --git a/sysdeps/m68k/fpu/s_cexp.c b/sysdeps/m68k/fpu/s_cexp.c
index 86cc894a7e..da28ebb4d3 100644
--- a/sysdeps/m68k/fpu/s_cexp.c
+++ b/sysdeps/m68k/fpu/s_cexp.c
@@ -18,7 +18,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
 #include <complex.h>
 #include <math.h>
 
diff --git a/sysdeps/m68k/fpu/s_csin.c b/sysdeps/m68k/fpu/s_csin.c
index 8eecd961a6..ae456d3b91 100644
--- a/sysdeps/m68k/fpu/s_csin.c
+++ b/sysdeps/m68k/fpu/s_csin.c
@@ -18,7 +18,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
 #include <complex.h>
 #include <math.h>
 
diff --git a/sysdeps/m68k/fpu/s_csinh.c b/sysdeps/m68k/fpu/s_csinh.c
index 643a221b57..c95f9dc523 100644
--- a/sysdeps/m68k/fpu/s_csinh.c
+++ b/sysdeps/m68k/fpu/s_csinh.c
@@ -18,7 +18,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
 #include <complex.h>
 #include <math.h>
 
diff --git a/sysdeps/m68k/fpu/s_frexp.c b/sysdeps/m68k/fpu/s_frexp.c
index 84a9a0b45d..4280fcc50b 100644
--- a/sysdeps/m68k/fpu/s_frexp.c
+++ b/sysdeps/m68k/fpu/s_frexp.c
@@ -16,7 +16,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
 #include <math.h>
 
 #ifndef FUNC
diff --git a/sysdeps/m68k/fpu/s_ilogb.c b/sysdeps/m68k/fpu/s_ilogb.c
index 2d8f7d5082..aebcaa16ba 100644
--- a/sysdeps/m68k/fpu/s_ilogb.c
+++ b/sysdeps/m68k/fpu/s_ilogb.c
@@ -16,7 +16,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
 #include <math.h>
 
 #ifndef SUFF
diff --git a/sysdeps/m68k/fpu/s_isinf.c b/sysdeps/m68k/fpu/s_isinf.c
index fa0d1d56db..d8cafdbb0c 100644
--- a/sysdeps/m68k/fpu/s_isinf.c
+++ b/sysdeps/m68k/fpu/s_isinf.c
@@ -16,7 +16,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
 #include <math.h>
 
 #ifndef FUNC
diff --git a/sysdeps/m68k/fpu/s_llrint.c b/sysdeps/m68k/fpu/s_llrint.c
index 9dfee644ed..37b6f63278 100644
--- a/sysdeps/m68k/fpu/s_llrint.c
+++ b/sysdeps/m68k/fpu/s_llrint.c
@@ -19,7 +19,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
 #include <math.h>
 #include "math_private.h"
 
diff --git a/sysdeps/m68k/fpu/s_llrintf.c b/sysdeps/m68k/fpu/s_llrintf.c
index 3c8528c4e8..4d06ae2651 100644
--- a/sysdeps/m68k/fpu/s_llrintf.c
+++ b/sysdeps/m68k/fpu/s_llrintf.c
@@ -19,7 +19,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
 #include <math.h>
 #include "math_private.h"
 
diff --git a/sysdeps/m68k/fpu/s_llrintl.c b/sysdeps/m68k/fpu/s_llrintl.c
index 55190b9eb3..14a815fd1a 100644
--- a/sysdeps/m68k/fpu/s_llrintl.c
+++ b/sysdeps/m68k/fpu/s_llrintl.c
@@ -19,7 +19,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
 #include <math.h>
 #include "math_private.h"
 
diff --git a/sysdeps/m68k/fpu/s_lrint.c b/sysdeps/m68k/fpu/s_lrint.c
index 511d28880c..7747057f1a 100644
--- a/sysdeps/m68k/fpu/s_lrint.c
+++ b/sysdeps/m68k/fpu/s_lrint.c
@@ -19,7 +19,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
 #include <math.h>
 
 #ifndef suffix
diff --git a/sysdeps/m68k/fpu/s_modf.c b/sysdeps/m68k/fpu/s_modf.c
index ad0334faaa..b9867df475 100644
--- a/sysdeps/m68k/fpu/s_modf.c
+++ b/sysdeps/m68k/fpu/s_modf.c
@@ -16,7 +16,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
 #include <math.h>
 
 #ifndef SUFF
diff --git a/sysdeps/m68k/fpu/s_remquo.c b/sysdeps/m68k/fpu/s_remquo.c
index 0332eccfd0..7607fee782 100644
--- a/sysdeps/m68k/fpu/s_remquo.c
+++ b/sysdeps/m68k/fpu/s_remquo.c
@@ -18,7 +18,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
 #include <math.h>
 
 #ifndef SUFF
diff --git a/sysdeps/m68k/fpu/s_scalbn.c b/sysdeps/m68k/fpu/s_scalbn.c
index 1b219ec108..12b737a5e9 100644
--- a/sysdeps/m68k/fpu/s_scalbn.c
+++ b/sysdeps/m68k/fpu/s_scalbn.c
@@ -16,7 +16,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
 #define scalbln __no_scalbln_decl
 #define scalblnf __no_scalblnf_decl
 #define scalblnl __no_scalblnl_decl
diff --git a/sysdeps/m68k/fpu/s_sincos.c b/sysdeps/m68k/fpu/s_sincos.c
index ada21d0fb1..dda42e2775 100644
--- a/sysdeps/m68k/fpu/s_sincos.c
+++ b/sysdeps/m68k/fpu/s_sincos.c
@@ -16,7 +16,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
 #include <math.h>
 
 #ifndef FUNC
diff --git a/sysdeps/posix/sysv_signal.c b/sysdeps/posix/sysv_signal.c
index 2b6d5f9d56..c52d4af94d 100644
--- a/sysdeps/posix/sysv_signal.c
+++ b/sysdeps/posix/sysv_signal.c
@@ -56,3 +56,5 @@ __sysv_signal (sig, handler)
 
   return oact.sa_handler;
 }
+
+weak_alias (__sysv_signal, sysv_signal)
diff --git a/sysdeps/powerpc/Dist b/sysdeps/powerpc/Dist
index a3de7b3c96..9cd0a69fe3 100644
--- a/sysdeps/powerpc/Dist
+++ b/sysdeps/powerpc/Dist
@@ -1,5 +1,6 @@
 fenv_const.c
 fenv_libc.h
+ppc-mcount.S
 quad_float.h
 fe_nomask.c
 t_sqrt.c
diff --git a/sysdeps/unix/sysv/linux/getcwd.c b/sysdeps/unix/sysv/linux/getcwd.c
index 2af3b78da5..f3406d7916 100644
--- a/sysdeps/unix/sysv/linux/getcwd.c
+++ b/sysdeps/unix/sysv/linux/getcwd.c
@@ -69,19 +69,20 @@ __getcwd (char *buf, size_t size)
   n = __readlink ("/proc/self/cwd", path, alloc_size - 1);
   if (n != -1)
     {
-      if (n >= alloc_size - 1)
+      if (path[0] == '/')
 	{
-	  if (size > 0)
-	    return NULL;
+	  if (n >= alloc_size - 1)
+	    {
+	      if (buf == NULL)
+		free (path);
+	      return NULL;
+	    }
+
+	  path[n] = '\0';
+	  return buf ?: (char *) realloc (path, (size_t) n + 1);
 	}
       else
-	if (path[0] == '/')
-	  {
-	    path[n] = '\0';
-	    return buf ?: (char *) realloc (path, (size_t) n + 1);
-	  }
-	else
-	  no_new_dcache = 1;
+	no_new_dcache = 1;
     }
 
   /* Set to no_new_dcache only if error indicates that proc doesn't exist.  */
diff --git a/sysdeps/unix/sysv/linux/net/if.h b/sysdeps/unix/sysv/linux/net/if.h
index 861ca261de..468fed23e6 100644
--- a/sysdeps/unix/sysv/linux/net/if.h
+++ b/sysdeps/unix/sysv/linux/net/if.h
@@ -147,6 +147,7 @@ struct ifconf
 #define	ifc_buf	ifc_ifcu.ifcu_buf	/* Buffer address.  */
 #define	ifc_req	ifc_ifcu.ifcu_req	/* Array of structures.  */
 
+__BEGIN_DECLS
 
 /* Convert an interface name to an index, and vice versa.  */
 
@@ -167,4 +168,6 @@ extern struct if_nameindex *if_nameindex __P ((void));
 
 extern void if_freenameindex __P ((struct if_nameindex *__ptr));
 
+__END_DECLS
+
 #endif /* net/if.h */
diff --git a/sysdeps/unix/sysv/linux/pty.c b/sysdeps/unix/sysv/linux/pty.c
new file mode 100644
index 0000000000..e64261c8c4
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/pty.c
@@ -0,0 +1,3 @@
+/* Linux does not has the `revoke' function.  */
+#define REVOKE(Line)
+#include <sysdeps/generic/pty.c>