This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: "error: bp cannot be used in asm here"
- From: ams at kemisten dot nu (Alfred M. Szmidt)
- To: roland at frob dot com
- Cc: libc-alpha at sources dot redhat dot com
- Date: Sat, 14 Aug 2004 14:22:15 +0200 (CEST)
- Subject: Re: "error: bp cannot be used in asm here"
- References: <200408140611.i7E6Br1M008824@magilla.sf.frob.com>
What happens if you just remove the "bp" clobber?
Seems to work, though I haven't tested the compiled result yet. Want
me todo that before you commit the changes?
> ../sysdeps/mach/hurd/i386/init-first.c:224: warning: use of cast expressions as lvalues is deprecated
This you should be able to fix by changing the type of NEWSP to int
* and adding casts to (void *) its other uses. Want to try that?
Done.
Could you regenerate sysdeps/mach/configure? It wasn't regenerated
properly, i.e. it doesn't contain the check to see if mig groks
retcode.
And just updating the timestamp on sysdeps/mach/hurd/configure would
be nice, since it gets regenerated when you compile glibc for the
first time (i.e configure.in is newer then configure). S
2004-08-14 Alfred M. Szmidt <ams@kemisten.nu>
* sysdeps/mach/hurd/i386/init-first.c (_hurd_stack_setup): Let gcc
clobber the `ebp' register.
* sysdeps/mach/hurd/i386/Makefile (CFLAGS-init-first.c): Removed.
Reverts change from 2004-05-07 by Jeroen Dekkers.
* sysdeps/mach/hurd/i386/init-first.c (init): Changed the of newsp
from `void *' to `int *'. Changed all casts accordingly.
Index: sysdeps/mach/hurd/i386/Makefile
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/mach/hurd/i386/Makefile,v
retrieving revision 1.9
diff -u -r1.9 Makefile
--- sysdeps/mach/hurd/i386/Makefile 1 Jun 2004 18:38:12 -0000 1.9
+++ sysdeps/mach/hurd/i386/Makefile 14 Aug 2004 11:58:40 -0000
@@ -2,7 +2,3 @@
sysdep_routines += ioperm
sysdep_headers += sys/io.h
endif
-
-ifeq ($(subdir),csu)
-CFLAGS-init-first.c += -momit-leaf-frame-pointer
-endif
Index: sysdeps/mach/hurd/i386/init-first.c
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/mach/hurd/i386/init-first.c,v
retrieving revision 1.38
diff -u -r1.38 init-first.c
--- sysdeps/mach/hurd/i386/init-first.c 27 Jun 2003 20:58:22 -0000 1.38
+++ sysdeps/mach/hurd/i386/init-first.c 14 Aug 2004 11:58:40 -0000
@@ -1,5 +1,5 @@
/* Initialization code run first thing by the ELF startup code. For i386/Hurd.
- Copyright (C) 1995,96,97,98,99,2000,01,02,03 Free Software Foundation, Inc.
+ Copyright (C) 1995,96,97,98,99,2000,01,02,03,04 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
@@ -186,7 +186,7 @@
if (_cthread_init_routine)
{
/* Initialize cthreads, which will allocate us a new stack to run on. */
- void *newsp = (*_cthread_init_routine) ();
+ int *newsp = (*_cthread_init_routine) ();
struct hurd_startup_data *od;
void switch_stacks (void);
@@ -204,12 +204,12 @@
/* And readjust the dynamic linker's idea of where the argument
vector lives. */
assert (_dl_argv == argv);
- _dl_argv = (void *) ((int *) newsp + 1);
+ _dl_argv = (void *) (newsp + 1);
#endif
/* Set up the Hurd startup data block immediately following
the argument and environment pointers on the new stack. */
- od = (newsp + ((char *) d - (char *) data));
+ od = ((void *) 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. */
@@ -221,7 +221,7 @@
/* Push the user code address on the top of the new stack. It will
be the return address for `init1'; we will jump there with NEWSP
as the stack pointer. */
- *--(int *) newsp = data[-1];
+ *--newsp = data[-1];
((void **) data)[-1] = switch_stacks;
/* Force NEWSP into %ecx and &init1 into %eax, which are not restored
by function return. */
@@ -347,7 +347,7 @@
*--data = (&argc)[-1];
asm volatile ("movl %0, %%esp\n" /* Switch to new outermost stack. */
"movl $0, %%ebp\n" /* Clear outermost frame pointer. */
- "jmp *%1" : : "r" (data), "r" (&doinit1) : "sp", "bp");
+ "jmp *%1" : : "r" (data), "r" (&doinit1) : "sp");
/* NOTREACHED */
}