aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2015-05-27 08:40:10 -0400
committerIngo Molnar <mingo@kernel.org>2015-05-27 08:40:10 -0400
commitd563a6bb3d107bf62ec7cd852a142d7e93f0db79 (patch)
tree9902cb7c599126341a8fb32e572305c04fffb9c8 /tools
parent1fcb61c52bbdbbc46d132acf7dab9ad0eca433fe (diff)
parentba155e2d21f6bf05de86a78dbe5bfd8757604a65 (diff)
Merge tag 'v4.1-rc5' into x86/mm, to refresh the tree before applying new changes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/lib/lockdep/Makefile3
-rw-r--r--tools/lib/lockdep/uinclude/linux/kernel.h3
-rw-r--r--tools/perf/Makefile2
-rw-r--r--tools/testing/selftests/x86/Makefile53
-rwxr-xr-xtools/testing/selftests/x86/check_cc.sh16
-rw-r--r--tools/testing/selftests/x86/run_x86_tests.sh13
-rw-r--r--tools/testing/selftests/x86/trivial_32bit_program.c4
-rw-r--r--tools/testing/selftests/x86/trivial_64bit_program.c18
-rw-r--r--tools/thermal/tmon/Makefile8
-rw-r--r--tools/vm/Makefile2
10 files changed, 76 insertions, 46 deletions
diff --git a/tools/lib/lockdep/Makefile b/tools/lib/lockdep/Makefile
index 0c356fb65022..18ffccf00426 100644
--- a/tools/lib/lockdep/Makefile
+++ b/tools/lib/lockdep/Makefile
@@ -14,9 +14,10 @@ define allow-override
14 $(eval $(1) = $(2))) 14 $(eval $(1) = $(2)))
15endef 15endef
16 16
17# Allow setting CC and AR, or setting CROSS_COMPILE as a prefix. 17# Allow setting CC and AR and LD, or setting CROSS_COMPILE as a prefix.
18$(call allow-override,CC,$(CROSS_COMPILE)gcc) 18$(call allow-override,CC,$(CROSS_COMPILE)gcc)
19$(call allow-override,AR,$(CROSS_COMPILE)ar) 19$(call allow-override,AR,$(CROSS_COMPILE)ar)
20$(call allow-override,LD,$(CROSS_COMPILE)ld)
20 21
21INSTALL = install 22INSTALL = install
22 23
diff --git a/tools/lib/lockdep/uinclude/linux/kernel.h b/tools/lib/lockdep/uinclude/linux/kernel.h
index a11e3c357be7..cd2cc59a5da7 100644
--- a/tools/lib/lockdep/uinclude/linux/kernel.h
+++ b/tools/lib/lockdep/uinclude/linux/kernel.h
@@ -28,6 +28,9 @@
28#define __init 28#define __init
29#define noinline 29#define noinline
30#define list_add_tail_rcu list_add_tail 30#define list_add_tail_rcu list_add_tail
31#define list_for_each_entry_rcu list_for_each_entry
32#define barrier()
33#define synchronize_sched()
31 34
32#ifndef CALLER_ADDR0 35#ifndef CALLER_ADDR0
33#define CALLER_ADDR0 ((unsigned long)__builtin_return_address(0)) 36#define CALLER_ADDR0 ((unsigned long)__builtin_return_address(0))
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index c699dc35eef9..d31a7bbd7cee 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -24,7 +24,7 @@ unexport MAKEFLAGS
24# (To override it, run 'make JOBS=1' and similar.) 24# (To override it, run 'make JOBS=1' and similar.)
25# 25#
26ifeq ($(JOBS),) 26ifeq ($(JOBS),)
27 JOBS := $(shell egrep -c '^processor|^CPU' /proc/cpuinfo 2>/dev/null) 27 JOBS := $(shell (getconf _NPROCESSORS_ONLN || egrep -c '^processor|^CPU[0-9]' /proc/cpuinfo) 2>/dev/null)
28 ifeq ($(JOBS),0) 28 ifeq ($(JOBS),0)
29 JOBS := 1 29 JOBS := 1
30 endif 30 endif
diff --git a/tools/testing/selftests/x86/Makefile b/tools/testing/selftests/x86/Makefile
index ddf63569df5a..5bdb781163d1 100644
--- a/tools/testing/selftests/x86/Makefile
+++ b/tools/testing/selftests/x86/Makefile
@@ -1,4 +1,8 @@
1.PHONY: all all_32 all_64 check_build32 clean run_tests 1all:
2
3include ../lib.mk
4
5.PHONY: all all_32 all_64 warn_32bit_failure clean
2 6
3TARGETS_C_BOTHBITS := sigreturn single_step_syscall 7TARGETS_C_BOTHBITS := sigreturn single_step_syscall
4 8
@@ -7,42 +11,47 @@ BINARIES_64 := $(TARGETS_C_BOTHBITS:%=%_64)
7 11
8CFLAGS := -O2 -g -std=gnu99 -pthread -Wall 12CFLAGS := -O2 -g -std=gnu99 -pthread -Wall
9 13
10UNAME_P := $(shell uname -p) 14UNAME_M := $(shell uname -m)
15CAN_BUILD_I386 := $(shell ./check_cc.sh $(CC) trivial_32bit_program.c -m32)
16CAN_BUILD_X86_64 := $(shell ./check_cc.sh $(CC) trivial_64bit_program.c)
11 17
12# Always build 32-bit tests 18ifeq ($(CAN_BUILD_I386),1)
13all: all_32 19all: all_32
20TEST_PROGS += $(BINARIES_32)
21endif
14 22
15# If we're on a 64-bit host, build 64-bit tests as well 23ifeq ($(CAN_BUILD_X86_64),1)
16ifeq ($(shell uname -p),x86_64)
17all: all_64 24all: all_64
25TEST_PROGS += $(BINARIES_64)
18endif 26endif
19 27
20all_32: check_build32 $(BINARIES_32) 28all_32: $(BINARIES_32)
21 29
22all_64: $(BINARIES_64) 30all_64: $(BINARIES_64)
23 31
24clean: 32clean:
25 $(RM) $(BINARIES_32) $(BINARIES_64) 33 $(RM) $(BINARIES_32) $(BINARIES_64)
26 34
27run_tests:
28 ./run_x86_tests.sh
29
30$(TARGETS_C_BOTHBITS:%=%_32): %_32: %.c 35$(TARGETS_C_BOTHBITS:%=%_32): %_32: %.c
31 $(CC) -m32 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl 36 $(CC) -m32 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl
32 37
33$(TARGETS_C_BOTHBITS:%=%_64): %_64: %.c 38$(TARGETS_C_BOTHBITS:%=%_64): %_64: %.c
34 $(CC) -m64 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl 39 $(CC) -m64 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl
35 40
36check_build32: 41# x86_64 users should be encouraged to install 32-bit libraries
37 @if ! $(CC) -m32 -o /dev/null trivial_32bit_program.c; then \ 42ifeq ($(CAN_BUILD_I386)$(CAN_BUILD_X86_64),01)
38 echo "Warning: you seem to have a broken 32-bit build" 2>&1; \ 43all: warn_32bit_failure
39 echo "environment. If you are using a Debian-like"; \ 44
40 echo " distribution, try:"; \ 45warn_32bit_failure:
41 echo ""; \ 46 @echo "Warning: you seem to have a broken 32-bit build" 2>&1; \
42 echo " apt-get install gcc-multilib libc6-i386 libc6-dev-i386"; \ 47 echo "environment. This will reduce test coverage of 64-bit" 2>&1; \
43 echo ""; \ 48 echo "kernels. If you are using a Debian-like distribution," 2>&1; \
44 echo "If you are using a Fedora-like distribution, try:"; \ 49 echo "try:"; 2>&1; \
45 echo ""; \ 50 echo ""; \
46 echo " yum install glibc-devel.*i686"; \ 51 echo " apt-get install gcc-multilib libc6-i386 libc6-dev-i386"; \
47 exit 1; \ 52 echo ""; \
48 fi 53 echo "If you are using a Fedora-like distribution, try:"; \
54 echo ""; \
55 echo " yum install glibc-devel.*i686"; \
56 exit 0;
57endif
diff --git a/tools/testing/selftests/x86/check_cc.sh b/tools/testing/selftests/x86/check_cc.sh
new file mode 100755
index 000000000000..172d3293fb7b
--- /dev/null
+++ b/tools/testing/selftests/x86/check_cc.sh
@@ -0,0 +1,16 @@
1#!/bin/sh
2# check_cc.sh - Helper to test userspace compilation support
3# Copyright (c) 2015 Andrew Lutomirski
4# GPL v2
5
6CC="$1"
7TESTPROG="$2"
8shift 2
9
10if "$CC" -o /dev/null "$TESTPROG" -O0 "$@" 2>/dev/null; then
11 echo 1
12else
13 echo 0
14fi
15
16exit 0
diff --git a/tools/testing/selftests/x86/run_x86_tests.sh b/tools/testing/selftests/x86/run_x86_tests.sh
deleted file mode 100644
index 3fc19b376812..000000000000
--- a/tools/testing/selftests/x86/run_x86_tests.sh
+++ /dev/null
@@ -1,13 +0,0 @@
1#!/bin/bash
2
3# This is deliberately minimal. IMO kselftests should provide a standard
4# script here.
5./sigreturn_32 || exit 1
6./single_step_syscall_32 || exit 1
7
8if [[ "$uname -p" -eq "x86_64" ]]; then
9 ./sigreturn_64 || exit 1
10 ./single_step_syscall_64 || exit 1
11fi
12
13exit 0
diff --git a/tools/testing/selftests/x86/trivial_32bit_program.c b/tools/testing/selftests/x86/trivial_32bit_program.c
index 2e231beb0a39..fabdf0f51621 100644
--- a/tools/testing/selftests/x86/trivial_32bit_program.c
+++ b/tools/testing/selftests/x86/trivial_32bit_program.c
@@ -4,6 +4,10 @@
4 * GPL v2 4 * GPL v2
5 */ 5 */
6 6
7#ifndef __i386__
8# error wrong architecture
9#endif
10
7#include <stdio.h> 11#include <stdio.h>
8 12
9int main() 13int main()
diff --git a/tools/testing/selftests/x86/trivial_64bit_program.c b/tools/testing/selftests/x86/trivial_64bit_program.c
new file mode 100644
index 000000000000..b994946c40fb
--- /dev/null
+++ b/tools/testing/selftests/x86/trivial_64bit_program.c
@@ -0,0 +1,18 @@
1/*
2 * Trivial program to check that we have a valid 32-bit build environment.
3 * Copyright (c) 2015 Andy Lutomirski
4 * GPL v2
5 */
6
7#ifndef __x86_64__
8# error wrong architecture
9#endif
10
11#include <stdio.h>
12
13int main()
14{
15 printf("\n");
16
17 return 0;
18}
diff --git a/tools/thermal/tmon/Makefile b/tools/thermal/tmon/Makefile
index 0788621c8d76..2e83dd3655a2 100644
--- a/tools/thermal/tmon/Makefile
+++ b/tools/thermal/tmon/Makefile
@@ -12,10 +12,6 @@ TARGET=tmon
12INSTALL_PROGRAM=install -m 755 -p 12INSTALL_PROGRAM=install -m 755 -p
13DEL_FILE=rm -f 13DEL_FILE=rm -f
14 14
15INSTALL_CONFIGFILE=install -m 644 -p
16CONFIG_FILE=
17CONFIG_PATH=
18
19# Static builds might require -ltinfo, for instance 15# Static builds might require -ltinfo, for instance
20ifneq ($(findstring -static, $(LDFLAGS)),) 16ifneq ($(findstring -static, $(LDFLAGS)),)
21STATIC := --static 17STATIC := --static
@@ -38,13 +34,9 @@ valgrind: tmon
38install: 34install:
39 - mkdir -p $(INSTALL_ROOT)/$(BINDIR) 35 - mkdir -p $(INSTALL_ROOT)/$(BINDIR)
40 - $(INSTALL_PROGRAM) "$(TARGET)" "$(INSTALL_ROOT)/$(BINDIR)/$(TARGET)" 36 - $(INSTALL_PROGRAM) "$(TARGET)" "$(INSTALL_ROOT)/$(BINDIR)/$(TARGET)"
41 - mkdir -p $(INSTALL_ROOT)/$(CONFIG_PATH)
42 - $(INSTALL_CONFIGFILE) "$(CONFIG_FILE)" "$(INSTALL_ROOT)/$(CONFIG_PATH)"
43 37
44uninstall: 38uninstall:
45 $(DEL_FILE) "$(INSTALL_ROOT)/$(BINDIR)/$(TARGET)" 39 $(DEL_FILE) "$(INSTALL_ROOT)/$(BINDIR)/$(TARGET)"
46 $(CONFIG_FILE) "$(CONFIG_PATH)"
47
48 40
49clean: 41clean:
50 find . -name "*.o" | xargs $(DEL_FILE) 42 find . -name "*.o" | xargs $(DEL_FILE)
diff --git a/tools/vm/Makefile b/tools/vm/Makefile
index ac884b65a072..93aadaf7ff63 100644
--- a/tools/vm/Makefile
+++ b/tools/vm/Makefile
@@ -3,7 +3,7 @@
3TARGETS=page-types slabinfo page_owner_sort 3TARGETS=page-types slabinfo page_owner_sort
4 4
5LIB_DIR = ../lib/api 5LIB_DIR = ../lib/api
6LIBS = $(LIB_DIR)/libapikfs.a 6LIBS = $(LIB_DIR)/libapi.a
7 7
8CC = $(CROSS_COMPILE)gcc 8CC = $(CROSS_COMPILE)gcc
9CFLAGS = -Wall -Wextra -I../lib/ 9CFLAGS = -Wall -Wextra -I../lib/