This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] MIPS: Use `.set arch=mips2' to emulate LL/SC for the R5900 too
- From: Fredrik Noring <noring at nocrew dot org>
- To: "Maciej W. Rozycki" <macro at linux-mips dot org>, Joseph Myers <joseph at codesourcery dot com>, libc-alpha at sourceware dot org
- Cc: Jürgen Urban <JuergenUrban at gmx dot de>
- Date: Sat, 27 Oct 2018 14:00:36 +0200
- Subject: [PATCH] MIPS: Use `.set arch=mips2' to emulate LL/SC for the R5900 too
`.set arch=' was implemented in Binutils by Thiemo Seufer 29 June 2003 in
commit fef14a42892a297bf, and the GNU C Library requires Binutils 2.25,
from 2014, or later, so it ought to be compatible as used here.
This change has been tested by compiling the GNU C Library 2.27 with a
GCC 8.2.0 cross-compiler for mipsr5900el-unknown-linux-gnu under Gentoo.
---
sysdeps/mips/sys/tas.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sysdeps/mips/sys/tas.h b/sysdeps/mips/sys/tas.h
index 3e020a754e..40057f9d16 100644
--- a/sysdeps/mips/sys/tas.h
+++ b/sysdeps/mips/sys/tas.h
@@ -41,8 +41,8 @@ __NTH (_test_and_set (int *__p, int __v))
__asm__ __volatile__
("/* Inline test and set */\n"
".set push\n\t"
-#if _MIPS_SIM == _ABIO32 && __mips < 2
- ".set mips2\n\t"
+#if _MIPS_SIM == _ABIO32 && (__mips < 2 || defined(_MIPS_ARCH_R5900))
+ ".set arch=mips2\n\t"
#endif
"sync\n\t"
"1:\n\t"
--
2.18.1