]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix build on newer illumos distributions where struct fpchip_state
authorIvo Raisr <ivosh@ivosh.net>
Sun, 17 Apr 2016 10:05:29 +0000 (10:05 +0000)
committerIvo Raisr <ivosh@ivosh.net>
Sun, 17 Apr 2016 10:05:29 +0000 (10:05 +0000)
was renamed to _fpchip_state.
n-i-z

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

configure.ac
include/vki/vki-solaris.h
memcheck/tests/amd64-solaris/context_sse.c
memcheck/tests/amd64-solaris/context_sse.stderr.exp
memcheck/tests/x86-solaris/context_sse.c
memcheck/tests/x86-solaris/context_sse.stderr.exp

index 202e0f9d511ed850aa6292ecd04b3f0ae458d383..c925d1ebde362a9803e9e2dabf830f40fadf7c9c 100644 (file)
@@ -3520,6 +3520,23 @@ AC_MSG_RESULT([no])
 ])
 AM_CONDITIONAL(SOLARIS_SYSTEM_STATS_SYSCALL, test x$solaris_system_stats_syscall = xyes)
 
+
+# Solaris-specific check determining if fpregset_t defines struct _fpchip_state
+# (on newer illumos) or struct fpchip_state (Solaris, older illumos).
+#
+# C-level symbol: SOLARIS_FPCHIP_STATE_TAKES_UNDERSCORE
+# Automake-level symbol: none
+#
+AC_CHECK_TYPE([struct _fpchip_state],
+              [solaris_fpchip_state_takes_underscore=yes],
+              [solaris_fpchip_state_takes_underscore=no],
+              [[#include <sys/regset.h>]])
+if test "$solaris_fpchip_state_takes_underscore" = "yes"; then
+  AC_DEFINE(SOLARIS_FPCHIP_STATE_TAKES_UNDERSCORE, 1,
+            [Define to 1 if fpregset_t defines struct _fpchip_state])
+fi
+
+
 else
 AM_CONDITIONAL(SOLARIS_SUN_STUDIO_AS, false)
 AM_CONDITIONAL(SOLARIS_XPG_SYMBOLS_PRESENT, false)
index 76e83d461548d68ae86c8f0700beb4ba59f54378..82371acd98241a5570fd102dcdb95e940935d678 100644 (file)
@@ -1442,7 +1442,11 @@ struct sysv_ucontext {
 #error "Unknown platform"
 #endif
 
+#if defined(SOLARIS_FPCHIP_STATE_TAKES_UNDERSCORE)
+#define vki_fpchip_state _fpchip_state
+#else
 #define vki_fpchip_state fpchip_state
+#endif /* SOLARIS_FPCHIP_STATE_TAKES_UNDERSCORE */
 
 #define VKI_GETCONTEXT GETCONTEXT
 #define VKI_SETCONTEXT SETCONTEXT
index f1e381b906e8bc9f63d9327997492ec6665c290b..fa9368d72e96a6cd0c57b6c3c8dd437d5e54863c 100644 (file)
@@ -10,6 +10,8 @@
 #include <sys/syscall.h>
 #include <sys/ucontext.h>
 
+#include "config.h"
+
 static siginfo_t si;
 static ucontext_t uc;
 /* x0 is always zero, but is visible to Valgrind as uninitialised. */
@@ -31,7 +33,13 @@ int main(void)
    pid_t pid;
    upad128_t out[8];
    upad128_t y0;
-   struct fpchip_state *fs = &uc.uc_mcontext.fpregs.fp_reg_set.fpchip_state;
+
+#if defined(SOLARIS_FPCHIP_STATE_TAKES_UNDERSCORE)
+   struct _fpchip_state *fs;
+#else
+   struct fpchip_state *fs;
+#endif
+   fs = &uc.uc_mcontext.fpregs.fp_reg_set.fpchip_state;
 
    /* Uninitialised, but we know px[0] is 0x0. */
    upad128_t *px = malloc(sizeof(*px));
index bee96caaa77ceb7f50c879f027090d79a3b265e7..df169c30b2e13b37472e35f445c2ea4bbad6c5f1 100644 (file)
@@ -1,96 +1,96 @@
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:87)
+   at 0x........: main (context_sse.c:95)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:41)
+   by 0x........: main (context_sse.c:49)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:87)
+   at 0x........: main (context_sse.c:95)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:41)
+   by 0x........: main (context_sse.c:49)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:87)
+   at 0x........: main (context_sse.c:95)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:41)
+   by 0x........: main (context_sse.c:49)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:87)
+   at 0x........: main (context_sse.c:95)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:41)
+   by 0x........: main (context_sse.c:49)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:87)
+   at 0x........: main (context_sse.c:95)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:41)
+   by 0x........: main (context_sse.c:49)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:87)
+   at 0x........: main (context_sse.c:95)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:41)
+   by 0x........: main (context_sse.c:49)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:87)
+   at 0x........: main (context_sse.c:95)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:41)
+   by 0x........: main (context_sse.c:49)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:87)
+   at 0x........: main (context_sse.c:95)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:41)
+   by 0x........: main (context_sse.c:49)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:95)
+   at 0x........: main (context_sse.c:103)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:37)
+   by 0x........: main (context_sse.c:45)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:95)
+   at 0x........: main (context_sse.c:103)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:37)
+   by 0x........: main (context_sse.c:45)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:95)
+   at 0x........: main (context_sse.c:103)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:41)
+   by 0x........: main (context_sse.c:49)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:95)
+   at 0x........: main (context_sse.c:103)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:41)
+   by 0x........: main (context_sse.c:49)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:95)
+   at 0x........: main (context_sse.c:103)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:41)
+   by 0x........: main (context_sse.c:49)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:95)
+   at 0x........: main (context_sse.c:103)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:41)
+   by 0x........: main (context_sse.c:49)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:95)
+   at 0x........: main (context_sse.c:103)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:41)
+   by 0x........: main (context_sse.c:49)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:95)
+   at 0x........: main (context_sse.c:103)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:41)
+   by 0x........: main (context_sse.c:49)
 
