From patchwork Thu Sep 1 09:02:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGFsIFByw612b3puw61r?= X-Patchwork-Id: 664829 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sPxF24fywz9s1h for ; Thu, 1 Sep 2016 19:05:57 +1000 (AEST) Received: from localhost ([::1]:35195 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfNwV-0005cG-RE for incoming@patchwork.ozlabs.org; Thu, 01 Sep 2016 05:05:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51250) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfNth-0001oL-HM for qemu-devel@nongnu.org; Thu, 01 Sep 2016 05:03:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bfNtd-000116-8l for qemu-devel@nongnu.org; Thu, 01 Sep 2016 05:02:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48958) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfNtd-00010p-3M for qemu-devel@nongnu.org; Thu, 01 Sep 2016 05:02:53 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DD3D13B3FB; Thu, 1 Sep 2016 09:02:51 +0000 (UTC) Received: from lisa.redhat.com (vpn-229-7.phx2.redhat.com [10.3.229.7]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u8192od9023332; Thu, 1 Sep 2016 05:02:50 -0400 From: Michal Privoznik To: qemu-devel@nongnu.org Date: Thu, 1 Sep 2016 11:02:41 +0200 Message-Id: <16b62ea67fcc34be255541423fbb1db9cdc1c258.1472720373.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 01 Sep 2016 09:02:51 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] tests: Fix broken tcg test compilation X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: veroniabahaa@gmail.com, pbonzini@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The first build error to be seen is that linux-test.c fails to include cutils.h: linux-test.c:42:25: fatal error: qemu/cutils.h: No such file or directory This is because toplevel include/ dir is not put onto compiler's command line. After that: qemu.git/include/qemu/cutils.h:171:1: error: unknown type name ‘bool’ So we need to include "qemu/osdep.h" which will define bool type for us. However, osdep.h eventually includes glib.h from system, therefore we need to put GLIB_CFLAGS onto compiler's command line too. Lastly, getrusage is used in linux-test.c. This function and a struct it uses are defined in sys/resource.h: linux-test.c:247:5: warning: implicit declaration of function ‘getrusage’ Signed-off-by: Michal Privoznik --- Frankly, with this patch I'm at least able to compile the test suite. Although every test fails with invalid instruction (and a coredump). tests/tcg/Makefile | 6 +++--- tests/tcg/linux-test.c | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/tcg/Makefile b/tests/tcg/Makefile index 89e3342..5eadd8b 100644 --- a/tests/tcg/Makefile +++ b/tests/tcg/Makefile @@ -89,7 +89,7 @@ hello-i386: hello-i386.c strip $@ testthread: testthread.c - $(CC_I386) $(CFLAGS) $(LDFLAGS) -o $@ $< -lpthread + $(CC_I386) $(QEMU_INCLUDES) $(CFLAGS) $(LDFLAGS) -o $@ $< -lpthread # i386/x86_64 emulation test (test various opcodes) */ test-i386: test-i386.c test-i386-code16.S test-i386-vm86.S \ @@ -98,7 +98,7 @@ test-i386: test-i386.c test-i386-code16.S test-i386-vm86.S \ $( #include #include +#include #include #include #include @@ -39,6 +40,7 @@ #include #include #include +#include "qemu/osdep.h" #include "qemu/cutils.h" #define TESTPATH "/tmp/linux-test.tmp"