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: Michal Privoznik X-Patchwork-Id: 9308577 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4C5DE60756 for ; Thu, 1 Sep 2016 09:04:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B813292A2 for ; Thu, 1 Sep 2016 09:04:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2FA5F292AB; Thu, 1 Sep 2016 09:04:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9B1B4292A2 for ; Thu, 1 Sep 2016 09:04:58 +0000 (UTC) Received: from localhost ([::1]:33831 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfNvc-0003yh-Lk for patchwork-qemu-devel@patchwork.kernel.org; Thu, 01 Sep 2016 05:04:56 -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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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"