summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog31
-rw-r--r--Make-dist4
-rw-r--r--Makeconfig14
-rw-r--r--Makefile4
-rw-r--r--Makerules4
-rw-r--r--configure.in26
-rw-r--r--hurd/hurdstartup.c36
-rw-r--r--locale/Makefile2
-rw-r--r--locale/localedef.c7
-rw-r--r--mach/Machrules2
-rw-r--r--posix/Makefile4
-rw-r--r--set-init.c21
-rw-r--r--sysdeps/alpha/Makefile2
-rw-r--r--sysdeps/mach/hurd/Makefile4
-rw-r--r--sysdeps/mach/hurd/i386/init-first.c17
-rw-r--r--sysdeps/sparc/Makefile2
-rw-r--r--values.h62
17 files changed, 168 insertions, 74 deletions
diff --git a/ChangeLog b/ChangeLog
index e0440179aa..fe3500861a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,34 @@
+Fri May 19 17:16:46 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * sysdeps/mach/hurd/i386/init-first.c: In cthreads case, handle
+ args on stack from kernel.
+
+ * posix/Makefile, sysdeps/alpha/Makefile,
+ * sysdeps/mach/hurd/Makefile, sysdeps/sparc/Makefile, Makefile,
+ * Makerules, Make-dist: Fix "cvs commit" cmds in rules to not fail
+ in the absence of CVS dirs.
+
+ * hurd/hurdstartup.c: Don't call __mach_init. Grok args from the
+ kernel on the stack properly.
+
+ * set-init.c: Never call _init/_fini; just run __libc_subinit.
+
+ * Makerules (LDFLAGS-c.so): Add -nostartfiles.
+ * mach/Machrules (LDFLAGS-$(interface.so)): Likewise.
+
+ * configure.in: Move defaulting of --with-elf and --with-gnu-*
+ based on host os outside the AC_CACHE_VAL for the sysdirs
+ calculation.
+
+ * Makeconfig (localedir, nlsdir): New variables.
+
+ * values.h: New file.
+ * Makefile (headers): Add values.h.
+
+ * locale/Makefile (distribute): Add error.h.
+ * locale/localedef.c: Include "error.h".
+ (main): Use error_message_count instead of warning_cntr.
+
Wed May 17 16:50:21 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
Merged 1003.2 locale and localedef programs by Ulrich Drepper.
diff --git a/Make-dist b/Make-dist
index 28c5d8f7aa..e7ef2fba84 100644
--- a/Make-dist
+++ b/Make-dist
@@ -167,7 +167,7 @@ subdirs := $(filter-out crypt,$(subdirs))
define autoconf-it
autoconf $(ACFLAGS) $< > $@.new
mv -f $@.new $@
-test -d CVS && cvs commit -m'Regenerated: autoconf $(ACFLAGS) $<' $@
+test ! -d CVS || cvs commit -m'Regenerated: autoconf $(ACFLAGS) $<' $@
endef
configure: configure.in; $(autoconf-it)
@@ -210,7 +210,7 @@ README: README.template version.c
sed -e 's/RELEASE/$(release)/' -e 's/VERSION/$(version)/' < $< > $@
# Make it unwritable so I won't change it by mistake.
chmod 444 $@
- test -d CVS && commit -m'Remade for $(release)-$(version)' $@
+ test ! -d CVS || commit -m'Remade for $(release)-$(version)' $@
endif # Subdirectory vs. parent makefile
diff --git a/Makeconfig b/Makeconfig
index f001982496..620f23d991 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -143,7 +143,7 @@ includedir = $(exec_prefix)/include
endif
# Where to install machine-independent data files.
-# These are the timezone database, and eventually the locale database.
+# These are the timezone database, and the locale database.
ifndef datadir
datadir = $(prefix)/share
endif
@@ -153,6 +153,18 @@ ifndef zonedir
zonedir = $(datadir)/zoneinfo
endif
+# Where to install the locale data files (which are machine-independent).
+ifndef localedir
+localedir = $(datadir)/locale
+endif
+
+# Where to install the locale charmap and message catalog files (which are
+# machine-independent).
+ifndef nlsdir
+nlsdir = $(datadir)/nls
+endif
+
+
# Where to install programs.
ifndef bindir
bindir = $(exec_prefix)/bin
diff --git a/Makefile b/Makefile
index e21b8afdce..e85be51cc0 100644
--- a/Makefile
+++ b/Makefile
@@ -31,7 +31,7 @@ all: lib others
define autoconf-it
autoconf $(ACFLAGS) $< > $@.new
mv -f $@.new $@
-test -d CVS && cvs commit -m'Regenerated: autoconf $(ACFLAGS) $<' $@
+test ! -d CVS || cvs commit -m'Regenerated: autoconf $(ACFLAGS) $<' $@
endef
configure: configure.in; $(autoconf-it)
@@ -79,7 +79,7 @@ subdirs := $(filter mach,$(subdirs)) $(filter hurd,$(subdirs)) \
no-libc.a bin lib \
data headers others)
-headers := features.h errno.h sys/errno.h errnos.h limits.h
+headers := features.h errno.h sys/errno.h errnos.h limits.h values.h
aux = sysdep $(libc-init) version
echo-headers: subdir_echo-headers
diff --git a/Makerules b/Makerules
index 3bea1dd7f6..619783c10d 100644
--- a/Makerules
+++ b/Makerules
@@ -363,7 +363,7 @@ lib%.so: lib%_pic.a
# Don't try to use -lc when making libc.so itself.
# Also omits crti.o and crtn.o, which we do not want
# since we define our own `.init' section specially.
-LDFLAGS-c.so = -nostdlib
+LDFLAGS-c.so = -nostdlib -nostartfiles
# Give libc.so an entry point and make it directly runnable itself.
LDFLAGS-c.so += -Wl,-dynamic-linker -Wl,/lib/ld.so -e __libc_print_version
endif
@@ -664,6 +664,6 @@ $(gpl2lgpl): %: $(..)gpl2lgpl.sed /home/gd/gnu/lib/%
# So I don't edit them by mistake.
chmod a-w $@-tmp
mv -f $@-tmp $@
- test -d CVS && cvs commit -m'Updated from $^' $@
+ test ! -d CVS || cvs commit -m'Updated from $^' $@
endif
endif
diff --git a/configure.in b/configure.in
index e29dee6293..ce1dee1bd3 100644
--- a/configure.in
+++ b/configure.in
@@ -58,6 +58,19 @@ AC_CANONICAL_HOST
# $machine, $vendor, and $os, and changes them whenever convenient.
config_machine=$host_cpu config_vendor=$host_vendor config_os=$host_os
+# Some configurations imply other options.
+case "$host_os" in
+gnu* | linux* | bsd4.4* | netbsd* | freebsd*)
+ # These systems always use GNU tools.
+ gnu_ld=yes gnu_as=yes
+esac
+case "$host_os" in
+gnu* | linux* | sysv4* | solaris2*)
+ # These systems always use the ELF format.
+ elf=yes
+esac
+
+# Compute the list of sysdep directories for this configuration.
sysdep_dir=$srcdir/sysdeps
AC_MSG_CHECKING(sysdep dirs)
AC_CACHE_VAL(libc_cv_sysdirs, [dnl
@@ -108,19 +121,6 @@ none)
base_os='' ;;
esac
-# Some configurations imply other options.
-case "$os" in
-gnu* | linux* | bsd4.4* | netbsd* | freebsd*)
- # These systems always use GNU tools.
- gnu_ld=yes gnu_as=yes
-esac
-case "$os" in
-gnu* | linux* | sysv4* | solaris2*)
- # These systems always use the ELF format.
- elf=yes
-esac
-
-
# For sunos4.1.1, try sunos4.1.1, then sunos4.1, then sunos4, then sunos.
tail=$os
ostry=$os
diff --git a/hurd/hurdstartup.c b/hurd/hurdstartup.c
index 0347234397..416cddb62b 100644
--- a/hurd/hurdstartup.c
+++ b/hurd/hurdstartup.c
@@ -78,9 +78,6 @@ _hurd_startup (void **argptr, void (*main) (int *data))
int argc, envc;
int *argcptr;
- /* Basic Mach initialization, must be done before RPCs can be done. */
- __mach_init ();
-
if (err = __task_get_special_port (__mach_task_self (), TASK_BOOTSTRAP_PORT,
&in_bootstrap))
LOSE;
@@ -104,21 +101,19 @@ _hurd_startup (void **argptr, void (*main) (int *data))
if (err || in_bootstrap == MACH_PORT_NULL)
{
-#if 0
/* Either we have no bootstrap port, or the RPC to the exec server
failed. Try to snarf the args in the canonical Mach way.
Hopefully either they will be on the stack as expected, or the
stack will be zeros so we don't crash. Set all our other
variables to have empty information. */
- ENTRY_SP (argptr);
- /* SNARF_ARGS (ARGPTR, ARGC, ARGV, ENVP) snarfs the arguments and
- environment from the stack, assuming they were put there by the
- microkernel. */
-XXX XXX XXX
-
- SNARF_ARGS (argptr, argc, argv, envp);
-#endif
+ argcptr = (int *) argptr;
+ argc = argcptr[0];
+ argv = (char **) &argcptr[1];
+ envp = &argv[argc + 1];
+ envc = 0;
+ while (envp[envc])
+ ++envc;
data.flags = 0;
args = env = NULL;
@@ -137,8 +132,6 @@ XXX XXX XXX
/* Turn the block of null-separated strings we were passed for the
arguments and environment into vectors of pointers to strings. */
-
-
if (! argv)
{
/* Count up the arguments so we can allocate ARGV. */
@@ -184,12 +177,15 @@ extern void _start();
vm_address_t user_entry = 0;
#endif
- *d = data;
- _hurd_init_dtable = d->dtable;
- _hurd_init_dtablesize = d->dtablesize;
- d->phdr = phdr;
- d->phdrsz = phdrsz;
- d->user_entry = user_entry;
+ if ((void *) d != argv[0])
+ {
+ *d = data;
+ _hurd_init_dtable = d->dtable;
+ _hurd_init_dtablesize = d->dtablesize;
+ d->phdr = phdr;
+ d->phdrsz = phdrsz;
+ d->user_entry = user_entry;
+ }
(*main) (argcptr);
}
diff --git a/locale/Makefile b/locale/Makefile
index c3abc2c62e..74959e628a 100644
--- a/locale/Makefile
+++ b/locale/Makefile
@@ -25,7 +25,7 @@ headers = locale.h
distribute = localeinfo.h categories.def \
$(localedef-modules:=.c) $(locale-modules:=.c) \
$(lib-modules:=.c) config.h hash.h iso-4217.def \
- keyword.gperf keyword.h localedef.h token.h
+ keyword.gperf keyword.h localedef.h token.h error.h
routines = setlocale loadlocale localeconv nl_langinfo
categories = ctype messages monetary numeric time collate
aux = $(categories:%=lc-%) $(categories:%=C-%)
diff --git a/locale/localedef.c b/locale/localedef.c
index c331e11888..fceebc5635 100644
--- a/locale/localedef.c
+++ b/locale/localedef.c
@@ -24,6 +24,7 @@ Cambridge, MA 02139, USA. */
#include <string.h>
#include <unistd.h>
#include <sys/stat.h>
+#include "error.h"
#include "localedef.h"
@@ -60,10 +61,6 @@ static const struct option long_options[] =
};
-/* This is defined in error-msg.h. */
-extern int warning_cntr;
-
-
/* Prototypes for local functions. */
static void usage (int status) __attribute__ ((noreturn));
static int construct_output_path (const char *path);
@@ -169,7 +166,7 @@ main(int argc, char *argv[])
/* We are now able to write the data files. If warning were given we
do it only if it is explicitly requested (--force). */
- if (warning_cntr == 0 || force_output != 0)
+ if (error_message_count == 0 || force_output != 0)
if (cannot_write != 0)
error (0, 0, gettext ("cannot write output file `%s': %s"),
output_path, strerror (cannot_write));
diff --git a/mach/Machrules b/mach/Machrules
index f81017958d..843f06f7dd 100644
--- a/mach/Machrules
+++ b/mach/Machrules
@@ -199,6 +199,6 @@ extra-libs += $(interface-library)
# shared object is absent, ld may choose a static library someplace and
# produce a bogus libmachuser.so.
interface.so = $(interface-library:lib%=%.so)
-LDFLAGS-$(interface.so) = -nostdlib
+LDFLAGS-$(interface.so) = -nostdlib -nostartfiles
endif
diff --git a/posix/Makefile b/posix/Makefile
index 6931727288..5c3d9a0fb2 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -70,13 +70,13 @@ glob/%.h: %.h
glob/configure: glob/configure.in
cd glob; autoconf $(ACFLAGS)
- test -d CVS && cvs commit -m'Regenerated: autoconf $(ACFLAGS) $<' $@
+ test ! -d CVS || cvs commit -m'Regenerated: autoconf $(ACFLAGS) $<' $@
glob/ChangeLog: ../ChangeLog
changelog-extract --regexp 'posix/(glob|fnmatch).*' < $< > $@.new
chmod a-w $@.new
mv -f $@.new $@
- test -d CVS && cvs commit -mRegenerated $@
+ test ! -d CVS || cvs commit -mRegenerated $@
%.Z: %
compress -c $< > $@-tmp
diff --git a/set-init.c b/set-init.c
index 34c0dbd804..8bf9d053a3 100644
--- a/set-init.c
+++ b/set-init.c
@@ -19,24 +19,5 @@ Cambridge, MA 02139, USA. */
#include <stdlib.h>
#include "set-hooks.h"
-DEFINE_HOOK_RUNNER (__libc_subinit, __libc_subinit_runner,
+DEFINE_HOOK_RUNNER (__libc_subinit, __libc_init,
(int argc, char **argv, char **envp), (argc, argv, envp))
-
-void
-__libc_init (argc, argv, envp)
- int argc;
- char **argv;
- char **envp;
-{
- __libc_subinit_runner (argc, argv, envp);
-
-#ifdef HAVE_ELF
- {
- /* These functions are defined in crti.o to run the .init and .fini
- sections, which are used for initializers in ELF. */
- extern void _init __P ((void)), _fini __P ((void));
- atexit (_fini); /* Arrange for _fini to run at exit. */
- _init ();
- }
-#endif
-}
diff --git a/sysdeps/alpha/Makefile b/sysdeps/alpha/Makefile
index 06621b824d..8573ca811c 100644
--- a/sysdeps/alpha/Makefile
+++ b/sysdeps/alpha/Makefile
@@ -91,4 +91,4 @@ $(divrem:%=$(sysdep_dir)/alpha/%.S): $(sysdep_dir)/alpha/divrem.m4 $(sysdep_dir)
# Make it unwritable so noone will edit it by mistake.
-chmod a-w $@-tmp
mv -f $@-tmp $@
- test -d CVS && cvs commit -m'Regenerated from $<' $@
+ test ! -d CVS || cvs commit -m'Regenerated from $<' $@
diff --git a/sysdeps/mach/hurd/Makefile b/sysdeps/mach/hurd/Makefile
index d1e8580e93..1886d07094 100644
--- a/sysdeps/mach/hurd/Makefile
+++ b/sysdeps/mach/hurd/Makefile
@@ -108,7 +108,7 @@ $(objpfx)stamp-errnos: $(hurd)/errnos.awk $(errno.texinfo) \
# Make it unwritable so noone will edit it by mistake.
-chmod a-w $(hurd)/errnos.h-tmp
./$(..)move-if-change $(hurd)/errnos.h-tmp $(hurd)/errnos.h
- test -d CVS && \
+ test ! -d CVS || \
(cd $(hurd); cvs commit -m'Regenerated from $^' errnos.h)
touch $@
@@ -117,7 +117,7 @@ $(hurd)/errlist.c: $(hurd)/errlist.awk $(errno.texinfo)
# Make it unwritable so noone will edit it by mistake.
-chmod a-w $@-tmp
mv -f $@-tmp $@
- test -d CVS && cvs commit -m'Regenerated from $^' $@
+ test ! -d CVS || cvs commit -m'Regenerated from $^' $@
# We install the real libc.a as libcrt.a and as libc.a we install a linker
# script which does -( -lcrt -lmachuser -lhurduser -).
diff --git a/sysdeps/mach/hurd/i386/init-first.c b/sysdeps/mach/hurd/i386/init-first.c
index 55ffe1aada..d747e75c7d 100644
--- a/sysdeps/mach/hurd/i386/init-first.c
+++ b/sysdeps/mach/hurd/i386/init-first.c
@@ -20,6 +20,7 @@ Cambridge, MA 02139, USA. */
#include <hurd.h>
#include <stdio.h>
#include <unistd.h>
+#include <string.h>
#include "hurdstartup.h"
#include "set-hooks.h"
#include "hurdmalloc.h" /* XXX */
@@ -118,9 +119,23 @@ init (int *data, int retaddr)
{
/* Initialize cthreads, which will allocate us a new stack to run on. */
void *newsp = (*_cthread_init_routine) ();
+ struct hurd_startup_data *od;
+
/* Copy the argdata from the old stack to the new one. */
newsp = memcpy (newsp - ((char *) &d[1] - (char *) data), data,
- (char *) &d[1] - (char *) data);
+ (char *) d - (char *) data);
+
+ /* Set up the Hurd startup data block immediately following
+ the argument and environment pointers on the new stack. */
+ od = (newsp + ((char *) d - (char *) data));
+ if ((void *) argv[0] == d)
+ /* We were started up by the kernel with arguments on the stack.
+ There is no Hurd startup data, so zero the block. */
+ memset (od, 0, sizeof *od);
+ else
+ /* Copy the Hurd startup data block to the new stack. */
+ *od = *d;
+
data = newsp;
}
diff --git a/sysdeps/sparc/Makefile b/sysdeps/sparc/Makefile
index b651dfb2c6..d4124a6eb7 100644
--- a/sysdeps/sparc/Makefile
+++ b/sysdeps/sparc/Makefile
@@ -46,7 +46,7 @@ $(divrem:%=$(sysdep_dir)/sparc/%.S): $(sysdep_dir)/sparc/divrem.m4
# Make it unwritable so noone will edit it by mistake.
-chmod a-w $@-tmp
mv -f $@-tmp $@
- test -d CVS && cvs commit -m'Regenerated from $<' $@
+ test ! -d CVS || cvs commit -m'Regenerated from $<' $@
sysdep-realclean := $(sysdep-realclean) $(divrem:%=sysdeps/sparc/%.S)
diff --git a/values.h b/values.h
new file mode 100644
index 0000000000..5eaa13fd0f
--- /dev/null
+++ b/values.h
@@ -0,0 +1,62 @@
+/* Old compatiblity names for <limits.h> and <float.h> constants.
+Copyright (C) 1995 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., 675 Mass Ave,
+Cambridge, MA 02139, USA. */
+
+/* This interface is obsolete. New programs should use
+ <limits.h> and/or <float.h> instead of <values.h>. */
+
+#ifndef _VALUES_H
+#define _VALUES_H 1
+
+#include <limits.h>
+
+#define _TYPEBITS(type) (sizeof (type) * CHAR_BIT)
+
+#define CHARBITS _TYPEBITS (char)
+#define SHORTBITS _TYPEBITS (short int)
+#define INTBITS _TYPEBITS (int)
+#define LONGBITS _TYPEBITS (long)
+#define PTRBITS _TYPEBITS (char *)
+#define DOUBLEBITS _TYPEBITS (double)
+#define FLOATBITS _TYPEBITS (float)
+
+#define MINSHORT SHORT_MIN
+#define MININT INT_MIN
+#define MINLONG LONG_MIN
+
+#define MAXSHORT SHORT_MAX
+#define MAXINT INT_MAX
+#define MAXLONG LONG_MAX
+
+#define HIBITS MINSHORT
+#define HIBITL MINLONG
+
+
+#include <float.h>
+
+#define MAXDOUBLE DBL_MAX
+#define MAXFLOAT FLT_MAX
+#define MINDOUBLE DBL_MIN
+#define MINFLOAT FLT_MIN
+#define DMINEXP DBL_MIN_EXP
+#define FMINEXP FLT_MIN_EXP
+#define DMAXEXP DBL_MAX_EXP
+#define FMAXEXP FLT_MAX_EXP
+
+
+#endif /* values.h */