aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-11-04 03:00:40 +0000
committerUlrich Drepper <drepper@redhat.com>1997-11-04 03:00:40 +0000
commit1618c590382ef16b1942bf39a42aa683a050ff57 (patch)
treee36cbd52b4f65aa04764417892264eac7757e6eb
parentUpdate. (diff)
downloadglibc-1618c590382ef16b1942bf39a42aa683a050ff57.tar.gz
glibc-1618c590382ef16b1942bf39a42aa683a050ff57.tar.bz2
glibc-1618c590382ef16b1942bf39a42aa683a050ff57.zip
1997-11-04 Ulrich Drepper <drepper@cygnus.com> * manual/filesys.texi: Correct description of return value for readdir_r. * sysdeps/unix/readdir_r.c (__readdir_r): Return value of errno not -1 in error case. * sysdeps/generic/readdir_r.c (__readdir_r): Return ENOSYS not -1. Reported by Jim Meyering <meyering@eng.ascend.com>. 1997-11-02 Paul Eggert <eggert@twinsun.com> * strftime.c: Use host's underlying strftime to access locale-specific info. This is useful e.g. when building GNU Emacs under Solaris 2.6. (weekday_name, month_name): Omit if HAVE_STRFTIME. (my_strftime): New macro, which names the strftime function that this source file produces. (strftime): #undef if emacs is defined; this works around Emacs 20.2's method of compiling with -Dstrftime=emacs_strftime. Also, declare as a function returning size_t, for similar reasons. (my_strftime): If HAVE_STRFTIME, use underlying strftime to handle locale-dependent formats like %a and %Ec. 1997-11-02 Paul Eggert <eggert@twinsun.com> * strftime.c (memcpy_lowcase, memcpy_uppcase, strftime): Ensure that args to islower and isupper are valid unsigned chars, even if char is signed. 1997-11-04 Ulrich Drepper <drepper@cygnus.com> * assert/Makefile (headers): Add assert.h, necessary after patch to Makefiles. * ctype/Makefile (headers): Likewise. * pwd/Makefile (headers): Likewise. * grp/Makefile (headers): Likewise. Patch by NIIBE Yutaka <gniibe@mri.co.jp>. 1997-11-04 03:08 Ulrich Drepper <drepper@cygnus.com> * glibcbug.in: Add information about configured target. Patch by Zack Weinberg <zack@rabi.phys.columbia.edu>. * elf/dl-lookup.c (_dl_lookup_versioned_symbol): Be prepared for empty string as `reference_name' parameter. * elf/rtld.c: Don't set real program name in l_name of main object. * manual/creature.texi: Apply Paul Eggert's patch for better _POSIX_C_SOURCE description. * stdlib/strfmon.c: Fix numerous bugs in formatting. * time/strptime.c [%Y]: Treat all years, not only those which fit in time_t. [%Oy]: Really store value. Patches by Paul Eggert. * wcsmbs/wchar.h: Fix documentation bugs. Declare wcsdup only is __USE_GNU. 1997-11-03 02:48 Ulrich Drepper <drepper@cygnus.com> * sysdeps/generic/bits/errno.h: Remove all error definitions. This is only meant as a stub. 1997-10-31 Andreas Jaeger <aj@arthur.rhein-neckar.de> * sysdeps/standalone/bits/errno.h: Copied from sysdeps/generic/bits/errno.h and added all know error codes that are used in glibc. 1997-11-03 02:23 Ulrich Drepper <drepper@cygnus.com> * sysdeps/generic/make_siglist.c: Add comment to clarify use and make sure the correct _NSIG value is used. Patch by Klaus Espenlaub <kespenla@student.informatik.uni-ulm.de>. 1997-11-03 00:20 Ulrich Drepper <drepper@cygnus.com> * intl/localealias.c (read_alias_file): Correct handling of line reader which sometimes skipped complete lines (PR 205). Optimize a bit by using mempcpy. 1997-11-02 16:59 Philipp Thomas <kthomas@gwdg.de> * intl/localealias.c (read_alias_file): Correctly set map[].value instead of overwriting map[].alias 1997-11-02 15:32 Ulrich Drepper <drepper@cygnus.com> * libc.map: Add _IO_flockfile and _IO_funlockfile. Suggested by H.J. Lu <hjl@lucon.org>. 1997-11-02 15:17 Ulrich Drepper <drepper@cygnus.com> * elf/dl-error.c (_dl_signal_error): Use _strerror_internal instead of strerror. * assert/assert-perr.c: Use _strerror_internal directly instead of __strerror_r. Suggested by Joe Keane <jgk@jgk.org>. 1997-11-01 16:46 Zack Weinberg <zack@rabi.phys.columbia.edu> * configure.in: Check for gcc-2.7.2 -pipe bug and hack around it (PR 245). 1997-11-01 Paul Eggert <eggert@twinsun.com> * time/strptime.c (strptime_internal): Fix bug: %Oy forgot to assign tm_year. Do not restrict %Y to years less than 2037 even on 32-bit time_t hosts, as strptime returns an int tm_year, not a time_t, and it's possible for programs to use the year without having to use time_t. non-directories in the list (PR 203).
-rw-r--r--BUGS7
-rw-r--r--ChangeLog116
-rw-r--r--assert/Makefile1
-rw-r--r--assert/assert-perr.c8
-rw-r--r--bits/errno.h17
-rwxr-xr-xconfigure195
-rw-r--r--configure.in40
-rw-r--r--ctype/Makefile1
-rw-r--r--elf/dl-error.c10
-rw-r--r--elf/dl-lookup.c5
-rw-r--r--elf/rtld.c3
-rw-r--r--glibcbug.in2
-rw-r--r--grp/Makefile1
-rw-r--r--intl/localealias.c36
-rw-r--r--libc.map2
-rw-r--r--manual/creature.texi33
-rw-r--r--manual/filesys.texi4
-rw-r--r--pwd/Makefile1
-rw-r--r--stdlib/strfmon.c34
-rw-r--r--sysdeps/generic/bits/errno.h17
-rw-r--r--sysdeps/generic/make_siglist.c8
-rw-r--r--sysdeps/generic/readdir_r.c2
-rw-r--r--sysdeps/standalone/bits/errno.h62
-rw-r--r--sysdeps/unix/readdir_r.c2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/Dist2
-rw-r--r--time/strftime.c140
-rw-r--r--time/strptime.c6
-rw-r--r--wcsmbs/wchar.h18
28 files changed, 581 insertions, 192 deletions
diff --git a/BUGS b/BUGS
index 701acf0e00..efe407b4c5 100644
--- a/BUGS
+++ b/BUGS
@@ -1,7 +1,7 @@
List of known bugs (certainly very incomplete)
----------------------------------------------
-Time-stamp: <1997-10-31T16:49:39+0100 drepper>
+Time-stamp: <1997-11-02T15:10:48+0100 drepper>
This following list contains those bugs which I'm aware of. Please
make sure that bugs you report are not listed here. If you can fix one
@@ -58,11 +58,6 @@ Severity: [ *] to [***]
checked for errors, but the whole file containing the same
category.
[PR libc/207]
-
-[ *] configuring with CFLAGS="-pipe" configure doesn't work
- with gcc. This seems to be a bug in gcc 2.7.2.x (egcs doesn't
- have this bug).
- [PR libc/245]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ulrich Drepper
drepper@cygnus.com
diff --git a/ChangeLog b/ChangeLog
index 1b9fa7de1a..6b54555f5e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,122 @@
+1997-11-04 Ulrich Drepper <drepper@cygnus.com>
+
+ * manual/filesys.texi: Correct description of return value for
+ readdir_r.
+ * sysdeps/unix/readdir_r.c (__readdir_r): Return value of errno
+ not -1 in error case.
+ * sysdeps/generic/readdir_r.c (__readdir_r): Return ENOSYS not -1.
+ Reported by Jim Meyering <meyering@eng.ascend.com>.
+
+1997-11-02 Paul Eggert <eggert@twinsun.com>
+
+ * strftime.c: Use host's underlying strftime to access
+ locale-specific info. This is useful e.g. when building GNU
+ Emacs under Solaris 2.6.
+ (weekday_name, month_name): Omit if HAVE_STRFTIME.
+ (my_strftime): New macro, which names the strftime function that
+ this source file produces.
+ (strftime): #undef if emacs is defined; this works around Emacs 20.2's
+ method of compiling with -Dstrftime=emacs_strftime.
+ Also, declare as a function returning size_t, for similar reasons.
+ (my_strftime): If HAVE_STRFTIME, use underlying strftime to handle
+ locale-dependent formats like %a and %Ec.
+
+1997-11-02 Paul Eggert <eggert@twinsun.com>
+
+ * strftime.c (memcpy_lowcase, memcpy_uppcase, strftime):
+ Ensure that args to islower and isupper are valid unsigned
+ chars, even if char is signed.
+
+1997-11-04 Ulrich Drepper <drepper@cygnus.com>
+
+ * assert/Makefile (headers): Add assert.h, necessary after patch
+ to Makefiles.
+ * ctype/Makefile (headers): Likewise.
+ * pwd/Makefile (headers): Likewise.
+ * grp/Makefile (headers): Likewise.
+ Patch by NIIBE Yutaka <gniibe@mri.co.jp>.
+
+1997-11-04 03:08 Ulrich Drepper <drepper@cygnus.com>
+
+ * glibcbug.in: Add information about configured target.
+ Patch by Zack Weinberg <zack@rabi.phys.columbia.edu>.
+
+ * elf/dl-lookup.c (_dl_lookup_versioned_symbol): Be prepared for
+ empty string as `reference_name' parameter.
+ * elf/rtld.c: Don't set real program name in l_name of main object.
+
+ * manual/creature.texi: Apply Paul Eggert's patch for better
+ _POSIX_C_SOURCE description.
+
+ * stdlib/strfmon.c: Fix numerous bugs in formatting.
+
+ * time/strptime.c [%Y]: Treat all years, not only those which fit
+ in time_t.
+ [%Oy]: Really store value.
+ Patches by Paul Eggert.
+
+ * wcsmbs/wchar.h: Fix documentation bugs. Declare wcsdup only
+ is __USE_GNU.
+
+1997-11-03 02:48 Ulrich Drepper <drepper@cygnus.com>
+
+ * sysdeps/generic/bits/errno.h: Remove all error definitions. This
+ is only meant as a stub.
+
+1997-10-31 Andreas Jaeger <aj@arthur.rhein-neckar.de>
+
+ * sysdeps/standalone/bits/errno.h: Copied from
+ sysdeps/generic/bits/errno.h and added all know error codes that
+ are used in glibc.
+
+1997-11-03 02:23 Ulrich Drepper <drepper@cygnus.com>
+
+ * sysdeps/generic/make_siglist.c: Add comment to clarify use and
+ make sure the correct _NSIG value is used.
+ Patch by Klaus Espenlaub <kespenla@student.informatik.uni-ulm.de>.
+
+1997-11-03 00:20 Ulrich Drepper <drepper@cygnus.com>
+
+ * intl/localealias.c (read_alias_file): Correct handling of line
+ reader which sometimes skipped complete lines (PR 205).
+ Optimize a bit by using mempcpy.
+
+1997-11-02 16:59 Philipp Thomas <kthomas@gwdg.de>
+
+ * intl/localealias.c (read_alias_file): Correctly set map[].value
+ instead of overwriting map[].alias
+
+1997-11-02 15:32 Ulrich Drepper <drepper@cygnus.com>
+
+ * libc.map: Add _IO_flockfile and _IO_funlockfile.
+ Suggested by H.J. Lu <hjl@lucon.org>.
+
+1997-11-02 15:17 Ulrich Drepper <drepper@cygnus.com>
+
+ * elf/dl-error.c (_dl_signal_error): Use _strerror_internal instead
+ of strerror.
+ * assert/assert-perr.c: Use _strerror_internal directly instead of
+ __strerror_r.
+ Suggested by Joe Keane <jgk@jgk.org>.
+
+1997-11-01 16:46 Zack Weinberg <zack@rabi.phys.columbia.edu>
+
+ * configure.in: Check for gcc-2.7.2 -pipe bug and hack around it
+ (PR 245).
+
+1997-11-01 Paul Eggert <eggert@twinsun.com>
+
+ * time/strptime.c (strptime_internal): Fix bug: %Oy forgot to
+ assign tm_year. Do not restrict %Y to years less than 2037 even
+ on 32-bit time_t hosts, as strptime returns an int tm_year, not a
+ time_t, and it's possible for programs to use the year without
+ having to use time_t.
+
1997-10-31 23:16 Ulrich Drepper <drepper@cygnus.com>
* posix/glob.c (glob): If calling glob_in_dir for a list which was
generated by a glob call disable GLOB_ERR since there might be
- non-directories in the list (PR203).
+ non-directories in the list (PR 203).
* posix/glob.h (GLOB_ONLYDIR): New flag.
(__GLOB_FLAGS): Add GLOB_ONLYDIR.
diff --git a/assert/Makefile b/assert/Makefile
index 208a71a948..5780457502 100644
--- a/assert/Makefile
+++ b/assert/Makefile
@@ -20,6 +20,7 @@
# Sub-makefile for assert portion of the library.
#
subdir := assert
+headers := assert.h
routines := assert assert-perr
diff --git a/assert/assert-perr.c b/assert/assert-perr.c
index c62ae467ac..246727ee94 100644
--- a/assert/assert-perr.c
+++ b/assert/assert-perr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1994, 1995, 1996, 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
@@ -22,6 +22,10 @@
#include <sysdep.h>
+/* This is the internal function we use to generate the error string. */
+extern char *_strerror_internal __P ((int, char *, size_t));
+
+
extern const char *__assert_program_name; /* In assert.c. */
/* This function, when passed an error number, a filename, and a line
@@ -49,7 +53,7 @@ __assert_perror_fail (int errnum,
__assert_program_name ? ": " : "",
file, line,
function ? function : "", function ? ": " : "",
- __strerror_r (errnum, errbuf, sizeof errbuf));
+ _strerror_internal (errnum, errbuf, sizeof errbuf));
(void) fflush (stderr);
abort ();
diff --git a/bits/errno.h b/bits/errno.h
index cb61da7836..622c2c9de4 100644
--- a/bits/errno.h
+++ b/bits/errno.h
@@ -22,20 +22,15 @@
#undef __need_Emath
#define __Emath_defined 1
-# define EDOM 1
-# define ERANGE 2
+# define EDOM XXX <--- fill in what is actually needed
+# define ERANGE XXX <--- fill in what is actually needed
#endif
#ifdef _ERRNO_H
-# define ENOSYS 3
-# define EINVAL 4
-# define ESPIPE 5
-# define EBADF 6
-# define ENOMEM 7
-# define EACCES 8
-# define ENFILE 9
-# define EMFILE 10
-# define ENOMSG 11
+# error "Define here all the missing error messages for the port. These"
+# error "must match the numbers of the kernel."
+# define Exxxx XXX
+...
#endif
#define __set_errno(val) errno = (val)
diff --git a/configure b/configure
index 3b1a1390e9..2955226441 100755
--- a/configure
+++ b/configure
@@ -558,14 +558,6 @@ else
ac_n= ac_c='\c' ac_t=
fi
- if test -r /vmunix; then
- kernel_id=`strings /vmunix | grep UNIX`
- elif test -r /dynix; then
- kernel_id=`strings /dynix | grep DYNIX`
- else
- kernel_id=
- fi
-
@@ -760,7 +752,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:764: checking host system type" >&5
+echo "configure:756: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -879,7 +871,7 @@ fi
# This can take a while to compute.
sysdep_dir=$srcdir/sysdeps
echo $ac_n "checking sysdep dirs""... $ac_c" 1>&6
-echo "configure:883: checking sysdep dirs" >&5
+echo "configure:875: checking sysdep dirs" >&5
# Make sco3.2v4 become sco3.2.4 and sunos4.1.1_U1 become sunos4.1.1.U1.
os="`echo $os | sed 's/\([0-9A-Z]\)[v_]\([0-9A-Z]\)/\1.\2/g'`"
@@ -1080,7 +1072,7 @@ echo "$ac_t""sysdeps/generic" 1>&6
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1084: checking for a BSD compatible install" >&5
+echo "configure:1076: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1134,7 +1126,7 @@ if test "$INSTALL" = "${srcdir}/install-sh -c"; then
INSTALL='\$(..)./install-sh -c'
fi
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1138: checking whether ln -s works" >&5
+echo "configure:1130: checking whether ln -s works" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1159,7 +1151,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1163: checking for $ac_word" >&5
+echo "configure:1155: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_MSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1192,7 +1184,7 @@ test -n "$MSGFMT" || MSGFMT=":"
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1196: checking for $ac_word" >&5
+echo "configure:1188: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1221,7 +1213,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1225: checking for $ac_word" >&5
+echo "configure:1217: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1269,7 +1261,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1273: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1265: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -1279,11 +1271,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext <<EOF
-#line 1283 "configure"
+#line 1275 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:1287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1279: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -1306,13 +1298,13 @@ else
cross_linkable=yes
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1310: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1302: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1316: checking whether we are using GNU C" >&5
+echo "configure:1308: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1321,7 +1313,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1325: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1317: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -1338,7 +1330,7 @@ if test $ac_cv_prog_gcc = yes; then
yes;
#endif
EOF
- if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1342: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+ if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1334: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
if test -z "$CFLAGS"; then
CFLAGS="-g -O2"
fi
@@ -1350,7 +1342,7 @@ else
fi
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:1354: checking build system type" >&5
+echo "configure:1346: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -1373,7 +1365,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1377: checking for $ac_word" >&5
+echo "configure:1369: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_BUILD_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1404,7 +1396,7 @@ done
fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1408: checking how to run the C preprocessor" >&5
+echo "configure:1400: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -1419,13 +1411,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 1423 "configure"
+#line 1415 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1429: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1421: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@@ -1436,13 +1428,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 1440 "configure"
+#line 1432 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1446: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1438: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@@ -1475,7 +1467,7 @@ LD=`$CC -print-file-name=ld`
# Determine whether we are using GNU binutils.
echo $ac_n "checking whether $AS is GNU as""... $ac_c" 1>&6
-echo "configure:1479: checking whether $AS is GNU as" >&5
+echo "configure:1471: checking whether $AS is GNU as" >&5
if eval "test \"`echo '$''{'libc_cv_prog_as_gnu'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1493,7 +1485,7 @@ rm -f a.out
gnu_as=$libc_cv_prog_as_gnu
echo $ac_n "checking whether $LD is GNU ld""... $ac_c" 1>&6
-echo "configure:1497: checking whether $LD is GNU ld" >&5
+echo "configure:1489: checking whether $LD is GNU ld" >&5
if eval "test \"`echo '$''{'libc_cv_prog_ld_gnu'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1517,7 +1509,7 @@ fi
# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
set dummy ${ac_tool_prefix}ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1521: checking for $ac_word" >&5
+echo "configure:1513: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1548,7 +1540,7 @@ fi
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1552: checking for $ac_word" >&5
+echo "configure:1544: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1579,7 +1571,7 @@ if test -n "$ac_tool_prefix"; then
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1583: checking for $ac_word" >&5
+echo "configure:1575: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1614,7 +1606,7 @@ fi
# Extract the first word of "bash", so it can be a program name with args.
set dummy bash; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1618: checking for $ac_word" >&5
+echo "configure:1610: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_BASH'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1655,7 +1647,7 @@ if test "$BASH" = no; then
# Extract the first word of "ksh", so it can be a program name with args.
set dummy ksh; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1659: checking for $ac_word" >&5
+echo "configure:1651: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_KSH'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1701,7 +1693,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1705: checking for $ac_word" >&5
+echo "configure:1697: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1736,7 +1728,7 @@ test -n "$PERL" || PERL="no"
echo $ac_n "checking for signed size_t type""... $ac_c" 1>&6
-echo "configure:1740: checking for signed size_t type" >&5
+echo "configure:1732: checking for signed size_t type" >&5
if eval "test \"`echo '$''{'libc_cv_signed_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1760,12 +1752,12 @@ EOF
fi
echo $ac_n "checking for libc-friendly stddef.h""... $ac_c" 1>&6
-echo "configure:1764: checking for libc-friendly stddef.h" >&5
+echo "configure:1756: checking for libc-friendly stddef.h" >&5
if eval "test \"`echo '$''{'libc_cv_friendly_stddef'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1769 "configure"
+#line 1761 "configure"
#include "confdefs.h"
#define __need_size_t
#define __need_wchar_t
@@ -1780,7 +1772,7 @@ size_t size; wchar_t wchar;
if (&size == NULL || &wchar == NULL) abort ();
; return 0; }
EOF
-if { (eval echo configure:1784: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1776: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libc_cv_friendly_stddef=yes
else
@@ -1799,7 +1791,7 @@ override stddef.h = # The installed <stddef.h> seems to be libc-friendly."
fi
echo $ac_n "checking whether we need to use -P to assemble .S files""... $ac_c" 1>&6
-echo "configure:1803: checking whether we need to use -P to assemble .S files" >&5
+echo "configure:1795: checking whether we need to use -P to assemble .S files" >&5
if eval "test \"`echo '$''{'libc_cv_need_minus_P'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1821,8 +1813,44 @@ if test $libc_cv_need_minus_P = yes; then
asm-CPPFLAGS = -P # The assembler can't grok cpp's # line directives."
fi
+# gcc 2.7.x has a bug where if -pipe is set, the assembler will always
+# be told to read stdin. This causes the compiler to hang when fed an
+# .s file.
+if test $ac_cv_prog_gcc = yes; then
+ case `${CC-cc} -v 2>&1` in
+ *2.7*)
+ # We must check this even if -pipe is not given here, because the user
+ # might do `make CFLAGS=-pipe'.
+ echo $ac_n "checking for gcc 2.7.x -pipe bug""... $ac_c" 1>&6
+echo "configure:1826: checking for gcc 2.7.x -pipe bug" >&5
+if eval "test \"`echo '$''{'libc_cv_gcc_pipe_bug'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat >conftest.s <<EOF
+foo:
+EOF
+ if ${CC-cc} -pipe -c conftest.s <conftest.s 2>/dev/null; then
+ libc_cv_gcc_pipe_bug=no
+ else
+ libc_cv_gcc_pipe_bug=yes
+ fi
+ rm -f conftest*
+fi
+
+echo "$ac_t""$libc_cv_gcc_pipe_bug" 1>&6
+ if test $libc_cv_gcc_pipe_bug = yes; then
+ makeCC="${CC-cc} -B\$(common-objpfx)"
+ makeCFLAGS=$CFLAGS
+ CFLAGS=`echo $CFLAGS |sed 's/-pipe//'`
+ fi;;
+ *) libc_cv_gcc_pipe_bug=no;;
+ esac
+else
+ libc_cv_gcc_pipe_bug=no
+fi
+
echo $ac_n "checking for assembler global-symbol directive""... $ac_c" 1>&6
-echo "configure:1826: checking for assembler global-symbol directive" >&5
+echo "configure:1854: checking for assembler global-symbol directive" >&5
if eval "test \"`echo '$''{'libc_cv_asm_global_directive'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1852,7 +1880,7 @@ EOF
fi
echo $ac_n "checking for .set assembler directive""... $ac_c" 1>&6
-echo "configure:1856: checking for .set assembler directive" >&5
+echo "configure:1884: checking for .set assembler directive" >&5
if eval "test \"`echo '$''{'libc_cv_asm_set_directive'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1886,7 +1914,7 @@ EOF
fi
echo $ac_n "checking for .symver assembler directive""... $ac_c" 1>&6
-echo "configure:1890: checking for .symver assembler directive" >&5
+echo "configure:1918: checking for .symver assembler directive" >&5
if eval "test \"`echo '$''{'libc_cv_asm_symver_directive'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1905,7 +1933,7 @@ fi
echo "$ac_t""$libc_cv_asm_symver_directive" 1>&6
echo $ac_n "checking for ld --version-script""... $ac_c" 1>&6
-echo "configure:1909: checking for ld --version-script" >&5
+echo "configure:1937: checking for ld --version-script" >&5
if eval "test \"`echo '$''{'libc_cv_ld_version_script_option'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1924,7 +1952,7 @@ EOF
if { ac_try='${CC-cc} $CFLAGS -shared -o conftest.so conftest.o
-nostartfiles -nostdlib
-Wl,--version-script,conftest.map
- 1>&5'; { (eval echo configure:1928: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; };
+ 1>&5'; { (eval echo configure:1956: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; };
then
libc_cv_ld_version_script_option=yes
else
@@ -1955,7 +1983,7 @@ fi
if test $elf = yes; then
echo $ac_n "checking for .previous assembler directive""... $ac_c" 1>&6
-echo "configure:1959: checking for .previous assembler directive" >&5
+echo "configure:1987: checking for .previous assembler directive" >&5
if eval "test \"`echo '$''{'libc_cv_asm_previous_directive'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1963,7 +1991,7 @@ else
.section foo_section
.previous
EOF
- if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:1967: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:1995: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
libc_cv_asm_previous_directive=yes
else
libc_cv_asm_previous_directive=no
@@ -1979,7 +2007,7 @@ EOF
else
echo $ac_n "checking for .popsection assembler directive""... $ac_c" 1>&6
-echo "configure:1983: checking for .popsection assembler directive" >&5
+echo "configure:2011: checking for .popsection assembler directive" >&5
if eval "test \"`echo '$''{'libc_cv_asm_popsection_directive'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1987,7 +2015,7 @@ else
.pushsection foo_section
.popsection
EOF
- if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:1991: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:2019: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
libc_cv_asm_popsection_directive=yes
else
libc_cv_asm_popsection_directive=no
@@ -2007,12 +2035,12 @@ fi
if test $elf != yes; then
echo $ac_n "checking for .init and .fini sections""... $ac_c" 1>&6
-echo "configure:2011: checking for .init and .fini sections" >&5
+echo "configure:2039: checking for .init and .fini sections" >&5
if eval "test \"`echo '$''{'libc_cv_have_initfini'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2016 "configure"
+#line 2044 "configure"
#include "confdefs.h"
int main() {
@@ -2021,7 +2049,7 @@ asm (".section .init");
asm (".text");
; return 0; }
EOF
-if { (eval echo configure:2025: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2053: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libc_cv_have_initfini=yes
else
@@ -2049,19 +2077,19 @@ if test $elf = yes; then
else
if test $ac_cv_prog_cc_works = yes; then
echo $ac_n "checking for _ prefix on C symbol names""... $ac_c" 1>&6
-echo "configure:2053: checking for _ prefix on C symbol names" >&5
+echo "configure:2081: checking for _ prefix on C symbol names" >&5
if eval "test \"`echo '$''{'libc_cv_asm_underscores'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2058 "configure"
+#line 2086 "configure"
#include "confdefs.h"
asm ("_glibc_foobar:");
int main() {
glibc_foobar ();
; return 0; }
EOF
-if { (eval echo configure:2065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
libc_cv_asm_underscores=yes
else
@@ -2076,17 +2104,17 @@ fi
echo "$ac_t""$libc_cv_asm_underscores" 1>&6
else
echo $ac_n "checking for _ prefix on C symbol names""... $ac_c" 1>&6
-echo "configure:2080: checking for _ prefix on C symbol names" >&5
+echo "configure:2108: checking for _ prefix on C symbol names" >&5
if eval "test \"`echo '$''{'libc_cv_asm_underscores'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2085 "configure"
+#line 2113 "configure"
#include "confdefs.h"
void underscore_test(void) {
return; }
EOF
-if { (eval echo configure:2090: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2118: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if grep _underscore_test conftest* >/dev/null; then
rm -f conftest*
libc_cv_asm_underscores=yes
@@ -2119,7 +2147,7 @@ if test $elf = yes; then
libc_cv_asm_weakext_directive=no
else
echo $ac_n "checking for assembler .weak directive""... $ac_c" 1>&6
-echo "configure:2123: checking for assembler .weak directive" >&5
+echo "configure:2151: checking for assembler .weak directive" >&5
if eval "test \"`echo '$''{'libc_cv_asm_weak_directive'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2142,7 +2170,7 @@ echo "$ac_t""$libc_cv_asm_weak_directive" 1>&6
if test $libc_cv_asm_weak_directive = no; then
echo $ac_n "checking for assembler .weakext directive""... $ac_c" 1>&6
-echo "configure:2146: checking for assembler .weakext directive" >&5
+echo "configure:2174: checking for assembler .weakext directive" >&5
if eval "test \"`echo '$''{'libc_cv_asm_weakext_directive'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2179,7 +2207,7 @@ EOF
fi
echo $ac_n "checking for ld --no-whole-archive""... $ac_c" 1>&6
-echo "configure:2183: checking for ld --no-whole-archive" >&5
+echo "configure:2211: checking for ld --no-whole-archive" >&5
if eval "test \"`echo '$''{'libc_cv_ld_no_whole_archive'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2190,7 +2218,7 @@ __throw () {}
EOF
if { ac_try='${CC-cc} $CFLAGS
-nostdlib -nostartfiles -Wl,--no-whole-archive
- -o conftest conftest.c 1>&5'; { (eval echo configure:2194: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ -o conftest conftest.c 1>&5'; { (eval echo configure:2222: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
libc_cv_ld_no_whole_archive=yes
else
libc_cv_ld_no_whole_archive=no
@@ -2201,7 +2229,7 @@ fi
echo "$ac_t""$libc_cv_ld_no_whole_archive" 1>&6
echo $ac_n "checking for gcc -fno-exceptions""... $ac_c" 1>&6
-echo "configure:2205: checking for gcc -fno-exceptions" >&5
+echo "configure:2233: checking for gcc -fno-exceptions" >&5
if eval "test \"`echo '$''{'libc_cv_gcc_no_exceptions'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2212,7 +2240,7 @@ __throw () {}
EOF
if { ac_try='${CC-cc} $CFLAGS
-nostdlib -nostartfiles -fno-exceptions
- -o conftest conftest.c 1>&5'; { (eval echo configure:2216: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ -o conftest conftest.c 1>&5'; { (eval echo configure:2244: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
libc_cv_gcc_no_exceptions=yes
else
libc_cv_gcc_no_exceptions=no
@@ -2223,12 +2251,12 @@ fi
echo "$ac_t""$libc_cv_gcc_no_exceptions" 1>&6
echo $ac_n "checking for DWARF2 unwind info support""... $ac_c" 1>&6
-echo "configure:2227: checking for DWARF2 unwind info support" >&5
+echo "configure:2255: checking for DWARF2 unwind info support" >&5
if eval "test \"`echo '$''{'libc_cv_gcc_dwarf2_unwind_info'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.c <<EOF
-#line 2232 "configure"
+#line 2260 "configure"
static char __EH_FRAME_BEGIN__;
_start ()
{
@@ -2249,7 +2277,7 @@ __bzero () {}
EOF
if { ac_try='${CC-cc} $CFLAGS
-nostdlib -nostartfiles
- -o conftest conftest.c -lgcc >&5'; { (eval echo configure:2253: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ -o conftest conftest.c -lgcc >&5'; { (eval echo configure:2281: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
libc_cv_gcc_dwarf2_unwind_info=yes
else
libc_cv_gcc_dwarf2_unwind_info=no
@@ -2307,7 +2335,7 @@ if test "$uname" = "sysdeps/generic"; then
fi
echo $ac_n "checking OS release for uname""... $ac_c" 1>&6
-echo "configure:2311: checking OS release for uname" >&5
+echo "configure:2339: checking OS release for uname" >&5
if eval "test \"`echo '$''{'libc_cv_uname_release'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2329,7 +2357,7 @@ echo "$ac_t""$libc_cv_uname_release" 1>&6
uname_release="$libc_cv_uname_release"
echo $ac_n "checking OS version for uname""... $ac_c" 1>&6
-echo "configure:2333: checking OS version for uname" >&5
+echo "configure:2361: checking OS version for uname" >&5
if eval "test \"`echo '$''{'libc_cv_uname_version'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2351,7 +2379,7 @@ else
fi
echo $ac_n "checking stdio selection""... $ac_c" 1>&6
-echo "configure:2355: checking stdio selection" >&5
+echo "configure:2383: checking stdio selection" >&5
case $stdio in
libio) cat >> confdefs.h <<\EOF
@@ -2363,7 +2391,7 @@ esac
echo "$ac_t""$stdio" 1>&6
echo $ac_n "checking ldap selection""... $ac_c" 1>&6
-echo "configure:2367: checking ldap selection" >&5
+echo "configure:2395: checking ldap selection" >&5
case $add_ons in
*ldap*)
@@ -2428,6 +2456,21 @@ fi
VERSION=`sed -e 's/^#define VERSION "\([^"]*\)"/\1/p' -e d < $srcdir/version.h`
+if test $libc_cv_gcc_pipe_bug = yes; then
+ realCC=$CC
+ CC=$makeCC
+ CFLAGS=$makeCFLAGS
+fi
+ if test -r /vmunix; then
+ kernel_id=`strings /vmunix | grep UNIX`
+ elif test -r /dynix; then
+ kernel_id=`strings /dynix | grep DYNIX`
+ else
+ kernel_id=
+ fi
+
+
+
trap '' 1 2 15
cat > confcache <<\EOF
# This file is a shell script that caches the results of configure
@@ -2867,10 +2910,16 @@ while test -n "$ac_sources"; do
done
EOF
cat >> $CONFIG_STATUS <<EOF
+realCC=$realCC
echo '$config_vars' >> config.make; test -d bits || mkdir bits
EOF
cat >> $CONFIG_STATUS <<\EOF
+if test "$realCC"; then
+ sed -e 's/%{pipe:-}/%|/g' `$realCC -print-file-name=specs` >specsT
+ mv specsT specs
+fi
+
exit 0
EOF
chmod +x $CONFIG_STATUS
diff --git a/configure.in b/configure.in
index 3f810bd1a8..d0659bf478 100644
--- a/configure.in
+++ b/configure.in
@@ -500,6 +500,35 @@ if test $libc_cv_need_minus_P = yes; then
asm-CPPFLAGS = -P # The assembler can't grok cpp's # line directives."
fi
+# gcc 2.7.x has a bug where if -pipe is set, the assembler will always
+# be told to read stdin. This causes the compiler to hang when fed an
+# .s file.
+if test $ac_cv_prog_gcc = yes; then
+ case `${CC-cc} -v 2>&1` in
+ *2.7*)
+ # We must check this even if -pipe is not given here, because the user
+ # might do `make CFLAGS=-pipe'.
+ AC_CACHE_CHECK(for gcc 2.7.x -pipe bug, libc_cv_gcc_pipe_bug, [dnl
+ cat >conftest.s <<EOF
+foo:
+EOF
+ if ${CC-cc} -pipe -c conftest.s <conftest.s 2>/dev/null; then
+ libc_cv_gcc_pipe_bug=no
+ else
+ libc_cv_gcc_pipe_bug=yes
+ fi
+ rm -f conftest*])
+ if test $libc_cv_gcc_pipe_bug = yes; then
+ makeCC="${CC-cc} -B\$(common-objpfx)"
+ makeCFLAGS=$CFLAGS
+ CFLAGS=`echo $CFLAGS |sed 's/-pipe//'`
+ fi;;
+ *) libc_cv_gcc_pipe_bug=no;;
+ esac
+else
+ libc_cv_gcc_pipe_bug=no
+fi
+
AC_CACHE_CHECK(for assembler global-symbol directive,
libc_cv_asm_global_directive, [dnl
libc_cv_asm_global_directive=UNKNOWN
@@ -958,5 +987,16 @@ fi
VERSION=`sed -e 's/^#define VERSION "\([^"]*\)"/\1/p' -e d < $srcdir/version.h`
AC_SUBST(VERSION)
+if test $libc_cv_gcc_pipe_bug = yes; then
+ realCC=$CC
+ CC=$makeCC
+ CFLAGS=$makeCFLAGS
+fi
+AC_OUTPUT_COMMANDS([
+if test "$realCC"; then
+ sed -e 's/%{pipe:-}/%|/g' `$realCC -print-file-name=specs` >specsT
+ mv specsT specs
+fi], [realCC=$realCC])
+
AC_OUTPUT(config.make glibcbug ${config_makefile} ${config_uname}, ,
[echo '$config_vars' >> config.make; test -d bits || mkdir bits])
diff --git a/ctype/Makefile b/ctype/Makefile
index a17ce2c445..8907db8eab 100644
--- a/ctype/Makefile
+++ b/ctype/Makefile
@@ -20,6 +20,7 @@
# Sub-makefile for ctype portion of the library.
#
subdir := ctype
+headers := ctype.h
routines := ctype ctype-extn ctype_l
aux := ctype-info
diff --git a/elf/dl-error.c b/elf/dl-error.c
index 72af85985d..5e76d7d7d8 100644
--- a/elf/dl-error.c
+++ b/elf/dl-error.c
@@ -23,6 +23,9 @@
#include <stdlib.h>
#include <string.h>
+/* This is the internal function we use to generate the error string. */
+extern char *_strerror_internal __P ((int, char *, size_t));
+
/* This structure communicates state between _dl_catch_error and
_dl_signal_error. */
struct catch
@@ -74,11 +77,14 @@ _dl_signal_error (int errcode,
{
/* Lossage while resolving the program's own symbols is always fatal. */
extern char **_dl_argv; /* Set in rtld.c at startup. */
+ char buffer[1024];
_dl_sysdep_fatal (_dl_argv[0] ?: "<program name unknown>",
": error in loading shared libraries: ",
objname ?: "", objname ? ": " : "",
errstring, errcode ? ": " : "",
- errcode ? strerror (errcode) : "", "\n", NULL);
+ (errcode
+ ? _strerror_internal (errcode, buffer, sizeof buffer)
+ : ""), "\n", NULL);
}
}
@@ -93,7 +99,7 @@ _dl_catch_error (char **errstring,
/* We need not handle `receiver' since setting a `catch' is handled
before it. */
- /* Some systems (.e.g, SPARC) handle constructors to local variables
+ /* Some systems (e.g., SPARC) handle constructors to local variables
inefficient. So we initialize `c' by hand. */
c.errstring = NULL;
c.objname = NULL;
diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
index 2ec7e3a446..ef344794c5 100644
--- a/elf/dl-lookup.c
+++ b/elf/dl-lookup.c
@@ -279,6 +279,7 @@ _dl_lookup_versioned_symbol (const char *undef_name, const ElfW(Sym) **ref,
const struct r_found_version *version,
int reloc_type)
{
+ extern char **_dl_argv;
const unsigned long int hash = _dl_elf_hash (undef_name);
struct sym_val current_value = { 0, NULL };
struct link_map **scope;
@@ -295,7 +296,9 @@ _dl_lookup_versioned_symbol (const char *undef_name, const ElfW(Sym) **ref,
if (res < 0)
/* Oh, oh. The file named in the relocation entry does not
contain the needed symbol. */
- _dl_signal_error (0, reference_name,
+ _dl_signal_error (0, (*reference_name
+ ? reference_name
+ : (_dl_argv[0] ?: "<main program>")),
make_string ("symbol ", undef_name, ", version ",
version->name,
" not defined in file ",
diff --git a/elf/rtld.c b/elf/rtld.c
index 48d8575c89..b1538aa893 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -395,8 +395,7 @@ of this helper program; chances are you did not intend to run this program.\n",
{
/* Create a link_map for the executable itself.
This will be what dlopen on "" returns. */
- main_map = _dl_new_object (_dl_argv[0] ?: (char *) "<main program>",
- "", lt_executable);
+ main_map = _dl_new_object ((char *) "", "", lt_executable);
if (main_map == NULL)
_dl_sysdep_fatal ("cannot allocate memory for link map\n", NULL);
main_map->l_phdr = phdr;
diff --git a/glibcbug.in b/glibcbug.in
index 1d7eed7604..69496b6e1a 100644
--- a/glibcbug.in
+++ b/glibcbug.in
@@ -8,6 +8,7 @@
VERSION="@VERSION@"
BUGGLIBC="bugs@gnu.org"
ADDONS="@subdirs@"
+HOST="@host@"
PATH=/bin:/usr/bin:/usr/local/bin:$PATH
export PATH
@@ -119,6 +120,7 @@ ${ORGANIZATION- $ORGANIZATION_C}
>Release: libc-${VERSION}
>Environment:
$ENVIRONMENT_C
+`[ -n "$HOST" ] && echo Host type: $HOST`
`[ -n "$SYSTEM" ] && echo System: $SYSTEM`
`[ -n "$ARCH" ] && echo Architecture: $ARCH`
`[ -n "$MACHINE" ] && echo Machine: $MACHINE`
diff --git a/grp/Makefile b/grp/Makefile
index 20b58fb08c..8c63a4c65e 100644
--- a/grp/Makefile
+++ b/grp/Makefile
@@ -20,6 +20,7 @@
# Sub-makefile for grp portion of the library.
#
subdir := grp
+headers := grp.h
routines := fgetgrent initgroups setgroups \
getgrent getgrgid getgrnam \
diff --git a/intl/localealias.c b/intl/localealias.c
index 05832f0e36..58ed2708ae 100644
--- a/intl/localealias.c
+++ b/intl/localealias.c
@@ -84,6 +84,9 @@ void free ();
# define strcasecmp __strcasecmp
# define strdup __strdup
+# define mempcpy __mempcpy
+# define HAVE_MEMPCPY 1
+
/* We need locking here since we can be called from different palces. */
# include <bits/libc-lock.h>
@@ -231,8 +234,13 @@ read_alias_file (fname, fname_len)
full_fname = (char *) alloca (fname_len + sizeof aliasfile);
ADD_BLOCK (block_list, full_fname);
+#ifdef HAVE_MEMPCPY
+ mempcpy (mempcpy (full_fname, fname, fname_len),
+ aliasfile, sizeof aliasfile);
+#else
memcpy (full_fname, fname, fname_len);
memcpy (&full_fname[fname_len], aliasfile, sizeof aliasfile);
+#endif
fp = fopen (full_fname, "r");
if (fp == NULL)
@@ -254,10 +262,23 @@ read_alias_file (fname, fname_len)
char *value;
char *cp;
- if (fgets (buf, BUFSIZ, fp) == NULL)
+ if (fgets (buf, sizeof buf, fp) == NULL)
/* EOF reached. */
break;
+ /* Possibly not the whole line fits into the buffer. Ignore
+ the rest of the line. */
+ if (strchr (buf, '\n') == NULL)
+ {
+ char altbuf[BUFSIZ];
+ do
+ if (fgets (altbuf, sizeof altbuf, fp) == NULL)
+ /* Make sure the inner loop will be left. The outer loop
+ will exit at the `feof' test. */
+ break;
+ while (strchr (altbuf, '\n') == NULL);
+ }
+
cp = buf;
/* Ignore leading white space. */
while (isspace (cp[0]))
@@ -324,7 +345,7 @@ read_alias_file (fname, fname_len)
alias, alias_len);
string_space_act += alias_len;
- map[nmap].alias = memcpy (&string_space[string_space_act],
+ map[nmap].value = memcpy (&string_space[string_space_act],
value, value_len);
string_space_act += value_len;
@@ -332,17 +353,6 @@ read_alias_file (fname, fname_len)
++added;
}
}
-
- /* Possibly not the whole line fits into the buffer. Ignore
- the rest of the line. */
- while (strchr (cp, '\n') == NULL)
- {
- cp = buf;
- if (fgets (buf, BUFSIZ, fp) == NULL)
- /* Make sure the inner loop will be left. The outer loop
- will exit at the `feof' test. */
- *cp = '\n';
- }
}
/* Should we test for ferror()? I think we have to silently ignore
diff --git a/libc.map b/libc.map
index 57ac588ae3..d77be20439 100644
--- a/libc.map
+++ b/libc.map
@@ -86,7 +86,7 @@ GLIBC_2.0 {
_IO_seekmark; _IO_unsave_markers; _IO_str_overflow;
_IO_str_underflow; _IO_str_init_static; _IO_str_init_readonly;
_IO_str_seekoff; _IO_str_pbackfail; _IO_file_jumps;
- _IO_peekc_locked;
+ _IO_peekc_locked; _IO_flockfile; _IO_funlockfile;
__vsscanf; __vfscanf; __vsnprintf;
_rpc_dtablesize; _null_auth; _seterr_reply;
__res_randomid;
diff --git a/manual/creature.texi b/manual/creature.texi
index 03f79ede96..1efd1f5a7d 100644
--- a/manual/creature.texi
+++ b/manual/creature.texi
@@ -25,17 +25,36 @@ self-contained way.
If you define this macro, then the functionality from the POSIX.1
standard (IEEE Standard 1003.1) is available, as well as all of the
@w{ISO C} facilities.
+
+The state of @code{_POSIX_SOURCE} is irrelevant if you define the
+macro @code{_POSIX_C_SOURCE} to a positive integer.
@end defvr
@comment (none)
@comment POSIX.2
-@defvr Macro _POSIX_C_SOURCE
-If you define this macro with a value of @code{1}, then the
-functionality from the POSIX.1 standard (IEEE Standard 1003.1) is made
-available. If you define this macro with a value of @code{2}, then both
-the functionality from the POSIX.1 standard and the functionality from
-the POSIX.2 standard (IEEE Standard 1003.2) are made available. This is
-in addition to the @w{ISO C} facilities.
+Define this macro to a positive integer to control which POSIX
+functionality is made available. The greater the value of this macro,
+the more functionality is made available.
+
+If you define this macro to a value greater than or equal to @code{1},
+then the functionality from the 1990 edition of the POSIX.1 standard
+(IEEE Standard 1003.1-1990) is made available.
+
+If you define this macro to a value greater than or equal to @code{2},
+then the functionality from the 1992 edition of the POSIX.2 standard
+(IEEE Standard 1003.2-1992) is made available.
+
+If you define this macro to a value greater than or equal to @code{199309L},
+then the functionality from the 1993 edition of the POSIX.1b standard
+(IEEE Standard 1003.1b-1993) is made available.
+
+Greater values for @code{_POSIX_C_SOURCE} will enable future extensions.
+The POSIX standards process will define these values as necessary, and
+the GNU C Library should support them some time after they become standardized.
+The 1996 edition of POSIX.1 (ISO/IEC 9945-1: 1996) states that
+if you define @code{_POSIX_C_SOURCE} to a value greater than
+or equal to @code{199506L}, then the functionality from the 1996
+edition is made available.
The Single Unix Specification specify that setting this macro to the
value @code{199506L} selects all the values specified by the POSIX
diff --git a/manual/filesys.texi b/manual/filesys.texi
index c33bad892e..2921a53111 100644
--- a/manual/filesys.texi
+++ b/manual/filesys.texi
@@ -351,8 +351,8 @@ The return value is @code{0} in case the next entry was read
successfully. In this case a pointer to the result is returned in
*@var{result}. It is not required that *@var{result} is the same as
@var{entry}. If something goes wrong while executing @code{readdir_r}
-the function returns @code{-1}. The @code{errno} variable is set like
-described for @code{readdir}.
+the function returns a value indicating the error (as described for
+@code{readdir}).
@strong{Portability Note:} On some systems, @code{readdir_r} may not
return a terminated string as the file name even if no @code{d_reclen}
diff --git a/pwd/Makefile b/pwd/Makefile
index 337263246b..6b3eeab61a 100644
--- a/pwd/Makefile
+++ b/pwd/Makefile
@@ -20,6 +20,7 @@
# Sub-makefile for pwd portion of the library.
#
subdir := pwd
+headers := pwd.h
routines := fgetpwent getpw putpwent \
getpwent getpwnam getpwuid \
diff --git a/stdlib/strfmon.c b/stdlib/strfmon.c
index c956ae3040..4f8b5b70af 100644
--- a/stdlib/strfmon.c
+++ b/stdlib/strfmon.c
@@ -204,7 +204,8 @@ __strfmon_l (char *s, size_t maxsize, __locale_t loc, const char *format, ...)
va_end (ap);
return -1;
}
- n_sign_posn = 5; /* This is a else unused value. */
+ p_sign_posn = 0;
+ n_sign_posn = 0;
continue;
case '!': /* Don't print the currency symbol. */
print_curr_symbol = 0;
@@ -218,6 +219,13 @@ __strfmon_l (char *s, size_t maxsize, __locale_t loc, const char *format, ...)
break;
}
+ /* If not specified by the format string now find the values for
+ the format specification. */
+ if (p_sign_posn == -1)
+ p_sign_posn = *_NL_CURRENT (LC_MONETARY, P_SIGN_POSN);
+ if (n_sign_posn == -1)
+ n_sign_posn = *_NL_CURRENT (LC_MONETARY, N_SIGN_POSN);
+
if (isdigit (*fmt))
{
/* Parse field width. */
@@ -341,13 +349,7 @@ __strfmon_l (char *s, size_t maxsize, __locale_t loc, const char *format, ...)
sign_char = '-';
cs_precedes = *_NL_CURRENT (LC_MONETARY, N_CS_PRECEDES);
sep_by_space = *_NL_CURRENT (LC_MONETARY, N_SEP_BY_SPACE);
- /* If the '(' flag is not given use the sign position from
- the current locale. */
- if (n_sign_posn == -1)
- sign_posn = *_NL_CURRENT (LC_MONETARY, N_SIGN_POSN);
- else
- /* This means use parentheses. */
- sign_posn = 0;
+ sign_posn = n_sign_posn;
}
else
{
@@ -358,13 +360,7 @@ __strfmon_l (char *s, size_t maxsize, __locale_t loc, const char *format, ...)
sign_char = ' ';
cs_precedes = *_NL_CURRENT (LC_MONETARY, P_CS_PRECEDES);
sep_by_space = *_NL_CURRENT (LC_MONETARY, P_SEP_BY_SPACE);
- if (n_sign_posn == -1)
- sign_posn = *_NL_CURRENT (LC_MONETARY, P_SIGN_POSN);
- else
- /* Here we don't set SIGN_POSN to 0 because we don'want to
- print <SP> instead of the braces and this is what the
- value 5 means. */
- sign_posn = 5;
+ sign_posn = p_sign_posn;
}
/* Set default values for unspecified information. */
@@ -384,9 +380,7 @@ __strfmon_l (char *s, size_t maxsize, __locale_t loc, const char *format, ...)
startp = dest; /* Remember start so we can compute length. */
if (sign_posn == 0)
- out_char (left_paren);
- if (sign_posn == 5) /* This is for positive number and ( flag. */
- out_char (' ');
+ out_char (is_negative ? left_paren : ' ');
if (cs_precedes)
{
@@ -495,9 +489,7 @@ __strfmon_l (char *s, size_t maxsize, __locale_t loc, const char *format, ...)
}
if (sign_posn == 0)
- out_char (right_paren);
- if (sign_posn == 5)
- out_char (' '); /* This is for positive number and ( flag. */
+ out_char (is_negative ? right_paren : ' ');
/* Now test whether the output width is filled. */
if (dest - startp < width)
diff --git a/sysdeps/generic/bits/errno.h b/sysdeps/generic/bits/errno.h
index cb61da7836..622c2c9de4 100644
--- a/sysdeps/generic/bits/errno.h
+++ b/sysdeps/generic/bits/errno.h
@@ -22,20 +22,15 @@
#undef __need_Emath
#define __Emath_defined 1
-# define EDOM 1
-# define ERANGE 2
+# define EDOM XXX <--- fill in what is actually needed
+# define ERANGE XXX <--- fill in what is actually needed
#endif
#ifdef _ERRNO_H
-# define ENOSYS 3
-# define EINVAL 4
-# define ESPIPE 5
-# define EBADF 6
-# define ENOMEM 7
-# define EACCES 8
-# define ENFILE 9
-# define EMFILE 10
-# define ENOMSG 11
+# error "Define here all the missing error messages for the port. These"
+# error "must match the numbers of the kernel."
+# define Exxxx XXX
+...
#endif
#define __set_errno(val) errno = (val)
diff --git a/sysdeps/generic/make_siglist.c b/sysdeps/generic/make_siglist.c
index b670baf434..2cfd4988dd 100644
--- a/sysdeps/generic/make_siglist.c
+++ b/sysdeps/generic/make_siglist.c
@@ -17,6 +17,11 @@
Boston, MA 02111-1307, USA. */
#include <stdio.h>
+
+/* Include signal.h now so that we can safely reinclude it again in
+ signame.c later on. We completely override the definitions, we
+ just have to be sure that the include guard in signal.h keeps it
+ from redefining the signal values. */
#include <signal.h>
/* Get this configuration's defns of the signal numbers. */
@@ -32,6 +37,9 @@
#define HAVE_PSIGNAL
#define sys_siglist my_siglist /* Avoid clash with signal.h. */
+#undef NSIG
+#define NSIG _NSIG /* make sure that the value from SIGNUM_H is used. */
+
#include "signame.c"
diff --git a/sysdeps/generic/readdir_r.c b/sysdeps/generic/readdir_r.c
index ae14d18160..41bf87fca2 100644
--- a/sysdeps/generic/readdir_r.c
+++ b/sysdeps/generic/readdir_r.c
@@ -27,7 +27,7 @@ __readdir_r (DIR *dirp, struct dirent *entry, struct dirent **result)
{
__set_errno (ENOSYS);
*result = NULL;
- return -1;
+ return ENOSYS;
}
weak_alias (__readdir_r, readdir_r)
diff --git a/sysdeps/standalone/bits/errno.h b/sysdeps/standalone/bits/errno.h
new file mode 100644
index 0000000000..30eec4308d
--- /dev/null
+++ b/sysdeps/standalone/bits/errno.h
@@ -0,0 +1,62 @@
+/* Copyright (C) 1991, 1994, 1996, 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. */
+
+/* This file defines the `errno' constants. */
+
+#if !defined __Emath_defined && (defined _ERRNO_H || defined __need_Emath)
+#undef __need_Emath
+#define __Emath_defined 1
+
+# define EDOM 1
+# define ERANGE 2
+#endif
+
+#ifdef _ERRNO_H
+# define ENOSYS 3
+# define EINVAL 4
+# define ESPIPE 5
+# define EBADF 6
+# define ENOMEM 7
+# define EACCES 8
+# define ENFILE 9
+# define EMFILE 10
+# define ENOMSG 11
+# define ENAMETOOLONG 12
+# define ELOOP 13
+# define ENOMSG 14
+# define E2BIG 15
+# define EINTR 16
+# define EILSEQ 17
+# define ENOEXEC 18
+# define ENOENT 19
+# define EPROTOTYPE 20
+# define ESRCH 21
+# define EPERM 22
+# define EEXIST 23
+# define ENOTDIR 24
+# define ESTALE 25
+# define ENOTTY 26
+# define EISDIR 27
+# define EOPNOTSUPP 28
+# define EAGAIN 29
+# define EIO 30
+# define ENOSPC 31
+# define EBUSY 32
+#endif
+
+#define __set_errno(val) errno = (val)
diff --git a/sysdeps/unix/readdir_r.c b/sysdeps/unix/readdir_r.c
index fa26db6381..a4462f73e7 100644
--- a/sysdeps/unix/readdir_r.c
+++ b/sysdeps/unix/readdir_r.c
@@ -103,6 +103,6 @@ __readdir_r (DIR *dirp, struct dirent *entry, struct dirent **result)
__libc_lock_unlock (dirp->lock);
- return dp != NULL ? 0 : -1;
+ return dp != NULL ? 0 : errno;
}
weak_alias (__readdir_r, readdir_r)
diff --git a/sysdeps/unix/sysv/linux/alpha/Dist b/sysdeps/unix/sysv/linux/alpha/Dist
index ebbf300eac..715fda7bd3 100644
--- a/sysdeps/unix/sysv/linux/alpha/Dist
+++ b/sysdeps/unix/sysv/linux/alpha/Dist
@@ -12,4 +12,4 @@ kernel_termios.h
sys/acct.h
sys/io.h
sys/procfs.h
-xstatconv.c \ No newline at end of file
+xstatconv.c
diff --git a/time/strftime.c b/time/strftime.c
index 1da36e12d6..fdf0500a92 100644
--- a/time/strftime.c
+++ b/time/strftime.c
@@ -275,7 +275,7 @@ memcpy_lowcase (dest, src, len)
size_t len;
{
while (len-- > 0)
- dest[len] = TOLOWER (src[len]);
+ dest[len] = TOLOWER ((unsigned char) src[len]);
return dest;
}
@@ -288,7 +288,7 @@ memcpy_uppcase (dest, src, len)
size_t len;
{
while (len-- > 0)
- dest[len] = TOUPPER (src[len]);
+ dest[len] = TOUPPER ((unsigned char) src[len]);
return dest;
}
@@ -348,7 +348,7 @@ iso_week_days (yday, wday)
}
-#ifndef _NL_CURRENT
+#if !(defined _NL_CURRENT || HAVE_STRFTIME)
static char const weekday_name[][10] =
{
"Sunday", "Monday", "Tuesday", "Wednesday",
@@ -362,13 +362,27 @@ static char const month_name[][10] =
#endif
+#ifdef emacs
+# define my_strftime emacs_strftime
+ /* Emacs 20.2 uses `-Dstrftime=emacs_strftime' when compiling,
+ because that's how strftime used to be configured.
+ Undo this, since it gets in the way of accessing the underlying strftime,
+ which is needed for things like %Ec in Solaris.
+ The following two lines can be removed once Emacs stops compiling with
+ `-Dstrftime=emacs_strftime'. */
+# undef strftime
+size_t strftime __P ((char *, size_t, const char *, const struct tm *));
+#else
+# define my_strftime strftime
+#endif
+
#if !defined _LIBC && HAVE_TZNAME && HAVE_TZSET
/* Solaris 2.5 tzset sometimes modifies the storage returned by localtime.
Work around this bug by copying *tp before it might be munged. */
size_t _strftime_copytm __P ((char *, size_t, const char *,
const struct tm *));
size_t
- strftime (s, maxsize, format, tp)
+ my_strftime (s, maxsize, format, tp)
char *s;
size_t maxsize;
const char *format;
@@ -378,10 +392,8 @@ static char const month_name[][10] =
tmcopy = *tp;
return _strftime_copytm (s, maxsize, format, &tmcopy);
}
-# ifdef strftime
-# undef strftime
-# endif
-# define strftime(S, Maxsize, Format, Tp) \
+# undef my_strftime
+# define my_strftime(S, Maxsize, Format, Tp) \
_strftime_copytm (S, Maxsize, Format, Tp)
#endif
@@ -393,7 +405,7 @@ static char const month_name[][10] =
anywhere, so to determine how many characters would be
written, use NULL for S and (size_t) UINT_MAX for MAXSIZE. */
size_t
-strftime (s, maxsize, format, tp)
+my_strftime (s, maxsize, format, tp)
char *s;
size_t maxsize;
const char *format;
@@ -411,6 +423,7 @@ strftime (s, maxsize, format, tp)
size_t am_len = strlen (a_month);
size_t ap_len = strlen (ampm);
#else
+# if !HAVE_STRFTIME
const char *const f_wkday = weekday_name[tp->tm_wday];
const char *const f_month = month_name[tp->tm_mon];
const char *const a_wkday = f_wkday;
@@ -419,9 +432,12 @@ strftime (s, maxsize, format, tp)
size_t aw_len = 3;
size_t am_len = 3;
size_t ap_len = 2;
+# endif
#endif
+#if defined _NL_CURRENT || !HAVE_STRFTIME
size_t wkday_len = strlen (f_wkday);
size_t month_len = strlen (f_month);
+#endif
const char *zone;
size_t zonelen;
size_t i = 0;
@@ -475,6 +491,7 @@ strftime (s, maxsize, format, tp)
int to_lowcase = 0;
int to_uppcase = 0;
int change_case = 0;
+ int format_char;
#if DO_MULTIBYTE
@@ -603,7 +620,8 @@ strftime (s, maxsize, format, tp)
}
/* Now do the specified format. */
- switch (*f)
+ format_char = *f;
+ switch (format_char)
{
#define DO_NUMBER(d, v) \
digits = width == -1 ? d : width; \
@@ -626,8 +644,12 @@ strftime (s, maxsize, format, tp)
to_uppcase = 1;
to_lowcase = 0;
}
+#if defined _NL_CURRENT || !HAVE_STRFTIME
cpy (aw_len, a_wkday);
break;
+#else
+ goto underlying_strftime;
+#endif
case 'A':
if (modifier != 0)
@@ -637,15 +659,23 @@ strftime (s, maxsize, format, tp)
to_uppcase = 1;
to_lowcase = 0;
}
+#if defined _NL_CURRENT || !HAVE_STRFTIME
cpy (wkday_len, f_wkday);
break;
+#else
+ goto underlying_strftime;
+#endif
case 'b':
case 'h': /* POSIX.2 extension. */
if (modifier != 0)
goto bad_format;
+#if defined _NL_CURRENT || !HAVE_STRFTIME
cpy (am_len, a_month);
break;
+#else
+ goto underlying_strftime;
+#endif
case 'B':
if (modifier != 0)
@@ -655,8 +685,12 @@ strftime (s, maxsize, format, tp)
to_uppcase = 1;
to_lowcase = 0;
}
+#if defined _NL_CURRENT || !HAVE_STRFTIME
cpy (month_len, f_month);
break;
+#else
+ goto underlying_strftime;
+#endif
case 'c':
if (modifier == 'O')
@@ -666,32 +700,58 @@ strftime (s, maxsize, format, tp)
&& *(subfmt = _NL_CURRENT (LC_TIME, ERA_D_T_FMT)) != '\0'))
subfmt = _NL_CURRENT (LC_TIME, D_T_FMT);
#else
+# if HAVE_STRFTIME
+ goto underlying_strftime;
+# else
subfmt = "%a %b %e %H:%M:%S %Y";
+# endif
#endif
subformat:
{
char *old_start = p;
- size_t len = strftime (NULL, maxsize - i, subfmt, tp);
+ size_t len = my_strftime (NULL, maxsize - i, subfmt, tp);
if (len == 0 && *subfmt)
return 0;
- add (len, strftime (p, maxsize - i, subfmt, tp));
+ add (len, my_strftime (p, maxsize - i, subfmt, tp));
if (to_uppcase)
while (old_start < p)
{
- *old_start = TOUPPER (*old_start);
+ *old_start = TOUPPER ((unsigned char) *old_start);
++old_start;
}
}
break;
+#if HAVE_STRFTIME && ! (defined _NL_CURRENT && HAVE_STRUCT_ERA_ENTRY)
+ underlying_strftime:
+ {
+ /* The relevant information is available only via the
+ underlying strftime implementation, so use that. */
+ char ufmt[4];
+ char *u = ufmt;
+ char ubuf[1024]; /* enough for any single format in practice */
+ size_t len;
+ *u++ = '%';
+ if (modifier != 0)
+ *u++ = modifier;
+ *u++ = format_char;
+ *u = '\0';
+ len = strftime (ubuf, sizeof ubuf, ufmt, tp);
+ if (len == 0)
+ return 0;
+ cpy (len, ubuf);
+ }
+ break;
+#endif
+
case 'C': /* POSIX.2 extension. */
if (modifier == 'O')
goto bad_format;
-#if HAVE_STRUCT_ERA_ENTRY
if (modifier == 'E')
{
+#if HAVE_STRUCT_ERA_ENTRY
struct era_entry *era = _nl_get_era_entry (tp);
if (era)
{
@@ -699,8 +759,13 @@ strftime (s, maxsize, format, tp)
cpy (len, era->name_fmt);
break;
}
- }
+#else
+# if HAVE_STRFTIME
+ goto underlying_strftime;
+# endif
#endif
+ }
+
{
int year = tp->tm_year + TM_YEAR_BASE;
DO_NUMBER (1, year / 100 - (year % 100 < 0));
@@ -714,8 +779,13 @@ strftime (s, maxsize, format, tp)
&& *(subfmt = _NL_CURRENT (LC_TIME, ERA_D_FMT)) != '\0'))
subfmt = _NL_CURRENT (LC_TIME, D_FMT);
goto subformat;
-#endif
+#else
+# if HAVE_STRFTIME
+ goto underlying_strftime;
+# else
/* Fall through. */
+# endif
+#endif
case 'D': /* POSIX.2 extension. */
if (modifier != 0)
goto bad_format;
@@ -745,9 +815,9 @@ strftime (s, maxsize, format, tp)
do_number:
/* Format the number according to the MODIFIER flag. */
-#ifdef _NL_CURRENT
if (modifier == 'O' && 0 <= number_value)
{
+#ifdef _NL_CURRENT
/* Get the locale specific alternate representation of
the number NUMBER_VALUE. If none exist NULL is returned. */
const char *cp = _nl_get_alt_digit (number_value);
@@ -761,8 +831,12 @@ strftime (s, maxsize, format, tp)
break;
}
}
- }
+#else
+# if HAVE_STRFTIME
+ goto underlying_strftime;
+# endif
#endif
+ }
{
unsigned int u = number_value;
@@ -852,6 +926,9 @@ strftime (s, maxsize, format, tp)
case 'P':
to_lowcase = 1;
+#if !defined _NL_CURRENT && HAVE_STRFTIME
+ format_char = 'p';
+#endif
/* FALLTHROUGH */
case 'p':
@@ -860,8 +937,12 @@ strftime (s, maxsize, format, tp)
to_uppcase = 0;
to_lowcase = 1;
}
+#if defined _NL_CURRENT || !HAVE_STRFTIME
cpy (ap_len, ampm);
break;
+#else
+ goto underlying_strftime;
+#endif
case 'R': /* GNU extension. */
subfmt = "%H:%M";
@@ -927,8 +1008,13 @@ strftime (s, maxsize, format, tp)
&& *(subfmt = _NL_CURRENT (LC_TIME, ERA_T_FMT)) != '\0'))
subfmt = _NL_CURRENT (LC_TIME, T_FMT);
goto subformat;
-#endif
+#else
+# if HAVE_STRFTIME
+ goto underlying_strftime;
+# else
/* Fall through. */
+# endif
+#endif
case 'T': /* POSIX.2 extension. */
subfmt = "%H:%M:%S";
goto subformat;
@@ -1000,26 +1086,30 @@ strftime (s, maxsize, format, tp)
DO_NUMBER (1, tp->tm_wday);
case 'Y':
-#if HAVE_STRUCT_ERA_ENTRY
if (modifier == 'E')
{
+#if HAVE_STRUCT_ERA_ENTRY
struct era_entry *era = _nl_get_era_entry (tp);
if (era)
{
subfmt = strchr (era->name_fmt, '\0') + 1;
goto subformat;
}
- }
+#else
+# if HAVE_STRFTIME
+ goto underlying_strftime;
+# endif
#endif
+ }
if (modifier == 'O')
goto bad_format;
else
DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
case 'y':
-#if HAVE_STRUCT_ERA_ENTRY
if (modifier == 'E')
{
+#if HAVE_STRUCT_ERA_ENTRY
struct era_entry *era = _nl_get_era_entry (tp);
if (era)
{
@@ -1027,8 +1117,12 @@ strftime (s, maxsize, format, tp)
DO_NUMBER (1, (era->offset
+ (era->direction == '-' ? -delta : delta)));
}
- }
+#else
+# if HAVE_STRFTIME
+ goto underlying_strftime;
+# endif
#endif
+ }
DO_NUMBER (2, (tp->tm_year % 100 + 100) % 100);
case 'Z':
diff --git a/time/strptime.c b/time/strptime.c
index 30b015620d..36f42c9355 100644
--- a/time/strptime.c
+++ b/time/strptime.c
@@ -549,10 +549,7 @@ strptime_internal (buf, format, tm, decided)
break;
case 'Y':
/* Match year including century number. */
- if (sizeof (time_t) > 4)
- get_number (0, 9999);
- else
- get_number (0, 2036);
+ get_number (0, 9999);
tm->tm_year = val - 1900;
break;
case 'Z':
@@ -712,6 +709,7 @@ strptime_internal (buf, format, tm, decided)
case 'y':
/* Match year within century using alternate numeric symbols. */
get_alt_number (0, 99);
+ tm->tm_year = val >= 69 ? val : val + 100;
break;
default:
return NULL;
diff --git a/wcsmbs/wchar.h b/wcsmbs/wchar.h
index c7ab509448..82e51faf62 100644
--- a/wcsmbs/wchar.h
+++ b/wcsmbs/wchar.h
@@ -127,10 +127,10 @@ extern int __wcscoll_l __P ((__const wchar_t *__s1, __const wchar_t *__s2,
`wcscoll' to the original strings. */
extern size_t __wcsxfrm_l __P ((wchar_t *__s1, __const wchar_t *__s2,
size_t __n, __locale_t __loc));
-#endif
/* Duplicate S, returning an identical malloc'd string. */
extern wchar_t *wcsdup __P ((__const wchar_t *__s));
+#endif
/* Find the first occurrence of WC in WCS. */
extern wchar_t *wcschr __P ((__const wchar_t *__wcs, wchar_t __wc));
@@ -138,11 +138,11 @@ extern wchar_t *wcschr __P ((__const wchar_t *__wcs, wchar_t __wc));
extern wchar_t *wcsrchr __P ((__const wchar_t *__wcs, wchar_t __wc));
/* Return the length of the initial segmet of WCS which
- consists entirely of wide-characters not in REJECT. */
+ consists entirely of wide characters not in REJECT. */
extern size_t wcscspn __P ((__const wchar_t *__wcs,
__const wchar_t *__reject));
/* Return the length of the initial segmet of WCS which
- consists entirely of wide-characters in ACCEPT. */
+ consists entirely of wide characters in ACCEPT. */
extern size_t wcsspn __P ((__const wchar_t *__wcs, __const wchar_t *__accept));
/* Find the first occurrence in WCS of any character in ACCEPT. */
extern wchar_t *wcspbrk __P ((__const wchar_t *__wcs,
@@ -155,27 +155,27 @@ extern wchar_t *wcstok __P ((wchar_t *__restrict __s,
__const wchar_t *__restrict __delim,
wchar_t **__restrict __ptr));
-/* Return the number of wide-characters in S. */
+/* Return the number of wide characters in S. */
extern size_t wcslen __P ((__const wchar_t *__s));
-/* Search N bytes of S for C. */
+/* Search N wide characters of S for C. */
extern wchar_t *wmemchr __P ((__const wchar_t *__s, wchar_t __c, size_t __n));
-/* Compare N bytes of S1 and S2. */
+/* Compare N wide characters of S1 and S2. */
extern int wmemcmp __P ((__const wchar_t *__restrict __s1,
__const wchar_t *__restrict __s2, size_t __n));
-/* Copy N bytes of SRC to DEST. */
+/* Copy N wide characters of SRC to DEST. */
extern wchar_t *wmemcpy __P ((wchar_t *__restrict __s1,
__const wchar_t *__restrict __s2, size_t __n));
-/* Copy N bytes of SRC to DEST, guaranteeing
+/* Copy N wide characters of SRC to DEST, guaranteeing
correct behavior for overlapping strings. */
extern wchar_t *wmemmove __P ((wchar_t *__s1, __const wchar_t *__s2,
size_t __n));
-/* Set N bytes of S to C. */
+/* Set N wide characters of S to C. */
extern wchar_t *wmemset __P ((wchar_t *__s, wchar_t __c, size_t __n));