]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Implement properly setjmp/longjmp on Solaris x86/amd64.
authorIvo Raisr <ivosh@ivosh.net>
Sat, 21 Nov 2015 21:35:34 +0000 (21:35 +0000)
committerIvo Raisr <ivosh@ivosh.net>
Sat, 21 Nov 2015 21:35:34 +0000 (21:35 +0000)
The default implementation provided by __builtin functions
does very weird things.
Uncovered by Philippe's commit r15716.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15734

coregrind/m_libcsetjmp.c
include/pub_tool_libcsetjmp.h

index 81a1a538a69a88071036beaf060eb35f5f97b839..24ca357324467e4e9f33fc08d6b4127f46f185b5 100644 (file)
@@ -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 @@ __asm__(
 #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 @@ __asm__(
 ""       "\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 @@ __asm__(
 #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 @@ __asm__(
 ""       "\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 @@ __asm__(
 #endif
 );
 
-#endif /* VGP_x86_linux || VGP_x86_darwin */
+#endif /* VGP_x86_linux || VGP_x86_darwin || VGP_x86_solaris */
 
 #if defined(VGP_mips32_linux)
 
index bb94a59ab3bd24203731de2a67e84753f5a382ad..31d2b61d51e3fb9cc4a96c68840c03f6ebccbf24 100644 (file)
@@ -91,7 +91,8 @@ __attribute__((noreturn))
 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 @@ __attribute__((noreturn))
 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))