Skip to contentSkip to conversation

tests/tcg/s390x: Use the SLOF libc headers for the multiarch tests

PATCH In review Ilya Leoshkevich 3 participants 3 messages Dec 16, 2024 – Jan 3, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/tcg/s390x: Use the SLOF libc headers for the multiarch tests

Compiling the s390x tests on Fedora, which has the s390x cross-compiler installed, fails with:

    In file included from qemu/tests/tcg/s390x/console.c:8:
    qemu/tests/tcg/s390x/../../../pc-bios/s390-ccw/sclp.c:11:10: fatal error: string.h: No such file or directory
       11 | #include <string.h>

This is because Fedora does not have a cross-libc. Since console.c already uses the SLOF libc implementation, add the respective headers to the include path.

---
 tests/tcg/s390x/Makefile.softmmu-target | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tests/tcg/s390x/Makefile.softmmu-target +2 -1
index 969bc5728fa..7adde2fa087 100644
@@ -45,7 +45,8 @@ TESTS += $(ASM_TESTS)
 S390X_MULTIARCH_RUNTIME_OBJS = head64.o console.o $(MINILIB_OBJS)
 $(MULTIARCH_TESTS): $(S390X_MULTIARCH_RUNTIME_OBJS)
 $(MULTIARCH_TESTS): LDFLAGS += $(S390X_MULTIARCH_RUNTIME_OBJS)
-$(MULTIARCH_TESTS): CFLAGS += $(MINILIB_INC)
+$(MULTIARCH_TESTS): CFLAGS += $(MINILIB_INC) \
+			      -I$(SRC_PATH)/roms/SLOF/lib/libc/include/
 memory: CFLAGS += -DCHECK_UNALIGNED=0
 
 # s390x clears the BSS section so we need to account for that
Signature · 1 line
2.47.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Ilya Leoshkevich

Compiling the s390x tests on Fedora, which has the s390x cross-compiler installed, fails with:

     In file included from qemu/tests/tcg/s390x/console.c:8:
     qemu/tests/tcg/s390x/../../../pc-bios/s390-ccw/sclp.c:11:10: fatal error: string.h: No such file or directory
        11 | #include <string.h>
Quoted 8 lines

This is because Fedora does not have a cross-libc. Since console.c already uses the SLOF libc implementation, add the respective headers to the include path.

---
  tests/tcg/s390x/Makefile.softmmu-target | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
Tested-by on v1 1/1
#2 lore raw
In reply to Ilya Leoshkevich
Quoted 21 lines · Ilya Leoshkevich

Compiling the s390x tests on Fedora, which has the s390x cross-compiler installed, fails with:

     In file included from qemu/tests/tcg/s390x/console.c:8:
     qemu/tests/tcg/s390x/../../../pc-bios/s390-ccw/sclp.c:11:10: fatal error: string.h: No such file or directory
        11 | #include <string.h>

This is because Fedora does not have a cross-libc. Since console.c already uses the SLOF libc implementation, add the respective headers to the include path.

---
  tests/tcg/s390x/Makefile.softmmu-target | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
tests/tcg/s390x/Makefile.softmmu-target +0 -0
index 969bc5728fa..7adde2fa087 100644

tests/tcg/s390x/Makefile.softmmu-target TESTS += $(ASM_TESTS) · line 52

Quoted 9 lines
tests/tcg/s390x/Makefile.softmmu-target +2 -1
@@ -45,7 +45,8 @@ TESTS += $(ASM_TESTS)
  S390X_MULTIARCH_RUNTIME_OBJS = head64.o console.o $(MINILIB_OBJS)
  $(MULTIARCH_TESTS): $(S390X_MULTIARCH_RUNTIME_OBJS)
  $(MULTIARCH_TESTS): LDFLAGS += $(S390X_MULTIARCH_RUNTIME_OBJS)
-$(MULTIARCH_TESTS): CFLAGS += $(MINILIB_INC)
+$(MULTIARCH_TESTS): CFLAGS += $(MINILIB_INC) \
+			      -I$(SRC_PATH)/roms/SLOF/lib/libc/include/
  memory: CFLAGS += -DCHECK_UNALIGNED=0
 
  # s390x clears the BSS section so we need to account for that

... and queued for my next pull request, thanks!