This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
[patch] MIPS/Linux: Memory clobber missing from syscalls
- From: "Maciej W. Rozycki" <macro at mips dot com>
- To: libc-alpha at sources dot redhat dot com
- Cc: Dominic Sweetman <dom at mips dot com>, Nigel Stephens <nigel at mips dot com>, "Maciej W. Rozycki" <macro at linux-mips dot org>
- Date: Wed, 6 Oct 2004 19:41:23 +0100 (BST)
- Subject: [patch] MIPS/Linux: Memory clobber missing from syscalls
Hello,
There is a problem with all inline syscalls invoked by the library. As
"memory" is not included in the list of clobbers, more aggressive versions
of GCC, such as 3.4, may incorrectly optimize code away based on the
assumption inline syscalls do not modify memory. This indeed happens --
due to this problem the login/tst-utmp and login/tst-utmpx testcases fail.
Here is an obvious fix that works for me. Tested with the mips-linux and
mipsel-linux configurations.
2004-10-06 Maciej W. Rozycki <macro@mips.com>
* sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
(__SYSCALL_CLOBBERS): Add "memory".
* sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
(__SYSCALL_CLOBBERS): Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
(__SYSCALL_CLOBBERS): Likewise.
Please apply.
Maciej
glibc-2.3.3-mips-syscall_clobbers-0.patch
diff -up --recursive --new-file glibc-2.3.3.macro/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h glibc-2.3.3/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
--- glibc-2.3.3.macro/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h Sat Mar 29 08:15:29 2003
+++ glibc-2.3.3/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h Tue Oct 5 17:16:47 2004
@@ -275,7 +275,8 @@
_sys_result; \
})
-#define __SYSCALL_CLOBBERS "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", "$25"
+#define __SYSCALL_CLOBBERS "$1", "$3", "$8", "$9", "$10", "$11", "$12", \
+ "$13", "$14", "$15", "$24", "$25", "memory"
#endif /* __ASSEMBLER__ */
diff -up --recursive --new-file glibc-2.3.3.macro/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h glibc-2.3.3/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
--- glibc-2.3.3.macro/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h Wed Oct 1 06:59:39 2003
+++ glibc-2.3.3/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h Tue Oct 5 17:18:03 2004
@@ -235,7 +235,8 @@
_sys_result; \
})
-#define __SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", "$13", "$14", "$15", "$24", "$25"
+#define __SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", "$13", \
+ "$14", "$15", "$24", "$25", "memory"
#endif /* __ASSEMBLER__ */
#endif /* linux/mips/sysdep.h */
diff -up --recursive --new-file glibc-2.3.3.macro/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h glibc-2.3.3/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
--- glibc-2.3.3.macro/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h Wed Oct 1 06:59:40 2003
+++ glibc-2.3.3/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h Tue Oct 5 17:18:28 2004
@@ -235,7 +235,8 @@
_sys_result; \
})
-#define __SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", "$13", "$14", "$15", "$24", "$25"
+#define __SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", "$13", \
+ "$14", "$15", "$24", "$25", "memory"
#endif /* __ASSEMBLER__ */
#endif /* linux/mips/sysdep.h */