Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'linux-kselftest-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest

Pull kselftest fixes from Shuah Khan:
"Urgent fix for Kselftest regression introduced in 4.1-rc1 by the new
x86 test due to its hard dependency on 32-bit build environment.

A set of 5 patches fix the make kselftest run and kselftest install"

* tag 'linux-kselftest-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
selftests, x86: Rework x86 target architecture detection
selftests, x86: Remove useless run_tests rule
selftests/x86: install tests
selftest/x86: have no dependency on all when cross building
selftest/x86: build both bitnesses

+71 -37
+33 -24
tools/testing/selftests/x86/Makefile
··· 1 - .PHONY: all all_32 all_64 check_build32 clean run_tests 1 + all: 2 + 3 + include ../lib.mk 4 + 5 + .PHONY: all all_32 all_64 warn_32bit_failure clean 2 6 3 7 TARGETS_C_BOTHBITS := sigreturn single_step_syscall 4 8 ··· 11 7 12 8 CFLAGS := -O2 -g -std=gnu99 -pthread -Wall 13 9 14 - UNAME_P := $(shell uname -p) 10 + UNAME_M := $(shell uname -m) 11 + CAN_BUILD_I386 := $(shell ./check_cc.sh $(CC) trivial_32bit_program.c -m32) 12 + CAN_BUILD_X86_64 := $(shell ./check_cc.sh $(CC) trivial_64bit_program.c) 15 13 16 - # Always build 32-bit tests 14 + ifeq ($(CAN_BUILD_I386),1) 17 15 all: all_32 18 - 19 - # If we're on a 64-bit host, build 64-bit tests as well 20 - ifeq ($(shell uname -p),x86_64) 21 - all: all_64 16 + TEST_PROGS += $(BINARIES_32) 22 17 endif 23 18 24 - all_32: check_build32 $(BINARIES_32) 19 + ifeq ($(CAN_BUILD_X86_64),1) 20 + all: all_64 21 + TEST_PROGS += $(BINARIES_64) 22 + endif 23 + 24 + all_32: $(BINARIES_32) 25 25 26 26 all_64: $(BINARIES_64) 27 27 28 28 clean: 29 29 $(RM) $(BINARIES_32) $(BINARIES_64) 30 - 31 - run_tests: 32 - ./run_x86_tests.sh 33 30 34 31 $(TARGETS_C_BOTHBITS:%=%_32): %_32: %.c 35 32 $(CC) -m32 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl ··· 38 33 $(TARGETS_C_BOTHBITS:%=%_64): %_64: %.c 39 34 $(CC) -m64 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl 40 35 41 - check_build32: 42 - @if ! $(CC) -m32 -o /dev/null trivial_32bit_program.c; then \ 43 - echo "Warning: you seem to have a broken 32-bit build" 2>&1; \ 44 - echo "environment. If you are using a Debian-like"; \ 45 - echo " distribution, try:"; \ 46 - echo ""; \ 47 - echo " apt-get install gcc-multilib libc6-i386 libc6-dev-i386"; \ 48 - echo ""; \ 49 - echo "If you are using a Fedora-like distribution, try:"; \ 50 - echo ""; \ 51 - echo " yum install glibc-devel.*i686"; \ 52 - exit 1; \ 53 - fi 36 + # x86_64 users should be encouraged to install 32-bit libraries 37 + ifeq ($(CAN_BUILD_I386)$(CAN_BUILD_X86_64),01) 38 + all: warn_32bit_failure 39 + 40 + warn_32bit_failure: 41 + @echo "Warning: you seem to have a broken 32-bit build" 2>&1; \ 42 + echo "environment. This will reduce test coverage of 64-bit" 2>&1; \ 43 + echo "kernels. If you are using a Debian-like distribution," 2>&1; \ 44 + echo "try:"; 2>&1; \ 45 + echo ""; \ 46 + echo " apt-get install gcc-multilib libc6-i386 libc6-dev-i386"; \ 47 + echo ""; \ 48 + echo "If you are using a Fedora-like distribution, try:"; \ 49 + echo ""; \ 50 + echo " yum install glibc-devel.*i686"; \ 51 + exit 0; 52 + endif
+16
tools/testing/selftests/x86/check_cc.sh
··· 1 + #!/bin/sh 2 + # check_cc.sh - Helper to test userspace compilation support 3 + # Copyright (c) 2015 Andrew Lutomirski 4 + # GPL v2 5 + 6 + CC="$1" 7 + TESTPROG="$2" 8 + shift 2 9 + 10 + if "$CC" -o /dev/null "$TESTPROG" -O0 "$@" 2>/dev/null; then 11 + echo 1 12 + else 13 + echo 0 14 + fi 15 + 16 + exit 0
-13
tools/testing/selftests/x86/run_x86_tests.sh
··· 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 - 8 - if [[ "$uname -p" -eq "x86_64" ]]; then 9 - ./sigreturn_64 || exit 1 10 - ./single_step_syscall_64 || exit 1 11 - fi 12 - 13 - exit 0
+4
tools/testing/selftests/x86/trivial_32bit_program.c
··· 4 4 * GPL v2 5 5 */ 6 6 7 + #ifndef __i386__ 8 + # error wrong architecture 9 + #endif 10 + 7 11 #include <stdio.h> 8 12 9 13 int main()
+18
tools/testing/selftests/x86/trivial_64bit_program.c
··· 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 + 13 + int main() 14 + { 15 + printf("\n"); 16 + 17 + return 0; 18 + }