summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog36
-rw-r--r--config.make.in2
-rwxr-xr-xconfigure24
-rw-r--r--configure.in14
-rw-r--r--misc/Makefile3
-rw-r--r--misc/search.h38
-rw-r--r--misc/sys/cdefs.h14
-rw-r--r--stdlib/Makefile4
-rw-r--r--stdlib/stdlib.h10
-rw-r--r--sysdeps/i386/fpu/bits/mathinline.h8
10 files changed, 102 insertions, 51 deletions
diff --git a/ChangeLog b/ChangeLog
index ae2cabaf13..ab39e4bd3a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,39 @@
+1998-06-26 14:37  Ulrich Drepper  <drepper@cygnus.com>
+
+	* configure.in: Check for -fexceptions.
+	* config.make.in: Define exceptions, not no-exceptions.
+	* misc/sys/cdefs.h: Define __PMS.  When using modern g++ define
+	__P to use throw().
+	* misc/Makefile: Define CFLAGS-tsearch.c and CFLAGS-lsearch.c to
+	$(exceptions).
+	* stdlib/Makefile: Likewise for bsearch.c, msort.c, and qsort.c.
+	* misc/search.h: Use __PMS in tsearch, tfind, tdelete, twalk, tdestroy,
+	lfind, and lsearch prototpypes.
+	* stdlib/stdlib.h: Likewise for bsearch and qsort.
+
+1998-06-26  Ulrich Drepper  <drepper@cygnus.com>
+
+	* sysdeps/i386/fpu/bits/mathinline.h (__finite): Use C code, not asm.
+
+1998-06-25  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+	* Makefile (remove-old-headers): Make phony.
+
+	* configure.in: Substitute @old_glibc_headers@.
+
+1998-06-26  Ulrich Drepper  <drepper@cygnus.com>
+
+	* libc.map: Remove __libc_uid.
+
+1998-06-24  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+	* manual/terminal.texi (Allocation, Pseudo-Terminal Pairs): Fix
+	typos.
+
+1998-06-26  Ulrich Drepper  <drepper@cygnus.com>
+
+	* libc.map: Add Alpha-specific io function from protected namespace.
+
 1998-06-25 19:26  Ulrich Drepper  <drepper@cygnus.com>
 
 	* Makeconfig (CPPFLAGS): Use $($(subdir)-CPPFLAGS) if defined first.
diff --git a/config.make.in b/config.make.in
index f957357ec7..9f8ea0a909 100644
--- a/config.make.in
+++ b/config.make.in
@@ -39,7 +39,7 @@ old-glibc-headers = @old_glibc_headers@
 
 versioning = @VERSIONING@
 no-whole-archive = @no_whole_archive@
-no-exceptions = @no_exceptions@
+exceptions = @exceptions@
 
 have-bash2 = @libc_cv_have_bash2@
 have-ksh = @libc_cv_have_ksh@
diff --git a/configure b/configure
index 7603d5a266..df9b511629 100755
--- a/configure
+++ b/configure
@@ -2531,9 +2531,9 @@ if test $libc_cv_ld_no_whole_archive = yes; then
   no_whole_archive=-Wl,--no-whole-archive
 fi
 
