From: Catalin Patulea <catalinp@google.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
Anthony Liguori <aliguori@us.ibm.com>,
chenwj@iis.sinica.edu.tw, Catalin Patulea <catalinp@google.com>
Subject: [Qemu-devel] [PATCHv3] tests/tcg: fix build
Date: Tue, 16 Oct 2012 02:53:58 -0400 [thread overview]
Message-ID: <1350370438-32610-1-git-send-email-catalinp@google.com> (raw)
In-Reply-To: <Message-ID: <CAFEAcA9=OY0VMzTbvjigDdOMt_4JoJeRds4_t9hni1Zq4ir9EA@mail.gmail.com>
Sorry this got abandoned.. here is a fresh (and slightly leaner) patch on top of master. Can anyone take a look?
---
This broke when the tests were moved from tests/ to tests/tcg/.
On x86_64 host/i386-linux-user non-kvm guest, test-i386 and test-mmap are broken, but at least they build.
To build/run the tests:
$ cd $BUILD_PATH/tests/tcg
$ SRC_PATH=path/to/qemu make <target>
---
tests/tcg/Makefile | 16 ++++++++++------
tests/tcg/linux-test.c | 2 ++
tests/tcg/test-i386.c | 3 ++-
tests/tcg/test_path.c | 13 +++++++------
4 files changed, 21 insertions(+), 13 deletions(-)
diff --git a/tests/tcg/Makefile b/tests/tcg/Makefile
index 15e36a2..9ff47b8 100644
--- a/tests/tcg/Makefile
+++ b/tests/tcg/Makefile
@@ -1,13 +1,13 @@
--include ../config-host.mak
+-include ../../config-host.mak
-include $(SRC_PATH)/rules.mak
-$(call set-vpath, $(SRC_PATH)/tests)
+$(call set-vpath, $(SRC_PATH)/tests/tcg)
-QEMU=../i386-linux-user/qemu-i386
-QEMU_X86_64=../x86_64-linux-user/qemu-x86_64
+QEMU=../../i386-linux-user/qemu-i386
+QEMU_X86_64=../../x86_64-linux-user/qemu-x86_64
CC_X86_64=$(CC_I386) -m64
-QEMU_INCLUDES += -I..
+QEMU_INCLUDES += -I../..
CFLAGS=-Wall -O2 -g -fno-strict-aliasing
#CFLAGS+=-msse2
LDFLAGS=
@@ -36,6 +36,7 @@ TESTS += $(I386_TESTS)
endif
all: $(patsubst %,run-%,$(TESTS))
+test: all
# rules to run tests
@@ -74,7 +75,10 @@ run-test_path: test_path
# rules to compile tests
test_path: test_path.o
+ $(CC_I386) $(LDFLAGS) -o $@ $^ $(LIBS)
+
test_path.o: test_path.c
+ $(CC_I386) $(QEMU_INCLUDES) $(GLIB_CFLAGS) $(CFLAGS) -c -o $@ $^
hello-i386: hello-i386.c
$(CC_I386) -nostdlib $(CFLAGS) -static $(LDFLAGS) -o $@ $<
@@ -86,7 +90,7 @@ testthread: testthread.c
# i386/x86_64 emulation test (test various opcodes) */
test-i386: test-i386.c test-i386-code16.S test-i386-vm86.S \
test-i386.h test-i386-shift.h test-i386-muldiv.h
- $(CC_I386) $(CFLAGS) $(LDFLAGS) -o $@ \
+ $(CC_I386) $(QEMU_INCLUDES) $(CFLAGS) $(LDFLAGS) -o $@ \
$(<D)/test-i386.c $(<D)/test-i386-code16.S $(<D)/test-i386-vm86.S -lm
test-x86_64: test-i386.c \
diff --git a/tests/tcg/linux-test.c b/tests/tcg/linux-test.c
index 2e4a746..83cb32d 100644
--- a/tests/tcg/linux-test.c
+++ b/tests/tcg/linux-test.c
@@ -16,6 +16,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
+#define _GNU_SOURCE
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
@@ -38,6 +39,7 @@
#include <dirent.h>
#include <setjmp.h>
#include <sys/shm.h>
+#include <sched.h>
#define TESTPATH "/tmp/linux-test.tmp"
#define TESTPORT 7654
diff --git a/tests/tcg/test-i386.c b/tests/tcg/test-i386.c
index 8e64bba..64d929e 100644
--- a/tests/tcg/test-i386.c
+++ b/tests/tcg/test-i386.c
@@ -17,6 +17,7 @@
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#define _GNU_SOURCE
+#include "compiler.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -1827,7 +1828,7 @@ void test_exceptions(void)
printf("lock nop exception:\n");
if (setjmp(jmp_env) == 0) {
/* now execute an invalid instruction */
- asm volatile("lock nop");
+ asm volatile(".byte 0xf0, 0x90"); /* lock nop */
}
printf("INT exception:\n");
diff --git a/tests/tcg/test_path.c b/tests/tcg/test_path.c
index 7265a94..a064eea 100644
--- a/tests/tcg/test_path.c
+++ b/tests/tcg/test_path.c
@@ -1,11 +1,12 @@
/* Test path override code */
-#include "../config-host.h"
-#include "../qemu-malloc.c"
-#include "../cutils.c"
-#include "../path.c"
-#include "../trace.c"
+#define _GNU_SOURCE
+#include "config-host.h"
+#include "iov.c"
+#include "cutils.c"
+#include "path.c"
+#include "trace.c"
#ifdef CONFIG_TRACE_SIMPLE
-#include "../simpletrace.c"
+#include "../trace/simple.c"
#endif
#include <stdarg.h>
--
1.7.7.3
next parent reply other threads:[~2012-10-16 6:54 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Message-ID: <CAFEAcA9=OY0VMzTbvjigDdOMt_4JoJeRds4_t9hni1Zq4ir9EA@mail.gmail.com>
2012-10-16 6:53 ` Catalin Patulea [this message]
2012-10-16 12:50 ` [Qemu-devel] [PATCHv3] tests/tcg: fix build Peter Maydell
2012-10-16 18:09 ` Catalin Patulea
2012-10-16 18:47 ` Peter Maydell
2012-10-16 19:34 ` Catalin Patulea
2012-10-16 19:37 ` [Qemu-devel] [PATCHv4] " Catalin Patulea
2012-10-16 19:54 ` Peter Maydell
2012-10-16 19:57 ` Catalin Patulea
2012-10-16 20:09 ` Peter Maydell
2012-10-16 20:00 ` [Qemu-devel] [PATCHv5] " Catalin Patulea
2012-10-16 20:11 ` Peter Maydell
2012-10-19 19:30 ` Aurelien Jarno
2012-07-13 6:55 [Qemu-devel] [PATCH] Get tests/tcg building, fix unused variable warning due to wrong extended asm operand, fix the 'test' make target Catalin Patulea
2012-07-13 8:44 ` 陳韋任 (Wei-Ren Chen)
2012-07-16 18:17 ` Catalin Patulea
2012-07-16 19:08 ` Peter Maydell
2012-07-16 20:00 ` Catalin Patulea
2012-07-16 20:11 ` [Qemu-devel] [PATCH v2] Get tests/tcg building and fix an unused variable warning due to wrong extended asm operands Catalin Patulea
2012-07-16 21:19 ` Peter Maydell
2012-07-17 2:24 ` [Qemu-devel] [PATCH] tests/tcg: add test-i386-fprem and make target for comparing QEMU to h/w Catalin Patulea
2012-07-17 2:33 ` Catalin Patulea
2012-07-17 12:23 ` Peter Maydell
2012-07-17 14:49 ` Catalin Patulea
2012-07-20 22:48 ` Catalin Patulea
2012-07-21 9:03 ` Peter Maydell
2012-07-25 17:06 ` [Qemu-devel] [PATCH v2] " Catalin Patulea
2012-07-28 9:21 ` Blue Swirl
2012-07-20 23:23 ` [Qemu-devel] [PATCH v2] Get tests/tcg building and fix an unused variable warning due to wrong extended asm operands Catalin Patulea
2012-07-21 9:05 ` Peter Maydell
2012-07-16 21:11 ` [Qemu-devel] [PATCH] Get tests/tcg building, fix unused variable warning due to wrong extended asm operand, fix the 'test' make target Peter Maydell
2012-07-16 21:23 ` Catalin Patulea
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1350370438-32610-1-git-send-email-catalinp@google.com \
--to=catalinp@google.com \
--cc=aliguori@us.ibm.com \
--cc=chenwj@iis.sinica.edu.tw \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.