From mboxrd@z Thu Jan 1 00:00:00 1970 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 From: Michal Privoznik Date: Fri, 2 Sep 2016 13:49:08 +0200 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v2] tests: Fix broken tcg test compilation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: veroniabahaa@gmail.com, eblake@redhat.com 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 =E2=80=98b= ool=E2=80=99 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 =E2=80=98ge= trusage=E2=80=99 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 $@ =20 testthread: testthread.c - $(CC_I386) $(CFLAGS) $(LDFLAGS) -o $@ $< -lpthread + $(CC_I386) $(QEMU_INCLUDES) $(CFLAGS) $(LDFLAGS) -o $@ $< -lpthread =20 # 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-vm8= 6.S \ $(. */ + +#include "qemu/osdep.h" + #define _GNU_SOURCE #include #include @@ -31,6 +34,7 @@ #include #include #include +#include #include #include #include --=20 2.8.4