[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 09/18] tests/tcg: compile system emulation tests as freestanding
From: |
Paolo Bonzini |
Subject: |
[PULL 09/18] tests/tcg: compile system emulation tests as freestanding |
Date: |
Tue, 12 Jul 2022 14:49:47 +0200 |
System emulation tests do not run in a hosted environment, since they
do not link with libc. They should only use freestanding headers
(float.h, limits.h, stdarg.h, stddef.h, stdbool.h, stdint.h,
stdalign.h, stdnoreturn.h) and should be compiled with -ffreestanding
in order to use the compiler implementation of those headers
rather than the one in libc.
Some tests are using inttypes.h instead of stdint.h, so fix that.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
tests/tcg/Makefile.target | 1 +
tests/tcg/aarch64/system/pauth-3.c | 2 +-
tests/tcg/aarch64/system/semiconsole.c | 2 +-
tests/tcg/aarch64/system/semiheap.c | 2 +-
tests/tcg/multiarch/system/memory.c | 2 +-
5 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/tests/tcg/Makefile.target b/tests/tcg/Makefile.target
index f427a0304e..e68830af15 100644
--- a/tests/tcg/Makefile.target
+++ b/tests/tcg/Makefile.target
@@ -111,6 +111,7 @@ else
# For softmmu targets we include a different Makefile fragement as the
# build options for bare programs are usually pretty different. They
# are expected to provide their own build recipes.
+EXTRA_CFLAGS += -ffreestanding
-include $(SRC_PATH)/tests/tcg/minilib/Makefile.target
-include $(SRC_PATH)/tests/tcg/multiarch/system/Makefile.softmmu-target
-include $(SRC_PATH)/tests/tcg/$(TARGET_NAME)/Makefile.softmmu-target
diff --git a/tests/tcg/aarch64/system/pauth-3.c
b/tests/tcg/aarch64/system/pauth-3.c
index 42eff4d5ea..77a467277b 100644
--- a/tests/tcg/aarch64/system/pauth-3.c
+++ b/tests/tcg/aarch64/system/pauth-3.c
@@ -1,4 +1,4 @@
-#include <inttypes.h>
+#include <stdint.h>
#include <minilib.h>
int main()
diff --git a/tests/tcg/aarch64/system/semiconsole.c
b/tests/tcg/aarch64/system/semiconsole.c
index bfe7c9e26b..81324c639f 100644
--- a/tests/tcg/aarch64/system/semiconsole.c
+++ b/tests/tcg/aarch64/system/semiconsole.c
@@ -6,7 +6,7 @@
* SPDX-License-Identifier: GPL-2.0-or-later
*/
-#include <inttypes.h>
+#include <stdint.h>
#include <minilib.h>
#define SYS_READC 0x7
diff --git a/tests/tcg/aarch64/system/semiheap.c
b/tests/tcg/aarch64/system/semiheap.c
index 4ed258476d..a254bd8982 100644
--- a/tests/tcg/aarch64/system/semiheap.c
+++ b/tests/tcg/aarch64/system/semiheap.c
@@ -6,7 +6,7 @@
* SPDX-License-Identifier: GPL-2.0-or-later
*/
-#include <inttypes.h>
+#include <stdint.h>
#include <stddef.h>
#include <minilib.h>
diff --git a/tests/tcg/multiarch/system/memory.c
b/tests/tcg/multiarch/system/memory.c
index 41c7f66e2e..214f7d4f54 100644
--- a/tests/tcg/multiarch/system/memory.c
+++ b/tests/tcg/multiarch/system/memory.c
@@ -12,7 +12,7 @@
* - sign extension when loading
*/
-#include <inttypes.h>
+#include <stdint.h>
#include <stdbool.h>
#include <minilib.h>
--
2.36.1
- [PULL 00/18] Misc patches for 2022-07-12, Paolo Bonzini, 2022/07/12
- [PULL 01/18] tests/vm: do not specify -bios option, Paolo Bonzini, 2022/07/12
- [PULL 02/18] scsi/lsi53c895a: fix use-after-free in lsi_do_msgout (CVE-2022-0216), Paolo Bonzini, 2022/07/12
- [PULL 07/18] configure: allow more host/target combos to use the host compiler, Paolo Bonzini, 2022/07/12
- [PULL 05/18] configure, pc-bios/s390-ccw: pass cross CFLAGS correctly, Paolo Bonzini, 2022/07/12
- [PULL 03/18] pc-bios/optionrom: use -m16 unconditionally, Paolo Bonzini, 2022/07/12
- [PULL 12/18] build: improve -fsanitize-coverage-allowlist check, Paolo Bonzini, 2022/07/12
- [PULL 14/18] audio/dbus: fix building, Paolo Bonzini, 2022/07/12
- [PULL 10/18] configure: pass whole target name to probe_target_compiler, Paolo Bonzini, 2022/07/12
- [PULL 09/18] tests/tcg: compile system emulation tests as freestanding,
Paolo Bonzini <=
- [PULL 04/18] configure, pc-bios/optionrom: pass cross CFLAGS correctly, Paolo Bonzini, 2022/07/12
- [PULL 16/18] build: Do not depend on pc-bios for config-host.mak, Paolo Bonzini, 2022/07/12
- [PULL 15/18] accel: kvm: Fix memory leak in find_stats_descriptors, Paolo Bonzini, 2022/07/12
- [PULL 06/18] configure, pc-bios/vof: pass cross CFLAGS correctly, Paolo Bonzini, 2022/07/12
- [PULL 17/18] qga: Relocate a path emitted in the help text, Paolo Bonzini, 2022/07/12
- [PULL 18/18] meson: place default firmware path under .../share, Paolo Bonzini, 2022/07/12
- [PULL 11/18] build: try both native and cross compilers, Paolo Bonzini, 2022/07/12
- [PULL 08/18] configure: write EXTRA_CFLAGS for all sub-Makefiles, Paolo Bonzini, 2022/07/12