[PATCH] syscall fix for Alpha/Arm/M68k (was Re: next pre-release)
Jakub Jelinek
jakub@redhat.com
Fri Sep 15 05:52:00 GMT 2000
On Thu, Sep 14, 2000 at 04:50:17PM -0700, Ulrich Drepper wrote:
> Hi,
>
> I want to make the next prerelease before Tuesday next week. The
> problems I'm seeing in the moment are:
>
> - on Arm, gcc cannot handle nested functions. I filed a PR. We cannot
> do much about this except compiling ld-collate.c without optimization
>
> - on PPC I see problems because the binutils we have on that machine is
> not handling .protected correctly. Geoff is currently tested a patch.
> The patch HJ sent out some time ago is not entirely correct as far as
> we can say now.
>
> - on Alpha I see many math errors and also the vismain test in elf/ is
> failing. The math errors are most probably due to the kernel we are
> running on that machine, the elf error probably due to old, in between
> the versions, binutils.
>
> I'm not aware of any other issues, especially not on x86. I don't
> know anything about any other architecture. Andreas, if you could
> update the PR list so that we can look through it there might be
> nothing preventing me from making 2.1.94.
Could you please install my yesterday's _dl_lookup_symbol_skip patch?
That one is an issue on x86 as well.
The patch below fixes sysctl on Alpha, where gcc -O2 and -O3 optimize too
much and move stores into the sysctl_args structure after the syscall where
they are useless. This was the reason why alphaev4 glibc would load (all
stores happened past the syscall, so it returned -EFAULT) and would not
start at all on alphaev6 (where name and namelen were stored and the rest
were zeros). I have checked other ports and alpha, arm and m68k were the
only posts not adding "memory" into syscall clobbers. But a syscall usually
clobbers memory, and we don't have any macros how to tell which
INLINE_SYSCALL will clobber which memory.
2000-09-15 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/alpha/sysdep.h (inline_syscall_clobbers): Add memory
clobber.
* sysdeps/unix/sysv/linux/arm/sysdep.h (INLINE_SYSCALL): Likewise.
* sysdeps/unix/sysv/linux/m68k/sysdep.h (INLINE_SYSCALL): Likewise.
--- libc/sysdeps/unix/alpha/sysdep.h.jj Sun Nov 1 00:37:54 1998
+++ libc/sysdeps/unix/alpha/sysdep.h Fri Sep 15 14:36:26 2000
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995, 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995, 1996, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Brendan Kehoe (brendan@zen.org).
@@ -131,7 +131,7 @@ __LABEL(name) \
#define inline_syscall_clobbers \
"$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", \
- "$22", "$23", "$24", "$25", "$27", "$28"
+ "$22", "$23", "$24", "$25", "$27", "$28", "memory"
/* It is moderately important optimization-wise to limit the lifetime
of the hard-register variables as much as possible. Thus we copy
--- libc/sysdeps/unix/sysv/linux/arm/sysdep.h.jj Wed Aug 2 21:36:35 2000
+++ libc/sysdeps/unix/sysv/linux/arm/sysdep.h Fri Sep 15 14:37:40 2000
@@ -131,7 +131,7 @@
asm volatile ("swi %1 @ syscall " #name \
: "=r" (_a1) \
: "i" (SYS_ify(name)) ASM_ARGS_##nr \
- : "a1"); \
+ : "a1" : "memory"); \
_sys_result = _a1; \
} \
if (_sys_result >= (unsigned int) -4095) \
--- libc/sysdeps/unix/sysv/linux/m68k/sysdep.h.jj Mon Nov 16 03:41:56 1998
+++ libc/sysdeps/unix/sysv/linux/m68k/sysdep.h Fri Sep 15 14:40:29 2000
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Andreas Schwab, <schwab@issan.informatik.uni-dortmund.de>,
December 1995.
@@ -171,7 +171,7 @@ SYSCALL_ERROR_LABEL: \
asm volatile ("trap #0" \
: "=d" (_d0) \
: "0" (_d0) ASM_ARGS_##nr \
- : "d0"); \
+ : "d0" : "memory"); \
_sys_result = _d0; \
} \
if (_sys_result >= (unsigned int) -4095) \
Jakub
More information about the Libc-hacker
mailing list