From patchwork Tue Oct 16 20:00:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catalin Patulea X-Patchwork-Id: 191883 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 05F302C00A7 for ; Wed, 17 Oct 2012 07:00:55 +1100 (EST) Received: from localhost ([::1]:39492 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TODJt-0001Ed-8r for incoming@patchwork.ozlabs.org; Tue, 16 Oct 2012 16:00:53 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51308) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TODJk-0001EK-Pe for qemu-devel@nongnu.org; Tue, 16 Oct 2012 16:00:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TODJd-0000UJ-9p for qemu-devel@nongnu.org; Tue, 16 Oct 2012 16:00:44 -0400 Received: from mail-ie0-f173.google.com ([209.85.223.173]:55560) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TODJd-0000UE-3o for qemu-devel@nongnu.org; Tue, 16 Oct 2012 16:00:37 -0400 Received: by mail-ie0-f173.google.com with SMTP id 17so10348161iea.4 for ; Tue, 16 Oct 2012 13:00:36 -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=bLsPhgEHiZldsNZgNBZcZPHv+HX7GtzNcL9zRQncNSI=; b=YyOwnxGI1upe8Y9tddDR3npLCol3r/alCVPOHS6tYsDGyq13Am6CQagkPytDPeqJRa /Qb6qvcAaN4ogX08bXsotJvfR79WFIEihvKDxG3lhCjMtAp1PBbrryg8uCYRx9GH9R/D cx8NFqk39WXnt4YUkRZq6ks7+Cue+A3GvupYS5lwC6Us/0kEcUKZmveRMhyYUCRglC3Z eo83nu5+EI3HyKFiksg++oL/dh1GepciGpl0j2M1nXxOuBpa5gr0X3YAcQ4gtidZWvQJ rzp/S+CnxTCd+/+WCnspeGpySoToMdnypkAZ+4M9522xCbxW9iuFaTHdlodxg8C+4Wex UeCg== 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=bLsPhgEHiZldsNZgNBZcZPHv+HX7GtzNcL9zRQncNSI=; b=UTgm/qmRQpekQW96ThpnwITI+zlqLaW4yaQ/XtsqpSHv3907r4dv1P5AvF0HVr+7ls oR1fWgIckiprSCLqR5A3i/eJQKsuX4E0h0BdIsig9neZ5LSuUIqtI1Xe1jEsc81FktMH iIFB4XDie5GzPjdiVT6bwBV2g09SKFfLmtlY5zfKWSM52AWwVdbr6z5apwxu1vdzQL3b DPbrDbfzrLyzTETub4Ymdb9GSa+V1t2kZp7JJIp5ll5aPwdplt/rBMgU/bI4MVZ0cSLV jf/oTEGX5e3p+JFV/wRIRpo4+/48pT6y/5HuxHomSRthvWFTJOHIQMPu8SYZ7BYDO0w4 WCjA== Received: by 10.50.140.106 with SMTP id rf10mr13166511igb.48.1350417636384; Tue, 16 Oct 2012 13:00:36 -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 wh5sm9102637igb.17.2012.10.16.13.00.34 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 16 Oct 2012 13:00:35 -0700 (PDT) From: Catalin Patulea To: qemu-devel@nongnu.org Date: Tue, 16 Oct 2012 16:00:23 -0400 Message-Id: <1350417623-7520-1-git-send-email-catalinp@google.com> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: References: X-Gm-Message-State: ALoCoQlip/meGAlFZlUQOF5hXwcG7DnWqdpu489EO71kPyZDnD4LS6uPhTreakazaknbw4UFEeRIzIcCT/qdg/XQoyM3ugngJT97oB45LjAA4Sa2VkLkPcayNZ6TDwTAfe2oS3pqg7QQyndzdzm8RVS5CPOgarvHM91ViLKWf9ssdBPcgEht80gu2RQI0VfJaqcWTHYDHkB4Rj5/JDIiku5idgTcxI+5BCX2E5scS3v9iYSTIDNuevs= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.223.173 Cc: Peter Maydell , Anthony Liguori , chenwj@iis.sinica.edu.tw, Catalin Patulea Subject: [Qemu-devel] [PATCHv5] 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 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 Signed-off-by: Catalin Patulea Reviewed-by: Peter Maydell --- This version adds Signed-off-by and should be compatible with git am. tests/tcg/Makefile | 18 +++++++++++------- tests/tcg/linux-test.c | 2 ++ tests/tcg/test-i386.c | 3 ++- tests/tcg/test_path.c | 13 +++++++------ 4 files changed, 22 insertions(+), 14 deletions(-) diff --git a/tests/tcg/Makefile b/tests/tcg/Makefile index 15e36a2..80b1a4b 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,12 +90,12 @@ 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