-echo $ac_n "checking for gcc -fno-exceptions""... $ac_c" 1>&6
-echo "configure:2536: checking for gcc -fno-exceptions" >&5
-if eval "test \"`echo '$''{'libc_cv_gcc_no_exceptions'+set}'`\" = set"; then
+echo $ac_n "checking for gcc -fexceptions""... $ac_c" 1>&6
+echo "configure:2536: checking for gcc -fexceptions" >&5
+if eval "test \"`echo '$''{'libc_cv_gcc_exceptions'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.c <<\EOF
@@ -2542,18 +2542,18 @@ int __eh_pc;
 __throw () {}
 EOF
 if { ac_try='${CC-cc} $CFLAGS
-			    -nostdlib -nostartfiles -fno-exceptions
+			    -nostdlib -nostartfiles -fexceptions
 			    -o conftest conftest.c 1>&5'; { (eval echo configure:2547: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
-  libc_cv_gcc_no_exceptions=yes
+  libc_cv_gcc_exceptions=yes
 else
-  libc_cv_gcc_no_exceptions=no
+  libc_cv_gcc_exceptions=no
 fi
 rm -f conftest*
 fi
 
-echo "$ac_t""$libc_cv_gcc_no_exceptions" 1>&6
-if test $libc_cv_ld_no_whole_archive = yes; then
-  no_exceptions=-fno-exceptions
+echo "$ac_t""$libc_cv_gcc_exceptions" 1>&6
+if test $libc_cv_gcc_exceptions = yes; then
+  exceptions=-fexceptions
 fi
 
 if test "$base_machine" = alpha ; then
@@ -2818,6 +2818,7 @@ fi
 
 
 
+
   
 if test $gnu_ld = yes; then
   cat >> confdefs.h <<\EOF
@@ -2851,7 +2852,7 @@ if test $shared = default; then
 fi
 
 echo $ac_n "checking whether -fPIC is default""... $ac_c" 1>&6
-echo "configure:2855: checking whether -fPIC is default" >&5
+echo "configure:2856: checking whether -fPIC is default" >&5
 if eval "test \"`echo '$''{'pic_default'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3059,11 +3060,12 @@ s%@PERL@%$PERL%g
 s%@VERSIONING@%$VERSIONING%g
 s%@libc_cv_have_initfini@%$libc_cv_have_initfini%g
 s%@no_whole_archive@%$no_whole_archive%g
-s%@no_exceptions@%$no_exceptions%g
+s%@exceptions@%$exceptions%g
 s%@uname_sysname@%$uname_sysname%g
 s%@uname_release@%$uname_release%g
 s%@uname_version@%$uname_version%g
 s%@stdio@%$stdio%g
+s%@old_glibc_headers@%$old_glibc_headers%g
 s%@libc_cv_slibdir@%$libc_cv_slibdir%g
 s%@libc_cv_sysconfdir@%$libc_cv_sysconfdir%g
 s%@libc_cv_rootsbindir@%$libc_cv_rootsbindir%g
diff --git a/configure.in b/configure.in
index 7dc7d4b560..b64e31cdb7 100644
--- a/configure.in
+++ b/configure.in
@@ -892,7 +892,7 @@ if test $libc_cv_ld_no_whole_archive = yes; then
 fi
 AC_SUBST(no_whole_archive)dnl
 
-AC_CACHE_CHECK(for gcc -fno-exceptions, libc_cv_gcc_no_exceptions, [dnl
+AC_CACHE_CHECK(for gcc -fexceptions, libc_cv_gcc_exceptions, [dnl
 cat > conftest.c <<\EOF
 _start () {}
 int __eh_pc;
@@ -900,17 +900,17 @@ __throw () {}
 EOF
 dnl No \ in command here because it ends up inside ''.
 if AC_TRY_COMMAND([${CC-cc} $CFLAGS
-			    -nostdlib -nostartfiles -fno-exceptions
+			    -nostdlib -nostartfiles -fexceptions
 			    -o conftest conftest.c 1>&AC_FD_CC]); then
-  libc_cv_gcc_no_exceptions=yes
+  libc_cv_gcc_exceptions=yes
 else
-  libc_cv_gcc_no_exceptions=no
+  libc_cv_gcc_exceptions=no
 fi
 rm -f conftest*])
-if test $libc_cv_ld_no_whole_archive = yes; then
-  no_exceptions=-fno-exceptions
+if test $libc_cv_gcc_exceptions = yes; then
+  exceptions=-fexceptions
 fi
-AC_SUBST(no_exceptions)dnl
+AC_SUBST(exceptions)dnl
 
 if test "$base_machine" = alpha ; then
 AC_CACHE_CHECK(for function ..ng prefix, libc_cv_gcc_alpha_ng_prefix, [dnl
diff --git a/misc/Makefile b/misc/Makefile
index 52bf339309..9365fd2a1a 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -63,6 +63,9 @@ gpl2lgpl := error.c error.h
 
 tests := tst-dirname tst-tsearch tst-fdset tst-efgcvt tst-mntent
 
+CFLAGS-tsearch.c = $(exceptions)
+CFLAGS-lsearch.c = $(exceptions)
+
 include ../Rules
 
 $(objpfx)libbsd-compat.a: $(dep-dummy-lib); $(make-dummy-lib)
diff --git a/misc/search.h b/misc/search.h
index 2258ce9d3a..96b28e3f98 100644
--- a/misc/search.h
+++ b/misc/search.h
@@ -127,22 +127,22 @@ VISIT;
 
 /* Search for an entry matching the given KEY in the tree pointed to
    by *ROOTP and insert a new element if not found.  */
-extern void *tsearch __P ((__const void *__key, void **__rootp,
-			   __compar_fn_t compar));
-extern void *__tsearch __P ((__const void *__key, void **__rootp,
+extern void *__tsearch __PMS ((__const void *__key, void **__rootp,
+			       __compar_fn_t compar));
+extern void *tsearch __PMS ((__const void *__key, void **__rootp,
 			     __compar_fn_t compar));
 
 /* Search for an entry matching the given KEY in the tree pointed to
    by *ROOTP.  If no matching entry is available return NULL.  */
-extern void *tfind __P ((__const void *__key, void *__const *__rootp,
-			 __compar_fn_t compar));
-extern void *__tfind __P ((__const void *__key, void *__const *__rootp,
+extern void *__tfind __PMS ((__const void *__key, void *__const *__rootp,
+			     __compar_fn_t compar));
+extern void *tfind __PMS ((__const void *__key, void *__const *__rootp,
 			   __compar_fn_t compar));
 
 /* Remove the element matching KEY from the tree pointed to by *ROOTP.  */
-extern void *tdelete __P ((__const void *__key, void **__rootp,
-			   __compar_fn_t compar));
-extern void *__tdelete __P ((__const void *__key, void **__rootp,
+extern void *__tdelete __PMS ((__const void *__key, void **__rootp,
+			       __compar_fn_t compar));
+extern void *tdelete __PMS ((__const void *__key, void **__rootp,
 			     __compar_fn_t compar));
 
 #ifndef __ACTION_FN_T
@@ -154,9 +154,8 @@ typedef void (*__action_fn_t) __P ((__const void *__nodep,
 
 /* Walk through the whole tree and call the ACTION callback for every node
    or leaf.  */
-extern void twalk __P ((__const void *__root, __action_fn_t action));
-
-extern void __twalk __P ((__const void *__root, __action_fn_t action));
+extern void __twalk __PMS ((__const void *__root, __action_fn_t action));
+extern void twalk __PMS ((__const void *__root, __action_fn_t action));
 
 #ifdef __USE_GNU
 /* Callback type for function to free a tree node.  If the keys are atomic
@@ -164,21 +163,22 @@ extern void __twalk __P ((__const void *__root, __action_fn_t action));
 typedef void (*__free_fn_t) __P ((void *__nodep));
 
 /* Destroy the whole tree, call FREEFCT for each node or leaf.  */
-extern void __tdestroy __P ((void *__root, __free_fn_t freefct));
-extern void tdestroy __P ((void *__root, __free_fn_t freefct));
+extern void __tdestroy __PMS ((void *__root, __free_fn_t freefct));
+extern void tdestroy __PMS ((void *__root, __free_fn_t freefct));
 #endif
 
 
 /* Perform linear search for KEY by comparing by COMPAR in an array
    [BASE,BASE+NMEMB*SIZE).  */
-extern void *lfind __P ((__const void *__key, __const void *__base,
-			 size_t *__nmemb, size_t __size,
-			 __compar_fn_t __compar));
+extern void *lfind __PMS ((__const void *__key, __const void *__base,
+			   size_t *__nmemb, size_t __size,
+			   __compar_fn_t __compar));
 
 /* Perform linear search for KEY by comparing by COMPAR function in
    array [BASE,BASE+NMEMB*SIZE) and insert entry if not found.  */
-extern void *lsearch __P ((__const void *__key, void *__base, size_t *__nmemb,
-			   size_t __size, __compar_fn_t __compar));
+extern void *lsearch __PMS ((__const void *__key, void *__base,
+			     size_t *__nmemb, size_t __size,
+			     __compar_fn_t __compar));
 
 __END_DECLS
 
diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h
index 1ced090251..096dc3d6c8 100644
--- a/misc/sys/cdefs.h
+++ b/misc/sys/cdefs.h
@@ -26,7 +26,17 @@
 
 #ifdef __GNUC__
 
-# define __P(args)	args	/* GCC can always grok prototypes.  */
+/* GCC can always grok prototypes.  For C++ programs we add throw()
+   to help it optimize the function calls.  But this works only with
+   gcc 2.8.x and egcs.  */
+# if defined __cplusplus && __GNUC_MINOR__ >= 8
+#  define __P(args)	args throw ()
+# else
+#  define __P(args)	args
+# endif
+/* This macro will be used for functions which might take C++ callback
+   functions.  */
+# define __PMS(args)	args
 # define __DOTS		, ...
 
 #else	/* Not GCC.  */
@@ -36,6 +46,7 @@
 # if (defined __STDC__ && __STDC__) || defined __cplusplus
 
 #  define __P(args)	args
+#  define __PMS(args)	args
 #  define __const	const
 #  define __signed	signed
 #  define __volatile	volatile
@@ -44,6 +55,7 @@
 # else	/* Not ANSI C or C++.  */
 
 #  define __P(args)	()	/* No prototypes.  */
+#  define __PMS(args)	()
 #  define __const		/* No ANSI C keywords.  */
 #  define __signed
 #  define __volatile
diff --git a/stdlib/Makefile b/stdlib/Makefile
index 91eaf60cfc..2682766c35 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -67,6 +67,10 @@ distribute := $(distribute) $(mpn-headers) gen-mpn-copy fpioconst.h
 
 generated += isomac isomac.out
 
+CFLAGS-bsearch.c = $(exceptions)
+CFLAGS-msort.c = $(exceptions)
+CFLAGS-qsort.c = $(exceptions)
+
 include ../Rules
 
 
diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h
index b0703333d1..66ea4a589a 100644
--- a/stdlib/stdlib.h
+++ b/stdlib/stdlib.h
@@ -604,14 +604,14 @@ typedef __compar_fn_t comparison_fn_t;
 
 /* Do a binary search for KEY in BASE, which consists of NMEMB elements
    of SIZE bytes each, using COMPAR to perform the comparisons.  */
-extern __ptr_t bsearch __P ((__const __ptr_t __key, __const __ptr_t __base,
-			     size_t __nmemb, size_t __size,
-			     __compar_fn_t __compar));
+extern __ptr_t bsearch __PMS ((__const __ptr_t __key, __const __ptr_t __base,
+			       size_t __nmemb, size_t __size,
+			       __compar_fn_t __compar));
 
 /* Sort NMEMB elements of BASE, of SIZE bytes each,
    using COMPAR to perform the comparisons.  */
-extern void qsort __P ((__ptr_t __base, size_t __nmemb, size_t __size,
-			__compar_fn_t __compar));
+extern void qsort __PMS ((__ptr_t __base, size_t __nmemb, size_t __size,
+			  __compar_fn_t __compar));
 
 
 /* Return the absolute value of X.  */
diff --git a/sysdeps/i386/fpu/bits/mathinline.h b/sysdeps/i386/fpu/bits/mathinline.h
index aa532cea05..ee00f5881a 100644
--- a/sysdeps/i386/fpu/bits/mathinline.h
+++ b/sysdeps/i386/fpu/bits/mathinline.h
@@ -581,13 +581,7 @@ __MATH_INLINE int __finite (double __x) __attribute__ ((__const__));
 __MATH_INLINE int
 __finite (double __x)
 {
-  register int __result;
-  __asm__ __volatile__
-    ("orl	$0x800fffff, %0\n\t"
-     "incl	%0\n\t"
-     "shrl	$31, %0"
-     : "=r" (__result) : "0" (((int *) &__x)[1]) : "cc");
-  return __result;
+  return ((((int *) &__x)[1] | 0x800fffff) + 1) >> 31;
 }
 
 /* Miscellaneous functions */