[PATCH] tests/tcg/s390x: Restore the SLOF libc include path

Ilya Leoshkevich posted 1 patch 1 week, 4 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260914235113.272992-1-iii@linux.ibm.com
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Ilya Leoshkevich <iii@linux.ibm.com>, David Hildenbrand <david@kernel.org>, Cornelia Huck <cohuck@redhat.com>, Eric Farman <farman@linux.ibm.com>, Matthew Rosato <mjrosato@linux.ibm.com>
tests/tcg/s390x/system/meson.build | 7 +++++++
1 file changed, 7 insertions(+)
[PATCH] tests/tcg/s390x: Restore the SLOF libc include path
Posted by Ilya Leoshkevich 1 week, 4 days ago
The meson conversion dropped the SLOF libc include path that commit
3fa010d5317 ("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.

Restore the include path. Add the logic to check out SLOF libc.

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/
Fixes: cd81cf86834 ("tests/tcg/s390x: system tests")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
---
 tests/tcg/s390x/system/meson.build | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tests/tcg/s390x/system/meson.build b/tests/tcg/s390x/system/meson.build
index ca07f503058..26f47d4184a 100644
--- a/tests/tcg/s390x/system/meson.build
+++ b/tests/tcg/s390x/system/meson.build
@@ -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'
+slof_inc = meson.project_source_root()/'roms'/'SLOF'/'lib'/'libc'/'include'
 cflags = ['-nostdlib',
           '-ffreestanding',
           '-Wa,--noexecstack',
           '-I', minilib_dir, minilib_printf,
           '-I', ipl_inc,
+          '-I', slof_inc,
           '-march=z13',
           head64, console]
 asmflags = ['-nostdlib',
@@ -21,6 +23,11 @@ qemu_args = ['-display', 'none',
              '-serial', 'stdio',
              '-kernel']
 
+if not fs.exists(slof_inc) and get_option('wrap_mode') != 'nodownload'
+  run_command(meson.project_source_root()/'scripts'/'git-submodule.sh',
+              'update', 'roms/SLOF', check: false)
+endif
+
 # Multi arch tests - add cflags only once per src
 multi_src = []
 foreach t: tcg_tests['multiarch-softmmu']['tests']
-- 
2.55.0


Re: [PATCH] tests/tcg/s390x: Restore the SLOF libc include path
Posted by Pierrick Bouvier 1 week, 4 days ago
On 9/14/2026 4:51 PM, Ilya Leoshkevich wrote:
> The meson conversion dropped the SLOF libc include path that commit
> 3fa010d5317 ("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.
>

Would that be possible for you to post the exact compilation error?

If that's a missing string.h header, we can simply add declarations with
implementation we provide here:
https://lore.kernel.org/qemu-devel/20260904124604.2207440-86-alex.bennee@linaro.org/

If there is another missing, we can also fast forward what's needed.

s390x is the only arch having this kind of dependency, so it would be
better to align it with all others and ensure tests are self contained.

> Restore the include path. Add the logic to check out SLOF libc.
> 
> 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/
> Fixes: cd81cf86834 ("tests/tcg/s390x: system tests")
> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
> ---
>  tests/tcg/s390x/system/meson.build | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/tests/tcg/s390x/system/meson.build b/tests/tcg/s390x/system/meson.build
> index ca07f503058..26f47d4184a 100644
> --- a/tests/tcg/s390x/system/meson.build
> +++ b/tests/tcg/s390x/system/meson.build
> @@ -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'
> +slof_inc = meson.project_source_root()/'roms'/'SLOF'/'lib'/'libc'/'include'
>  cflags = ['-nostdlib',
>            '-ffreestanding',
>            '-Wa,--noexecstack',
>            '-I', minilib_dir, minilib_printf,
>            '-I', ipl_inc,
> +          '-I', slof_inc,
>            '-march=z13',
>            head64, console]
>  asmflags = ['-nostdlib',
> @@ -21,6 +23,11 @@ qemu_args = ['-display', 'none',
>               '-serial', 'stdio',
>               '-kernel']
>  
> +if not fs.exists(slof_inc) and get_option('wrap_mode') != 'nodownload'
> +  run_command(meson.project_source_root()/'scripts'/'git-submodule.sh',
> +              'update', 'roms/SLOF', check: false)
> +endif
> +

If we can't update the submodule, we should probably not continue further.

>  # Multi arch tests - add cflags only once per src
>  multi_src = []
>  foreach t: tcg_tests['multiarch-softmmu']['tests']