tests/tcg/s390x: Provide the libc bits needed by the system tests

The meson conversion dropped the SLOF libc include path that commit
3fa010d531 ("tests/tcg/s390x: Use the SLOF libc headers for the
multiarch tests") had added, breaking the build on systems without a
cross-libc, such as Fedora.

Rather than reintroducing a dependency on the SLOF submodule, which no
other tcg test has, declare the three functions that the reused pc-bios
code actually needs: memcpy(), memset(), and printf().

Reported-by: Daniel P. Berrangé <berrange@redhat.com>
Reported-by: Alex Bennée <alex.bennee@linaro.org>
Closes: https://patchew.org/QEMU/20260910100120.2076092-1-berrange@redhat.com/
Suggested-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Fixes: cd81cf8683 ("tests/tcg/s390x: system tests")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Tested-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20260915110959.492195-1-iii@linux.ibm.com>
Message-ID: <20260917165602.3405537-6-alex.bennee@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
This commit is contained in:
Ilya Leoshkevich
2026-09-17 17:55:49 +01:00
committed by Alex Bennée
parent 7e90d6e9ee
commit 35f4cc780e
3 changed files with 25 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
/*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef QEMU_TESTS_S390X_STDIO_H
#define QEMU_TESTS_S390X_STDIO_H
#include <minilib.h>
#define printf ml_printf
#endif

View File

@@ -0,0 +1,12 @@
/*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef QEMU_TESTS_S390X_STRING_H
#define QEMU_TESTS_S390X_STRING_H
#include <stddef.h>
void *memcpy(void *dest, const void *src, size_t n);
void *memset(void *dest, int c, size_t size);
#endif

View File

@@ -6,11 +6,13 @@ link_script = files('../softmmu.ld')[0]
head64 = files('../head64.S')[0]
console = files('../console.c')[0]
ipl_inc = meson.project_source_root()/'include'/'hw'/'s390x'/'ipl'
libc_inc = meson.current_source_dir()/'..'/'libc'
cflags = ['-nostdlib',
'-ffreestanding',
'-Wa,--noexecstack',
'-I', minilib_dir, minilib_printf,
'-I', ipl_inc,
'-I', libc_inc,
'-march=z13',
head64, console]
asmflags = ['-nostdlib',