All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] glibc 2.3: Memory clobber missing from syscalls
@ 2004-10-15 12:47 Maciej W. Rozycki
  2004-10-18  1:37 ` Atsushi Nemoto
  2004-10-18  5:17 ` Andreas Jaeger
  0 siblings, 2 replies; 6+ messages in thread
From: Maciej W. Rozycki @ 2004-10-15 12:47 UTC (permalink / raw)
  To: linux-mips
  Cc: libc-alpha, Dominic Sweetman, Nigel Stephens, Maciej W. Rozycki

Hi,

 It seems nobody at the libc-alpha list is intersted in this fix, so I'm 
sending it here, so that people do not struggle against weird failures, 
while a fix is already done.  The fix is needed for the current version of 
glibc.

  Maciej

---------- Forwarded message ----------
Message-ID: <Pine.LNX.4.61.0410061929220.17693@perivale.mips.com>
Date: Wed, 6 Oct 2004 19:41:23 +0100 (BST)
From: Maciej W. Rozycki <macro@mips.com>
To: libc-alpha@sources.redhat.com
Cc: Dominic Sweetman <dom@mips.com>, Nigel Stephens <nigel@mips.com>,
    Maciej W. Rozycki <macro@linux-mips.org>
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 */

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-10-20  3:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-15 12:47 [patch] glibc 2.3: Memory clobber missing from syscalls Maciej W. Rozycki
2004-10-18  1:37 ` Atsushi Nemoto
2004-10-20  3:05   ` Maciej W. Rozycki
2004-10-20  3:18     ` Ralf Baechle
2004-10-18  5:17 ` Andreas Jaeger
2004-10-18 16:08   ` Maciej W. Rozycki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.