From patchwork Fri Sep 2 11:49:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michal Privoznik X-Patchwork-Id: 9310857 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 DD9C860760 for ; Fri, 2 Sep 2016 11:49:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF5D029798 for ; Fri, 2 Sep 2016 11:49:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C40C72979E; Fri, 2 Sep 2016 11:49:42 +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 1F5C329798 for ; Fri, 2 Sep 2016 11:49:41 +0000 (UTC) Received: from localhost ([::1]:41602 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfmyb-0000Jf-1Z for patchwork-qemu-devel@patchwork.kernel.org; Fri, 02 Sep 2016 07:49:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38188) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfmyJ-0000JT-Nd for qemu-devel@nongnu.org; Fri, 02 Sep 2016 07:49:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bfmyF-0002UX-Ja for qemu-devel@nongnu.org; Fri, 02 Sep 2016 07:49:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37324) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfmyF-0002UC-E8 for qemu-devel@nongnu.org; Fri, 02 Sep 2016 07:49:19 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (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 450E94E4CC; Fri, 2 Sep 2016 11:49:18 +0000 (UTC) Received: from lisa.redhat.com (vpn-228-199.phx2.redhat.com [10.3.228.199]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u82BnGm2025129; Fri, 2 Sep 2016 07:49:17 -0400 From: Michal Privoznik To: qemu-devel@nongnu.org Date: Fri, 2 Sep 2016 13:49:08 +0200 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 02 Sep 2016 11:49:18 +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 v2] 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 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 diff to v1: - Move include of osdep.h in linux-test.c at the beginning of the file as suggested by Eric in review tests/tcg/Makefile | 6 +++--- tests/tcg/linux-test.c | 4 ++++ 2 files changed, 7 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 "qemu/osdep.h" + #define _GNU_SOURCE #include #include @@ -31,6 +34,7 @@ #include #include #include +#include #include #include #include