Re: [Qemu-devel] [PATCH v1 14/24] tests/tcg/i386: fix test-i386

2018-04-15 Thread Philippe Mathieu-Daudé
On 04/10/2018 04:39 PM, Alex Bennée wrote:
> The test-i386 test case is a little special as it includes assembler
> files. Add the additional compile magic to assemble these bits and
> link them to the final binary.
> 
> Signed-off-by: Alex Bennée 

Reviewed-by: Philippe Mathieu-Daudé 
Tested-by: Philippe Mathieu-Daudé 

> ---
>  tests/tcg/i386/Makefile.target | 19 +++
>  tests/tcg/i386/test-i386.c |  1 -
>  2 files changed, 19 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/tcg/i386/Makefile.target b/tests/tcg/i386/Makefile.target
> index 7dbb7992e7..1df69e0dab 100644
> --- a/tests/tcg/i386/Makefile.target
> +++ b/tests/tcg/i386/Makefile.target
> @@ -8,3 +8,22 @@ ifdef CROSS_CC_GUEST_CFLAGS
>  CFLAGS+=$(CROSS_CC_GUEST_CFLAGS)
>  endif
>  endif
> +
> +#
> +# test-386 includes a couple of additional objects that need to be linked 
> together
> +#
> +
> +TEST_I386_DEPS=test-i386-code16.o test-i386-vm86.o
> +
> +# override the default compile and link in one go rule
> +test-i386.o: test-i386.c
> + $(CC) $(CFLAGS) -c $< -o $@
> +
> +# and provide a rule to compile .S files
> +%.o: %.S
> + $(CC) $(CFLAGS) -c $< -o $@
> +
> +test-i386: LDFLAGS+=-lm -lc
> +test-i386: test-i386.o $(TEST_I386_DEPS)
> + $(LD) -melf_i386 $(LDFLAGS) $< $(TEST_I386_DEPS) -o $@
> +
> diff --git a/tests/tcg/i386/test-i386.c b/tests/tcg/i386/test-i386.c
> index 9599204895..cae6a7773a 100644
> --- a/tests/tcg/i386/test-i386.c
> +++ b/tests/tcg/i386/test-i386.c
> @@ -17,7 +17,6 @@
>   *  along with this program; if not, see .
>   */
>  #define _GNU_SOURCE
> -#include "qemu/compiler.h"
>  #include 
>  #include 
>  #include 
> 



Re: [Qemu-devel] [PATCH v1 14/24] tests/tcg/i386: fix test-i386

2018-04-11 Thread Thomas Huth
On 10.04.2018 21:39, Alex Bennée wrote:
> The test-i386 test case is a little special as it includes assembler
> files. Add the additional compile magic to assemble these bits and
> link them to the final binary.
> 
> Signed-off-by: Alex Bennée 
> ---
>  tests/tcg/i386/Makefile.target | 19 +++
>  tests/tcg/i386/test-i386.c |  1 -
>  2 files changed, 19 insertions(+), 1 deletion(-)

Reviewed-by: Thomas Huth 



[Qemu-devel] [PATCH v1 14/24] tests/tcg/i386: fix test-i386

2018-04-10 Thread Alex Bennée
The test-i386 test case is a little special as it includes assembler
files. Add the additional compile magic to assemble these bits and
link them to the final binary.

Signed-off-by: Alex Bennée 
---
 tests/tcg/i386/Makefile.target | 19 +++
 tests/tcg/i386/test-i386.c |  1 -
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/tests/tcg/i386/Makefile.target b/tests/tcg/i386/Makefile.target
index 7dbb7992e7..1df69e0dab 100644
--- a/tests/tcg/i386/Makefile.target
+++ b/tests/tcg/i386/Makefile.target
@@ -8,3 +8,22 @@ ifdef CROSS_CC_GUEST_CFLAGS
 CFLAGS+=$(CROSS_CC_GUEST_CFLAGS)
 endif
 endif
+
+#
+# test-386 includes a couple of additional objects that need to be linked 
together
+#
+
+TEST_I386_DEPS=test-i386-code16.o test-i386-vm86.o
+
+# override the default compile and link in one go rule
+test-i386.o: test-i386.c
+   $(CC) $(CFLAGS) -c $< -o $@
+
+# and provide a rule to compile .S files
+%.o: %.S
+   $(CC) $(CFLAGS) -c $< -o $@
+
+test-i386: LDFLAGS+=-lm -lc
+test-i386: test-i386.o $(TEST_I386_DEPS)
+   $(LD) -melf_i386 $(LDFLAGS) $< $(TEST_I386_DEPS) -o $@
+
diff --git a/tests/tcg/i386/test-i386.c b/tests/tcg/i386/test-i386.c
index 9599204895..cae6a7773a 100644
--- a/tests/tcg/i386/test-i386.c
+++ b/tests/tcg/i386/test-i386.c
@@ -17,7 +17,6 @@
  *  along with this program; if not, see .
  */
 #define _GNU_SOURCE
-#include "qemu/compiler.h"
 #include 
 #include 
 #include 
-- 
2.16.2