From patchwork Tue Oct 16 06:53:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catalin Patulea X-Patchwork-Id: 191734 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4654A2C00A6 for ; Tue, 16 Oct 2012 17:54:20 +1100 (EST) Received: from localhost ([::1]:34508 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TO12g-0001Z3-IW for incoming@patchwork.ozlabs.org; Tue, 16 Oct 2012 02:54:18 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55967) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TO12Z-0001Yy-Fw for qemu-devel@nongnu.org; Tue, 16 Oct 2012 02:54:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TO12X-0001gr-F5 for qemu-devel@nongnu.org; Tue, 16 Oct 2012 02:54:11 -0400 Received: from mail-ia0-f173.google.com ([209.85.210.173]:60702) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TO12X-0001gi-8U for qemu-devel@nongnu.org; Tue, 16 Oct 2012 02:54:09 -0400 Received: by mail-ia0-f173.google.com with SMTP id m10so4322531iam.4 for ; Mon, 15 Oct 2012 23:54:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=rr9TupNwBE0K2HppfUhvNZZFKiF3Nie+IoTPDWyrvQ8=; b=TZbl6E1k5xqGeCyREg4ivWVSdmC4hMeOClYNLvt0+EXr6bx5cFjHMF8OG+JvGOqVJf em6rLDWOtjgGH5qJIFfOe/Vcl/Ax/UHxpDA0P46Bnu2/Mn/f5ntsCagxIgl9i+k3r72s kiAYXRYtzXr8NSKkGrjdXCaYbXsWWyqlX0Nzny3cHMCQVqx8OTMAJdRqiL0ymm3xb9UO +eXGBUzgFn4N1Q44NDz2aBWfAMNMxqp2QuEuWsAZ95jQLGJpnQe+p5hLjPeMawSYCgIR yJSfIEHPU7XVyaS25HhS9FJau2LmnvBrW0pVVN4lw/HNU73r25BP6jfiKML/IyFC/zTA wwmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=rr9TupNwBE0K2HppfUhvNZZFKiF3Nie+IoTPDWyrvQ8=; b=iZhGOUq/8AS86gm0TLAljFggxlplzqVG6AHBacnDC7AriNXjGMZHD2fmGvHgEQfJ0/ /uiw0GStL0VbLV4paLs/SCVO8yVWoGXauTomh1nFagU2tuIO9WSSvui4kShmboua87Bd RzN1PEBrwG7pWpQVaywvNoA5p/xwiMSQC84mxVtbocP+x/n1LxI4IMAidS2qgn5vXCSR 0eOj7PnAjBvSeYBa1pcpL+sCWhbN/pXKgV/6KL+SUspvD6emJaPqjBPKjY2NAFMhPc7r AlgkxpAhzIn1cD6wXD5LfLe3JcaiboOspLfUMRjsu6cFLF2S9FSkH3wQsxFoO7pedLa7 A6jw== Received: by 10.50.193.170 with SMTP id hp10mr11268826igc.63.1350370446654; Mon, 15 Oct 2012 23:54:06 -0700 (PDT) Received: from gibson.mon.corp.google.com (gibson.mon.corp.google.com [172.29.33.50]) by mx.google.com with ESMTPS id 10sm7852038ign.5.2012.10.15.23.54.05 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 15 Oct 2012 23:54:05 -0700 (PDT) From: Catalin Patulea To: qemu-devel@nongnu.org Date: Tue, 16 Oct 2012 02:53:58 -0400 Message-Id: <1350370438-32610-1-git-send-email-catalinp@google.com> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: References: X-Gm-Message-State: ALoCoQnPgq8bmgBO57thPReDQ+K7wZfzJfYIy3zFHIN8eBWqp1TkjkQ0MKZQd01U5uQABY7QmX012qHR7iq2Jro9wNPnut3byd/uOzEfH/MgpBWI112hRI3IKz+uzYyoZO72hj5JXueiR6ILvteo1Rk7aBgO+tqlXlkI5cABw1nuBls6DGrhDGcyVLKxM39yP2KNFYmkl7865uaFSx/6tJ1IEVd7knkhqeJJUWXooRz+MHudpYh2CCg= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.210.173 Cc: Peter Maydell , Anthony Liguori , chenwj@iis.sinica.edu.tw, Catalin Patulea Subject: [Qemu-devel] [PATCHv3] tests/tcg: fix build X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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 $@ \ $(. */ +#define _GNU_SOURCE #include #include #include @@ -38,6 +39,7 @@ #include #include #include +#include #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 . */ #define _GNU_SOURCE +#include "compiler.h" #include #include #include @@ -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