Enable building and running tcg tests on i386
cover Enable building and running tcg tests on i386
The primary motivation of this patch series is to get "make -C tests/tcg", on i386, to run. Having all of the individual i386 tcg tests passing is beyond the scope of this patch series, though.
The secondary motivation is to gather feedback on the status of the tcg tests. If you have strong opinions about it, be that they need to be nourished and cared for, that they should be eliminated completely, or anything in between, I'd love to hear about it.
Cleber Rosa(6):
tests/tcg/test_path.c: include utils/bufferiszero.c tests/tcg/linux-test.c: remove unused include of "qemu/cutils.h" tests/tcg/linux-test.c: include definitions for getrusage() tests/tcg/test-i386-fprem: build with $(QEMU_CFLAGS) tests/tcg/test-i386-fprem.c: compilation fix for -Werror=strict-prototype tests/tcg/test-i386-fprem.c: compilation fix for -Werror=unused-const-variable=
tests/tcg/Makefile | 2 +- tests/tcg/linux-test.c | 2 +- tests/tcg/test-i386-fprem.c | 17 +---------------- tests/tcg/test_path.c | 1 + 4 files changed, 4 insertions(+), 18 deletions(-)
PATCH 1/6 tests/tcg/test_path.c: include utils/bufferiszero.c
Which contains one specific function used by iov.c.
Without this, "make -C tests/tcg test_path" (and consequently "make -C tests/tcg" or simply "make test") fails quite early.
--- tests/tcg/test_path.c | 1 + 1 file changed, 1 insertion(+)
tests/tcg/test_path.c +1 -0
@@ -3,6 +3,7 @@#include "util/cutils.c" #include "util/hexdump.c" #include "util/iov.c" +#include "util/bufferiszero.c" #include "util/path.c" #include "util/qemu-timer-common.c" #include <stdarg.h>
Signature · 1 line
2.9.4
Re: [Qemu-devel] [PATCH 1/6] tests/tcg/test_path.c: include utils/bufferiszero.c
Hi Cleber,
Quoted 15 lines · Cleber Rosa
Which contains one specific function used by
iov.c.Without this, "make -C tests/tcg
test_path" (and consequently "make -C tests/tcg" or simply "make test") fails quite early.Signed-off-by Cleber Rosa <[email protected]>--- tests/tcg/test_path.c | 1 + 1 file changed, 1 insertion(+)tests/tcg/test_path.c +0
-0
tests/tcg/test_path.c line 6
Quoted 4 lines
tests/tcg/test_path.c +1
-0@@ -3,6 +3,7 @@#include "util/cutils.c" #include "util/hexdump.c" #include "util/iov.c" +#include "util/bufferiszero.c"
This fixes the build, however why not take this opportunity to fix it through the Makefile instead of including .c?
Regards,
Phil.
Quoted 4 lines
tests/tcg/test_path.c +0
-0#include "util/path.c" #include "util/qemu-timer-common.c" #include <stdarg.h>
Re: [Qemu-devel] [PATCH 1/6] tests/tcg/test_path.c: include utils/bufferiszero.c
Quoted 13 lines · Philippe Mathieu-Daudé
Hi Cleber,
Quoted 10 lines · Cleber Rosa
Which contains one specific function used by
iov.c.Without this, "make -C tests/tcg
test_path" (and consequently "make -C tests/tcg" or simply "make test") fails quite early.Signed-off-by Cleber Rosa <[email protected]>--- tests/tcg/test_path.c | 1 + 1 file changed, 1 insertion(+)
Quoted 13 lines
tests/tcg/test_path.c line 6
Quoted 9 lines
tests/tcg/test_path.c +1
-0@@ -3,6 +3,7 @@#include "util/cutils.c" #include "util/hexdump.c" #include "util/iov.c" +#include "util/bufferiszero.c" This fixes the build, however why not take this opportunity to fix it through the
Makefileinstead of including .c?
Do you mean for all of the .c includes? I just took a baby step, which seemed more consistent with the mission (get it to build), without changing a lot.
Quoted 4 lines
Regards,
Phil.
Thanks for the review!
- Cleber.
Quoted 4 lines
Quoted 4 lines
tests/tcg/test_path.c +0
-0#include "util/path.c" #include "util/qemu-timer-common.c" #include <stdarg.h>
Signature · 4 lines
Cleber Rosa [ Sr Software Engineer - Virtualization Team - Red Hat ] [ Avocado Test Framework - avocado-framework.github.io ] [ 7ABB 96EB 8B46 B94D 5E0F E9BB 657E 8D33 A5F2 09F3 ]
Re: [Qemu-devel] [PATCH 1/6] tests/tcg/test_path.c: include utils/bufferiszero.c
Quoted 30 lines · Cleber Rosa
Quoted 13 lines · Philippe Mathieu-Daudé
Hi Cleber,
Quoted 10 lines · Cleber Rosa
Which contains one specific function used by
iov.c.Without this, "make -C tests/tcg
test_path" (and consequently "make -C tests/tcg" or simply "make test") fails quite early.Signed-off-by Cleber Rosa <[email protected]>--- tests/tcg/test_path.c | 1 + 1 file changed, 1 insertion(+)Quoted 13 lines
tests/tcg/test_path.c line 6
Quoted 9 lines
tests/tcg/test_path.c +1
-0@@ -3,6 +3,7 @@#include "util/cutils.c" #include "util/hexdump.c" #include "util/iov.c" +#include "util/bufferiszero.c" This fixes the build, however why not take this opportunity to fix it through the
Makefileinstead of including .c?
Quoted 4 lines
Do you mean for all of the .c includes? I just took a baby step, which seemed more consistent with the mission (get it to build), without changing a lot.
Hi Phil,
Can you clarify what you meant here?
Thanks!
Signature · 4 lines
Cleber Rosa [ Sr Software Engineer - Virtualization Team - Red Hat ] [ Avocado Test Framework - avocado-framework.github.io ] [ 7ABB 96EB 8B46 B94D 5E0F E9BB 657E 8D33 A5F2 09F3 ]
PATCH 2/6 tests/tcg/linux-test.c: remove unused include of "qemu/cutils.h"
In reply to Cleber RosaBuilding tests/tcg/linux-test is not currently possible because $(QEMU_INCLUDES) is not being passed to $(CC_I386). But, since it's not really used, instead of adding the $(QEMU_INCLUDES), let's remove the "qemu/ctuils.h" include instead.
--- tests/tcg/linux-test.c | 1 - 1 file changed, 1 deletion(-)
tests/tcg/linux-test.c +0 -1
@@ -39,7 +39,6 @@#include <dirent.h> #include <setjmp.h> #include <sys/shm.h> -#include "qemu/cutils.h" #define TESTPATH "/tmp/linux-test.tmp"#define TESTPORT 7654
Signature · 1 line
2.9.4
PATCH 3/6 tests/tcg/linux-test.c: include definitions for getrusage()
In reply to Cleber RosaA include for <sys/resources.h> is missing, and prevents tests/tcg/linux-test from compiling.
--- tests/tcg/linux-test.c | 1 + 1 file changed, 1 insertion(+)
tests/tcg/linux-test.c +1 -0
@@ -39,6 +39,7 @@#include <dirent.h> #include <setjmp.h> #include <sys/shm.h> +#include <sys/resource.h> #define TESTPATH "/tmp/linux-test.tmp"#define TESTPORT 7654
Signature · 1 line
2.9.4
Re: [Qemu-devel] [PATCH 3/6] tests/tcg/linux-test.c: include definitions for getrusage()
Hi Cleber,
Quoted 2 lines · Cleber Rosa
A include for <
sys/resources.h> is missing, and prevents tests/tcg/linux-test from compiling.
getrusage() I presume, don't know if worth adding in commit message.
Quoted 2 lines
Signed-off-by Cleber Rosa <[email protected]>
Quoted 17 lines
--- tests/tcg/linux-test.c | 1 + 1 file changed, 1 insertion(+)tests/tcg/linux-test.c +1
-0@@ -39,6 +39,7 @@#include <dirent.h> #include <setjmp.h> #include <sys/shm.h> +#include <sys/resource.h> #define TESTPATH "/tmp/linux-test.tmp"#define TESTPORT 7654
Re: [Qemu-devel] [PATCH 3/6] tests/tcg/linux-test.c: include definitions for getrusage()
Quoted 9 lines · Philippe Mathieu-Daudé
Hi Cleber,
Quoted 3 lines · Cleber Rosa
A include for <
sys/resources.h> is missing, and prevents tests/tcg/linux-test from compiling.
getrusage()I presume, don't know if worth adding in commit message.
Sorry I missed it from the commit subject :/
Quoted 25 lines
Quoted 3 lines
Signed-off-by Cleber Rosa <[email protected]>Reviewed-by Philippe Mathieu-Daudé <[email protected]>Quoted 16 lines
--- tests/tcg/linux-test.c | 1 + 1 file changed, 1 insertion(+)tests/tcg/linux-test.c +1
-0@@ -39,6 +39,7 @@#include <dirent.h> #include <setjmp.h> #include <sys/shm.h> +#include <sys/resource.h> #define TESTPATH "/tmp/linux-test.tmp"#define TESTPORT 7654
PATCH 4/6 tests/tcg/test-i386-fprem: build with $(QEMU_CFLAGS)
In reply to Cleber RosaSo that glib.h can be found.
--- tests/tcg/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/tcg/Makefile +1 -1
@@ -98,7 +98,7 @@ test-i386: test-i386.c test-i386-code16.S test-i386-vm86.S \ $(<D)/test-i386.c $(<D)/test-i386-code16.S $(<D)/test-i386-vm86.S -lm test-i386-fprem: test-i386-fprem.c - $(CC_I386) $(QEMU_INCLUDES) $(CFLAGS) $(LDFLAGS) -o $@ $^ + $(CC_I386) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $^ test-x86_64: test-i386.c \ test-i386.h test-i386-shift.h test-i386-muldiv.h
Signature · 1 line
2.9.4
PATCH 5/6 tests/tcg/test-i386-fprem.c: compilation fix for -Werror=strict-prototype
In reply to Cleber RosaA trivial fix to make the compiler happy.
--- tests/tcg/test-i386-fprem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/tcg/test-i386-fprem.c +1 -1
@@ -98,7 +98,7 @@ static const union float80u smallest_positive_norm = { .ieee.mantissa = 0, }; -static void fninit () +static void fninit (void ) { asmvolatile ("fninit\n" ); }
Signature · 1 line
2.9.4
PATCH 6/6 tests/tcg/test-i386-fprem.c: compilation fix for -Werror=unused-const-variable=
In reply to Cleber RosaA clean up of unused code to make the compiler happy.
--- tests/tcg/test-i386-fprem.c | 15 --------------- 1 file changed, 15 deletions(-)
tests/tcg/test-i386-fprem.c +0 -15
@@ -54,14 +54,6 @@ union float80u {#define IEEE854_LONG_DOUBLE_BIAS 0x3fff -static const union float80u q_nan = { - .ieee_nan.negative =0 ,/* X */ - .ieee_nan.exponent =0x7fff , - .ieee_nan.one =1 , - .ieee_nan.quiet_nan =1 , - .ieee_nan.mantissa =0 , -}; -static const union float80u s_nan = { .ieee_nan.negative =0 ,/* X */ .ieee_nan.exponent =0x7fff ,
@@ -91,13 +83,6 @@ static const union float80u pos_denorm = { .ieee.mantissa = 1, }; -static const union float80u smallest_positive_norm = { - .ieee.negative =0 , - .ieee.exponent =1 , - .ieee.one =1 , - .ieee.mantissa =0 , -}; -static void fninit (void ) { asmvolatile ("fninit\n" );
Signature · 1 line
2.9.4