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.
This commit is contained in:
Roland McGrath 1995-05-20 00:13:43 +00:00
parent 2b83a2a4d9
commit a2fe9c76a9
17 changed files with 168 additions and 74 deletions

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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);
}

View File

@ -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-%)

View File

@ -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));

View File

@ -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

View File

@ -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

View File

@ -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
}

View File

@ -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 $<' $@

View File

@ -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 -).

View File

@ -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;
}

View File

@ -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)

62
values.h Normal file
View File

@ -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 */