Skip to contentSkip to conversation

tests/tcg/s390x: Restore the SLOF libc include path

PATCH In review Ilya Leoshkevich 2 participants 2 messages Sep 14 – Sep 15 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

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

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.

---
 tests/tcg/s390x/system/meson.build | 7 +++++++
 1 file changed, 7 insertions(+)
tests/tcg/s390x/system/meson.build +7 -0
index ca07f503058..26f47d4184a 100644
@@ -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']
Signature · 1 line
2.55.0
#1 lore raw
Quoted 5 lines · Ilya Leoshkevich

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/[email protected]/

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.

Quoted 30 lines

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

---
 tests/tcg/s390x/system/meson.build | 7 +++++++
 1 file changed, 7 insertions(+)
tests/tcg/s390x/system/meson.build +2 -0
index ca07f503058..26f47d4184a 100644
@@ -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',

tests/tcg/s390x/system/meson.build qemu_args = ['-display', 'none', · line 30

Quoted 8 lines
tests/tcg/s390x/system/meson.build +5 -0
@@ -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.

Quoted 3 lines
tests/tcg/s390x/system/meson.build +0 -0
 # Multi arch tests - add cflags only once per src
 multi_src = []
 foreach t: tcg_tests['multiarch-softmmu']['tests']