]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Bug 430429 - s390x: Fix clang compile error in valgrind.h
authorAndreas Arnez <arnez@linux.ibm.com>
Tue, 9 Mar 2021 16:22:47 +0000 (17:22 +0100)
committerAndreas Arnez <arnez@linux.ibm.com>
Tue, 9 Mar 2021 16:36:12 +0000 (17:36 +0100)
It has been observed that clang emits an error in valgrind.h for the macro
VALGRIND_DO_CLIENT_REQUEST_EXPR:

 "[...] unsupported inline asm: input with type 'int' matching output with
 type 'volatile unsigned long'"

Fix this with an explicit cast of the input to 'unsigned long int.'

The patch has been suggested by Jonathan Albrecht.

NEWS
include/valgrind.h

diff --git a/NEWS b/NEWS
index 93fad5181057a0e3c5fd181e28c3ce3b7e9d1106..d1bf7b09f2938e6bc14f974bbe7afbbfe64ed4d1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -153,6 +153,7 @@ where XXXXXX is the bug number as listed below.
         diagnostics
 429952  Errors when building regtest with clang
 430354  ppc stxsibx and stxsihx instructions write too much data
+430429  valgrind.h doesn't compile on s390x with clang
 430485  expr_is_guardable doesn't handle Iex_Qop
 431556  Complete arm64 FADDP v8.2 instruction support
 432102  Add support for DWARF5 as produced by GCC11
index d33dd30932aa86b8284cb93d0e29ec646e820197..04a747c7a8f130c384a2a1acfe892fd4eab0ebca 100644 (file)
@@ -876,7 +876,8 @@ typedef
                     /* results = r3 */                           \
                     "lgr %0, 3\n\t"                              \
                     : "=d" (_zzq_result)                         \
-                    : "a" (&_zzq_args[0]), "0" (_zzq_default)    \
+                    : "a" (&_zzq_args[0]),                       \
+                      "0" ((unsigned long int)_zzq_default)      \
                     : "cc", "2", "3", "memory"                   \
                    );                                            \
    _zzq_result;                                                  \