From patchwork Wed Jan 27 11:22:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Nan X-Patchwork-Id: 60617 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp2521241lbb; Wed, 27 Jan 2016 03:22:49 -0800 (PST) X-Received: by 10.98.8.218 with SMTP id 87mr42198409pfi.39.1453893769838; Wed, 27 Jan 2016 03:22:49 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fm6si8950357pab.122.2016.01.27.03.22.49; Wed, 27 Jan 2016 03:22:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932258AbcA0LWr (ORCPT + 30 others); Wed, 27 Jan 2016 06:22:47 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:13221 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751941AbcA0LWq (ORCPT ); Wed, 27 Jan 2016 06:22:46 -0500 Received: from 172.24.1.47 (EHLO szxeml433-hub.china.huawei.com) ([172.24.1.47]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DAO81637; Wed, 27 Jan 2016 19:22:36 +0800 (CST) Received: from linux-4hy3.site (10.107.193.248) by szxeml433-hub.china.huawei.com (10.82.67.210) with Microsoft SMTP Server id 14.3.235.1; Wed, 27 Jan 2016 19:22:26 +0800 From: Wang Nan To: CC: , Wang Nan , Jiri Olsa , Li Zefan Subject: [PATCH] tools build: Check basic headers for test-compile feature checker Date: Wed, 27 Jan 2016 11:22:22 +0000 Message-ID: <1453893742-20603-1-git-send-email-wangnan0@huawei.com> X-Mailer: git-send-email 1.8.3.4 In-Reply-To: <20160126165945.GC3493@redhat.com> References: <20160126165945.GC3493@redhat.com> MIME-Version: 1.0 X-Originating-IP: [10.107.193.248] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020204.56A8A87D.00C3, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 584ef37e4923b68f0792e27fe59fc145 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- tools/build/feature/test-compile.c | 2 ++ 1 file changed, 2 insertions(+) -- 1.8.3.4 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; }