|
From: <sv...@va...> - 2015-11-21 21:35:42
|
Author: iraisr
Date: Sat Nov 21 21:35:34 2015
New Revision: 15734
Log:
Implement properly setjmp/longjmp on Solaris x86/amd64.
The default implementation provided by __builtin functions
does very weird things.
Uncovered by Philippe's commit r15716.
Modified:
trunk/coregrind/m_libcsetjmp.c
trunk/include/pub_tool_libcsetjmp.h
Modified: trunk/coregrind/m_libcsetjmp.c
==============================================================================
--- trunk/coregrind/m_libcsetjmp.c (original)
+++ trunk/coregrind/m_libcsetjmp.c Sat Nov 21 21:35:34 2015
@@ -37,7 +37,7 @@
/* See include/pub_tool_libcsetjmp.h for background and rationale. */
/* The alternative implementations are for ppc{32,64}-linux and
- {amd64,x86}-{linux,darwin}. See #259977. That leaves only
+ {amd64,x86}-{linux,darwin,solaris}. See #259977. That leaves only
{arm,s390x}-linux using the gcc builtins now.
*/
@@ -377,15 +377,16 @@
#endif /* VGP_ppc64be_linux */
-/* ------------ amd64-{linux,darwin} ------------ */
+/* -------- amd64-{linux,darwin,solaris} -------- */
-#if defined(VGP_amd64_linux) || defined(VGP_amd64_darwin)
+#if defined(VGP_amd64_linux) || defined(VGP_amd64_darwin) || \
+ defined(VGP_amd64_solaris)
__asm__(
".text" "\n"
"" "\n"
-#if defined(VGP_amd64_linux)
+#if defined(VGP_amd64_linux) || defined(VGP_amd64_solaris)
".global VG_MINIMAL_SETJMP" "\n" // rdi = jmp_buf
"VG_MINIMAL_SETJMP:" "\n"
@@ -422,7 +423,7 @@
"" "\n"
-#if defined(VGP_amd64_linux)
+#if defined(VGP_amd64_linux) || defined(VGP_amd64_solaris)
".global VG_MINIMAL_LONGJMP" "\n"
"VG_MINIMAL_LONGJMP:" "\n" // rdi = jmp_buf
@@ -470,18 +471,19 @@
#endif
);
-#endif /* VGP_amd64_linux || VGP_amd64_darwin */
+#endif /* VGP_amd64_linux || VGP_amd64_darwin || VGP_amd64_solaris */
-/* ------------ x86-{linux,darwin} ------------ */
+/* -------- x86-{linux,darwin,solaris} -------- */
-#if defined(VGP_x86_linux) || defined(VGP_x86_darwin)
+#if defined(VGP_x86_linux) || defined(VGP_x86_darwin) || \
+ defined(VGP_x86_solaris)
__asm__(
".text" "\n"
"" "\n"
-#if defined(VGP_x86_linux)
+#if defined(VGP_x86_linux) || defined(VGP_x86_solaris)
".global VG_MINIMAL_SETJMP" "\n" // eax = jmp_buf
"VG_MINIMAL_SETJMP:" "\n"
@@ -512,7 +514,7 @@
"" "\n"
-#if defined(VGP_x86_linux)
+#if defined(VGP_x86_linux) || defined(VGP_x86_solaris)
".global VG_MINIMAL_LONGJMP" "\n"
"VG_MINIMAL_LONGJMP:" "\n" // eax = jmp_buf
@@ -546,7 +548,7 @@
#endif
);
-#endif /* VGP_x86_linux || VGP_x86_darwin */
+#endif /* VGP_x86_linux || VGP_x86_darwin || VGP_x86_solaris */
#if defined(VGP_mips32_linux)
Modified: trunk/include/pub_tool_libcsetjmp.h
==============================================================================
--- trunk/include/pub_tool_libcsetjmp.h (original)
+++ trunk/include/pub_tool_libcsetjmp.h Sat Nov 21 21:35:34 2015
@@ -91,7 +91,8 @@
void VG_MINIMAL_LONGJMP(VG_MINIMAL_JMP_BUF(_env));
-#elif defined(VGP_amd64_linux) || defined(VGP_amd64_darwin)
+#elif defined(VGP_amd64_linux) || defined(VGP_amd64_darwin) || \
+ defined(VGP_amd64_solaris)
#define VG_MINIMAL_JMP_BUF(_name) ULong _name [16+1]
__attribute__((returns_twice))
@@ -100,7 +101,8 @@
void VG_MINIMAL_LONGJMP(VG_MINIMAL_JMP_BUF(_env));
-#elif defined(VGP_x86_linux) || defined(VGP_x86_darwin)
+#elif defined(VGP_x86_linux) || defined(VGP_x86_darwin) || \
+ defined(VGP_x86_solaris)
#define VG_MINIMAL_JMP_BUF(_name) UInt _name [8+1]
__attribute__((returns_twice))
|