Skip to contentSkip to conversation

tests/tcg/s390x: Use -nostdlib for softmmu tests

PATCH In review Ilya Leoshkevich 4 participants 4 messages Jan 31, 2023 – Feb 1, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/tcg/s390x: Use -nostdlib for softmmu tests

The code currently uses -nostartfiles, but this does not prevent linking with libc. On Fedora there is no cross-libc, so the linking step fails.

Fix by using the more comprehensive -nostdlib (that's also what probe_target_compiler() checks for as well).

Fixes 503e549e441e ("tests/tcg/s390x: Test unaligned accesses to lowcore")
---
 tests/tcg/s390x/Makefile.softmmu-target | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/tcg/s390x/Makefile.softmmu-target +1 -1
index a34fa68473e..50c1b88065d 100644
@@ -3,7 +3,7 @@ VPATH+=$(S390X_SRC)
 QEMU_OPTS=-action panic=exit-failure -kernel
 
 %: %.S
-	$(CC) -march=z13 -m64 -nostartfiles -static -Wl,-Ttext=0 \
+	$(CC) -march=z13 -m64 -nostdlib -static -Wl,-Ttext=0 \
 		-Wl,--build-id=none $< -o $@
 
 TESTS += unaligned-lowcore
Signature · 1 line
2.39.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Ilya Leoshkevich

The code currently uses -nostartfiles, but this does not prevent linking with libc. On Fedora there is no cross-libc, so the linking step fails.

Quoted 8 lines

Fix by using the more comprehensive -nostdlib (that's also what probe_target_compiler() checks for as well).

Fixes 503e549e441e ("tests/tcg/s390x: Test unaligned accesses to lowcore")
---
  tests/tcg/s390x/Makefile.softmmu-target | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

r~

Reviewed-by on v1 1/1
#2 lore raw
In reply to Ilya Leoshkevich
Quoted 18 lines · Ilya Leoshkevich

The code currently uses -nostartfiles, but this does not prevent linking with libc. On Fedora there is no cross-libc, so the linking step fails.

Fix by using the more comprehensive -nostdlib (that's also what probe_target_compiler() checks for as well).

Fixes 503e549e441e ("tests/tcg/s390x: Test unaligned accesses to lowcore")
---
 tests/tcg/s390x/Makefile.softmmu-target | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/tcg/s390x/Makefile.softmmu-target +0 -0
index a34fa68473e..50c1b88065d 100644

tests/tcg/s390x/Makefile.softmmu-target VPATH+=$(S390X_SRC) · line 9

Quoted 8 lines
tests/tcg/s390x/Makefile.softmmu-target +1 -1
@@ -3,7 +3,7 @@ VPATH+=$(S390X_SRC)
 QEMU_OPTS=-action panic=exit-failure -kernel
 
 %: %.S
-	$(CC) -march=z13 -m64 -nostartfiles -static -Wl,-Ttext=0 \
+	$(CC) -march=z13 -m64 -nostdlib -static -Wl,-Ttext=0 \
 		-Wl,--build-id=none $< -o $@
 
 TESTS += unaligned-lowcore

I take it this will go via the s390x tree?

Signature · 2 lines
Alex Bennée
Virtualisation Tech Lead @ Linaro
Reviewed-by on v1 1/1
#3 lore raw
In reply to Ilya Leoshkevich
Quoted 4 lines · Ilya Leoshkevich

The code currently uses -nostartfiles, but this does not prevent linking with libc. On Fedora there is no cross-libc, so the linking step fails.

Quoted 8 lines

Fix by using the more comprehensive -nostdlib (that's also what probe_target_compiler() checks for as well).

Fixes 503e549e441e ("tests/tcg/s390x: Test unaligned accesses to lowcore")
---
  tests/tcg/s390x/Makefile.softmmu-target | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)