[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 01/72] tests/tcg: Do not use inttypes.h in multiarch/system/memory
From: |
Richard Henderson |
Subject: |
[PULL 01/72] tests/tcg: Do not use inttypes.h in multiarch/system/memory.c |
Date: |
Tue, 24 Dec 2024 12:04:10 -0800 |
From: Ilya Leoshkevich <iii@linux.ibm.com>
make check-tcg fails on Fedora with the following error message:
alpha-linux-gnu-gcc [...] qemu/tests/tcg/multiarch/system/memory.c -o
memory [...]
qemu/tests/tcg/multiarch/system/memory.c:17:10: fatal error: inttypes.h: No
such file or directory
17 | #include <inttypes.h>
| ^~~~~~~~~~~~
compilation terminated.
The reason is that Fedora has cross-compilers, but no cross-glibc
headers. Fix by hardcoding the format specifiers and dropping the
include.
An alternative fix would be to introduce a configure check for
inttypes.h. But this would make it impossible to use Fedora
cross-compilers for softmmu tests, which used to work so far.
Fixes: ecbcc9ead2f8 ("tests/tcg: add a system test to check memory
instrumentation")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-ID: <20241010085906.226249-1-iii@linux.ibm.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
tests/tcg/multiarch/system/memory.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/tests/tcg/multiarch/system/memory.c
b/tests/tcg/multiarch/system/memory.c
index 65a6038a24..7508f6b916 100644
--- a/tests/tcg/multiarch/system/memory.c
+++ b/tests/tcg/multiarch/system/memory.c
@@ -14,7 +14,6 @@
#include <stdint.h>
#include <stdbool.h>
-#include <inttypes.h>
#include <minilib.h>
#ifndef CHECK_UNALIGNED
@@ -511,8 +510,8 @@ int main(void)
int i;
bool ok = true;
- ml_printf("Test data start: 0x%"PRIxPTR"\n", &test_data[0]);
- ml_printf("Test data end: 0x%"PRIxPTR"\n", &test_data[TEST_SIZE]);
+ ml_printf("Test data start: 0x%lx\n", (unsigned long)&test_data[0]);
+ ml_printf("Test data end: 0x%lx\n", (unsigned long)&test_data[TEST_SIZE]);
/* Run through the unsigned tests first */
for (i = 0; i < ARRAY_SIZE(init_ufns) && ok; i++) {
@@ -529,8 +528,8 @@ int main(void)
ok = do_signed_reads(true);
}
- ml_printf("Test data read: %"PRId32"\n", test_read_count);
- ml_printf("Test data write: %"PRId32"\n", test_write_count);
+ ml_printf("Test data read: %lu\n", (unsigned long)test_read_count);
+ ml_printf("Test data write: %lu\n", (unsigned long)test_write_count);
ml_printf("Test complete: %s\n", ok ? "PASSED" : "FAILED");
return ok ? 0 : -1;
}
--
2.43.0
- [PULL 00/72] tcg patch queue, Richard Henderson, 2024/12/24
- [PULL 01/72] tests/tcg: Do not use inttypes.h in multiarch/system/memory.c,
Richard Henderson <=
- [PULL 04/72] tcg/optimize: Split out fold_affected_mask, Richard Henderson, 2024/12/24
- [PULL 07/72] tcg/optimize: Augment s_mask from z_mask in fold_masks_zs, Richard Henderson, 2024/12/24
- [PULL 09/72] tcg/optimize: Use finish_folding in fold_add, fold_add_vec, fold_addsub2, Richard Henderson, 2024/12/24
- [PULL 10/72] tcg/optimize: Introduce const value accessors for TempOptInfo, Richard Henderson, 2024/12/24
- [PULL 06/72] tcg/optimize: Split out fold_masks_zs, Richard Henderson, 2024/12/24
- [PULL 12/72] tcg/optimize: Use fold_masks_zs in fold_andc, Richard Henderson, 2024/12/24
- [PULL 14/72] tcg/optimize: Use fold_masks_zs in fold_count_zeros, Richard Henderson, 2024/12/24
- [PULL 16/72] tcg/optimize: Use fold_and and fold_masks_z in fold_deposit, Richard Henderson, 2024/12/24
- [PULL 19/72] tcg/optimize: Use finish_folding in fold_dup, fold_dup2, Richard Henderson, 2024/12/24
- [PULL 25/72] tcg/optimize: Use fold_masks_zs in fold_movcond, Richard Henderson, 2024/12/24