]> git.proxmox.com Git - mirror_qemu.git/commitdiff
tests/tcg: compile system emulation tests as freestanding
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 22 Jun 2022 09:06:27 +0000 (11:06 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 6 Jul 2022 07:31:16 +0000 (09:31 +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
tests/tcg/aarch64/system/pauth-3.c
tests/tcg/aarch64/system/semiconsole.c
tests/tcg/aarch64/system/semiheap.c
tests/tcg/multiarch/system/memory.c

index f427a0304e97d098329048c849e738b4ec644ed5..e68830af15b85d42406ecb54b232ed46f784e6cd 100644 (file)
@@ -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
index 42eff4d5eae926e041837b7aa5a8677299430a65..77a467277bc01ee305b685912ae8bb7a32c525a9 100644 (file)
@@ -1,4 +1,4 @@
-#include <inttypes.h>
+#include <stdint.h>
 #include <minilib.h>
 
 int main()
index bfe7c9e26b43301a0385b9feb14c38ccbfb2ca2e..81324c639f70677466b30d7aca6ba4ef3377f2a9 100644 (file)
@@ -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
index 4ed258476d5c82407e7778a28594c2a8f3f07e30..a254bd8982c4a75e08a04be7f0d6a1236dfee1ad 100644 (file)
@@ -6,7 +6,7 @@
  * SPDX-License-Identifier: GPL-2.0-or-later
  */
 
-#include <inttypes.h>
+#include <stdint.h>
 #include <stddef.h>
 #include <minilib.h>
 
index 41c7f66e2ed90ee3c8fa8f037b7f852e0ac19e21..214f7d4f54b7bf5d4ed2614bb9d88d03dee6b5ff 100644 (file)
@@ -12,7 +12,7 @@
  *   - sign extension when loading
  */
 
-#include <inttypes.h>
+#include <stdint.h>
 #include <stdbool.h>
 #include <minilib.h>