index adea470f4bb23d26b1badf9dff5a1220a9cc16a4..ed30120347deedd54a00d18794d17b287250aed5 100644 (file)
@@ -8,6 +8,8 @@
 #include <sys/syscall.h>
 #include <sys/ucontext.h>
 
+#include "config.h"
+
 static siginfo_t si;
 static ucontext_t uc;
 /* x0 is always zero, but is visible to Valgrind as uninitialised. */
@@ -29,7 +31,13 @@ int main(void)
    pid_t pid;
    upad128_t out[8];
    upad128_t y0;
-   struct fpchip_state *fs = &uc.uc_mcontext.fpregs.fp_reg_set.fpchip_state;
+
+#if defined(SOLARIS_FPCHIP_STATE_TAKES_UNDERSCORE)
+   struct _fpchip_state *fs;
+#else
+   struct fpchip_state *fs;
+#endif
+   fs = &uc.uc_mcontext.fpregs.fp_reg_set.fpchip_state;
 
    /* Uninitialised, but we know px[0] is 0x0. */
    upad128_t *px = malloc(sizeof(*px));
index d7d5614a4eec781bab1592ff9c11c2dbc13c399f..65fdb447bd58c9eb4f80818dc5d7ff89a34d653e 100644 (file)
@@ -1,96 +1,96 @@
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:93)
+   at 0x........: main (context_sse.c:101)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:39)
+   by 0x........: main (context_sse.c:47)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:93)
+   at 0x........: main (context_sse.c:101)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:39)
+   by 0x........: main (context_sse.c:47)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:93)
+   at 0x........: main (context_sse.c:101)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:39)
+   by 0x........: main (context_sse.c:47)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:93)
+   at 0x........: main (context_sse.c:101)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:39)
+   by 0x........: main (context_sse.c:47)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:93)
+   at 0x........: main (context_sse.c:101)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:39)
+   by 0x........: main (context_sse.c:47)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:93)
+   at 0x........: main (context_sse.c:101)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:39)
+   by 0x........: main (context_sse.c:47)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:93)
+   at 0x........: main (context_sse.c:101)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:39)
+   by 0x........: main (context_sse.c:47)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:93)
+   at 0x........: main (context_sse.c:101)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:39)
+   by 0x........: main (context_sse.c:47)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:101)
+   at 0x........: main (context_sse.c:109)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:35)
+   by 0x........: main (context_sse.c:43)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:101)
+   at 0x........: main (context_sse.c:109)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:35)
+   by 0x........: main (context_sse.c:43)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:101)
+   at 0x........: main (context_sse.c:109)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:39)
+   by 0x........: main (context_sse.c:47)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:101)
+   at 0x........: main (context_sse.c:109)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:39)
+   by 0x........: main (context_sse.c:47)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:101)
+   at 0x........: main (context_sse.c:109)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:39)
+   by 0x........: main (context_sse.c:47)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:101)
+   at 0x........: main (context_sse.c:109)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:39)
+   by 0x........: main (context_sse.c:47)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:101)
+   at 0x........: main (context_sse.c:109)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:39)
+   by 0x........: main (context_sse.c:47)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:101)
+   at 0x........: main (context_sse.c:109)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:39)
+   by 0x........: main (context_sse.c:47)