[patch] glibc 2.3: Memory clobber missing from syscalls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxx>
Date: Wed, 6 Oct 2004 19:41:23 +0100 (BST)
From: Maciej W. Rozycki <macro@xxxxxxxx>
To: libc-alpha@xxxxxxxxxxxxxxxxxx
Cc: Dominic Sweetman <dom@xxxxxxxx>, Nigel Stephens <nigel@xxxxxxxx>,
    Maciej W. Rozycki <macro@xxxxxxxxxxxxxx>
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@xxxxxxxx>

	* 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 */


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux