aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-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
4 files changed, 20 insertions, 5 deletions
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)