Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1325126 > unrolled thread

[tip:perf/core] tools build: Check basic headers for test-compile feature checker

Started bytip-bot for Wang Nan <tipbot@zytor.com>
First post2016-02-03 11:20 +0100
Last post2016-02-03 11:20 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [tip:perf/core] tools build:   Check basic headers for test-compile feature checker tip-bot for Wang Nan <tipbot@zytor.com> - 2016-02-03 11:20 +0100

#1325126 — [tip:perf/core] tools build: Check basic headers for test-compile feature checker

Fromtip-bot for Wang Nan <tipbot@zytor.com>
Date2016-02-03 11:20 +0100
Subject[tip:perf/core] tools build: Check basic headers for test-compile feature checker
Message-ID<qY2Hv-DD-7@gated-at.bofh.it>
Commit-ID:  cf9162c290447cdf6fca7b64dd6e2200dc52f03b
Gitweb:     http://git.kernel.org/tip/cf9162c290447cdf6fca7b64dd6e2200dc52f03b
Author:     Wang Nan <wangnan0@huawei.com>
AuthorDate: Wed, 27 Jan 2016 11:22:22 +0000
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 27 Jan 2016 11:59:32 -0300

tools build: Check basic headers for test-compile feature checker

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 <gnu/stubs-32.h>
                           ^
 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 <wangnan0@huawei.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Li Zefan <lizefan@huawei.com>
Link: http://lkml.kernel.org/r/1453893742-20603-1-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 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 <stdio.h>
 int main(void)
 {
+	printf("Hello World!\n");
 	return 0;
 }

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web