From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932479AbcA0NYG (ORCPT ); Wed, 27 Jan 2016 08:24:06 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46600 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932368AbcA0NYD (ORCPT ); Wed, 27 Jan 2016 08:24:03 -0500 Date: Wed, 27 Jan 2016 14:23:59 +0100 From: Jiri Olsa To: Wang Nan Cc: acme@redhat.com, linux-kernel@vger.kernel.org, Jiri Olsa , Li Zefan Subject: Re: [PATCH] tools build: Check basic headers for test-compile feature checker Message-ID: <20160127132359.GA13158@krava.brq.redhat.com> References: <20160126165945.GC3493@redhat.com> <1453893742-20603-1-git-send-email-wangnan0@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1453893742-20603-1-git-send-email-wangnan0@huawei.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 27, 2016 at 11:22:22AM +0000, Wang Nan wrote: > An i386 binary can be linked correctly even without correct headers. > Which causes problem. For exmaple: > > $ mv /tmp/oxygen_root/usr/include/gnu/stubs-32.h{,.bak} > $ make tools/perf > Auto-detecting system features: > ... dwarf: [ on ] > [SNIP] > GEN common-cmds.h > CC perf-read-vdso32 > In file included from /tmp/oxygen_root/usr/include/features.h:388:0, > from /tmp/oxygen_root/usr/include/stdio.h:27, > from perf-read-vdso.c:1: > /tmp/oxygen_root/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file or directory > # include > ^ > compilation terminated. > ... > > In this patch we checks not only compiler and linker, but also basic > headers in test-compile test case, make it fail on a platform > lacking correct headers. > > Signed-off-by: Wang Nan > Cc: Arnaldo Carvalho de Melo > Cc: Jiri Olsa > Cc: Li Zefan nice ;-) Acked-by: Jiri Olsa thanks, jirka > --- > tools/build/feature/test-compile.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/tools/build/feature/test-compile.c b/tools/build/feature/test-compile.c > index 31dbf45..c54e655 100644 > --- a/tools/build/feature/test-compile.c > +++ b/tools/build/feature/test-compile.c > @@ -1,4 +1,6 @@ > +#include > int main(void) > { > + printf("Hello World!\n"); > return 0; > } > -- > 1.8.3.4 >