Commit 23d1dea5 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'linux-kselftest-next-5.18-rc1' of...

Merge tag 'linux-kselftest-next-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest

Pull Kselftest updates from Shuah Khan:
 "Several build and cleanup fixes:

   - removing obsolete config options

   - removing dependency on internal kernel macros

   - adding config options

   - several build fixes related to headers and install paths"

* tag 'linux-kselftest-next-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: (22 commits)
  selftests: Fix build when $(O) points to a relative path
  selftests: netfilter: fix a build error on openSUSE
  selftests: kvm: add generated file to the .gitignore
  selftests/exec: add generated files to .gitignore
  selftests: add kselftest_install to .gitignore
  selftests/rtc: continuously read RTC in a loop for 30s
  selftests/lkdtm: Add UBSAN config
  selftests/lkdtm: Remove dead config option
  selftests/exec: Rename file binfmt_script to binfmt_script.py
  selftests: Use -isystem instead of -I to include headers
  selftests: vm: remove dependecy from internal kernel macros
  selftests: vm: Add the uapi headers include variable
  selftests: mptcp: Add the uapi headers include variable
  selftests: net: Add the uapi headers include variable
  selftests: landlock: Add the uapi headers include variable
  selftests: kvm: Add the uapi headers include variable
  selftests: futex: Add the uapi headers include variable
  selftests: Correct the headers install path
  selftests: Add and export a kernel uapi headers path
  selftests: set the BUILD variable to absolute path
  ...
parents 2fce7ea0 f6d344cd
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@ gpiogpio-event-mon
gpiogpio-hammer
gpioinclude/
gpiolsgpio
kselftest_install/
tpm2/SpaceTest.log

# Python bytecode and cache
+26 −11
Original line number Diff line number Diff line
@@ -114,23 +114,35 @@ ifdef building_out_of_srctree
override LDFLAGS =
endif

ifneq ($(O),)
	BUILD := $(O)/kselftest
else
top_srcdir ?= ../../..

ifeq ("$(origin O)", "command line")
  KBUILD_OUTPUT := $(O)
endif

ifneq ($(KBUILD_OUTPUT),)
		BUILD := $(KBUILD_OUTPUT)/kselftest
  # Make's built-in functions such as $(abspath ...), $(realpath ...) cannot
  # expand a shell special character '~'. We use a somewhat tedious way here.
  abs_objtree := $(shell cd $(top_srcdir) && mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) && pwd)
  $(if $(abs_objtree),, \
    $(error failed to create output directory "$(KBUILD_OUTPUT)"))
  # $(realpath ...) resolves symlinks
  abs_objtree := $(realpath $(abs_objtree))
  BUILD := $(abs_objtree)/kselftest
  KHDR_INCLUDES := -isystem ${abs_objtree}/usr/include
else
		BUILD := $(shell pwd)
  BUILD := $(CURDIR)
  abs_srctree := $(shell cd $(top_srcdir) && pwd)
  KHDR_INCLUDES := -isystem ${abs_srctree}/usr/include
  DEFAULT_INSTALL_HDR_PATH := 1
endif
endif

# Prepare for headers install
top_srcdir ?= ../../..
include $(top_srcdir)/scripts/subarch.include
ARCH           ?= $(SUBARCH)
export KSFT_KHDR_INSTALL_DONE := 1
export BUILD
export KHDR_INCLUDES

# set default goal to all, so make without a target runs all, even when
# all isn't the first target in the file.
@@ -155,7 +167,7 @@ khdr:
ifeq (1,$(DEFAULT_INSTALL_HDR_PATH))
	$(MAKE) --no-builtin-rules ARCH=$(ARCH) -C $(top_srcdir) headers_install
else
	$(MAKE) --no-builtin-rules INSTALL_HDR_PATH=$$BUILD/usr \
	$(MAKE) --no-builtin-rules INSTALL_HDR_PATH=$(abs_objtree)/usr \
		ARCH=$(ARCH) -C $(top_srcdir) headers_install
endif

@@ -165,6 +177,7 @@ all: khdr
		BUILD_TARGET=$$BUILD/$$TARGET;			\
		mkdir $$BUILD_TARGET  -p;			\
		$(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET	\
				O=$(abs_objtree)		\
				$(if $(FORCE_TARGETS),|| exit);	\
		ret=$$((ret * $$?));				\
	done; exit $$ret;
@@ -172,7 +185,8 @@ all: khdr
run_tests: all
	@for TARGET in $(TARGETS); do \
		BUILD_TARGET=$$BUILD/$$TARGET;	\
		$(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET run_tests;\
		$(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET run_tests \
				O=$(abs_objtree);		    \
	done;

hotplug:
@@ -223,6 +237,7 @@ ifdef INSTALL_PATH
	for TARGET in $(TARGETS); do \
		BUILD_TARGET=$$BUILD/$$TARGET;	\
		$(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install \
				O=$(abs_objtree)		\
				$(if $(FORCE_TARGETS),|| exit);	\
		ret=$$((ret * $$?));		\
	done; exit $$ret;
+2 −0
Original line number Diff line number Diff line
@@ -7,6 +7,8 @@ execveat.moved
execveat.path.ephemeral
execveat.ephemeral
execveat.denatured
non-regular
null-argv
/load_address_*
/recursion-depth
xxxxxxxx*
+1 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@ CFLAGS = -Wall
CFLAGS += -Wno-nonnull
CFLAGS += -D_GNU_SOURCE

TEST_PROGS := binfmt_script
TEST_PROGS := binfmt_script.py
TEST_GEN_PROGS := execveat load_address_4096 load_address_2097152 load_address_16777216 non-regular
TEST_GEN_FILES := execveat.symlink execveat.denatured script subdir
# Makefile is a run-time dependency, since it's accessed by the execveat test
Loading