~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/testing/selftests/x86/Makefile

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /tools/testing/selftests/x86/Makefile (Version linux-6.12-rc7) and /tools/testing/selftests/x86/Makefile (Version linux-6.10.14)


  1 # SPDX-License-Identifier: GPL-2.0                  1 # SPDX-License-Identifier: GPL-2.0
  2 all:                                                2 all:
  3                                                     3 
  4 include ../lib.mk                                   4 include ../lib.mk
  5                                                     5 
  6 .PHONY: all all_32 all_64 warn_32bit_failure c      6 .PHONY: all all_32 all_64 warn_32bit_failure clean
  7                                                     7 
  8 UNAME_M := $(shell uname -m)                        8 UNAME_M := $(shell uname -m)
  9 CAN_BUILD_I386 := $(shell ./check_cc.sh "$(CC)      9 CAN_BUILD_I386 := $(shell ./check_cc.sh "$(CC)" trivial_32bit_program.c -m32)
 10 CAN_BUILD_X86_64 := $(shell ./check_cc.sh "$(C     10 CAN_BUILD_X86_64 := $(shell ./check_cc.sh "$(CC)" trivial_64bit_program.c)
 11 CAN_BUILD_WITH_NOPIE := $(shell ./check_cc.sh      11 CAN_BUILD_WITH_NOPIE := $(shell ./check_cc.sh "$(CC)" trivial_program.c -no-pie)
 12                                                    12 
 13 TARGETS_C_BOTHBITS := single_step_syscall sysr     13 TARGETS_C_BOTHBITS := single_step_syscall sysret_ss_attrs syscall_nt test_mremap_vdso \
 14                         check_initial_reg_stat     14                         check_initial_reg_state sigreturn iopl ioperm \
 15                         test_vsyscall mov_ss_t     15                         test_vsyscall mov_ss_trap \
 16                         syscall_arg_fault fsgs     16                         syscall_arg_fault fsgsbase_restore sigaltstack
 17 TARGETS_C_BOTHBITS += nx_stack                     17 TARGETS_C_BOTHBITS += nx_stack
 18 TARGETS_C_32BIT_ONLY := entry_from_vm86 test_s     18 TARGETS_C_32BIT_ONLY := entry_from_vm86 test_syscall_vdso unwind_vdso \
 19                         test_FCMOV test_FCOMI      19                         test_FCMOV test_FCOMI test_FISTTP \
 20                         vdso_restorer              20                         vdso_restorer
 21 TARGETS_C_64BIT_ONLY := fsgsbase sysret_rip sy     21 TARGETS_C_64BIT_ONLY := fsgsbase sysret_rip syscall_numbering \
 22                         corrupt_xstate_header      22                         corrupt_xstate_header amx lam test_shadow_stack
 23 # Some selftests require 32bit support enabled     23 # Some selftests require 32bit support enabled also on 64bit systems
 24 TARGETS_C_32BIT_NEEDED := ldt_gdt ptrace_sysca     24 TARGETS_C_32BIT_NEEDED := ldt_gdt ptrace_syscall
 25                                                    25 
 26 TARGETS_C_32BIT_ALL := $(TARGETS_C_BOTHBITS) $     26 TARGETS_C_32BIT_ALL := $(TARGETS_C_BOTHBITS) $(TARGETS_C_32BIT_ONLY) $(TARGETS_C_32BIT_NEEDED)
 27 TARGETS_C_64BIT_ALL := $(TARGETS_C_BOTHBITS) $     27 TARGETS_C_64BIT_ALL := $(TARGETS_C_BOTHBITS) $(TARGETS_C_64BIT_ONLY)
 28 ifeq ($(CAN_BUILD_I386)$(CAN_BUILD_X86_64),11)     28 ifeq ($(CAN_BUILD_I386)$(CAN_BUILD_X86_64),11)
 29 TARGETS_C_64BIT_ALL += $(TARGETS_C_32BIT_NEEDE     29 TARGETS_C_64BIT_ALL += $(TARGETS_C_32BIT_NEEDED)
 30 endif                                              30 endif
 31                                                    31 
 32 BINARIES_32 := $(TARGETS_C_32BIT_ALL:%=%_32)       32 BINARIES_32 := $(TARGETS_C_32BIT_ALL:%=%_32)
 33 BINARIES_64 := $(TARGETS_C_64BIT_ALL:%=%_64)       33 BINARIES_64 := $(TARGETS_C_64BIT_ALL:%=%_64)
 34                                                    34 
 35 BINARIES_32 := $(patsubst %,$(OUTPUT)/%,$(BINA     35 BINARIES_32 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_32))
 36 BINARIES_64 := $(patsubst %,$(OUTPUT)/%,$(BINA     36 BINARIES_64 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_64))
 37                                                    37 
 38 CFLAGS := -O2 -g -std=gnu99 -pthread -Wall $(K     38 CFLAGS := -O2 -g -std=gnu99 -pthread -Wall $(KHDR_INCLUDES)
 39                                                    39 
 40 # call32_from_64 in thunks.S uses absolute add     40 # call32_from_64 in thunks.S uses absolute addresses.
 41 ifeq ($(CAN_BUILD_WITH_NOPIE),1)                   41 ifeq ($(CAN_BUILD_WITH_NOPIE),1)
 42 CFLAGS += -no-pie                                  42 CFLAGS += -no-pie
 43                                                << 
 44 ifneq ($(LLVM),)                               << 
 45 # clang only wants to see -no-pie during linki << 
 46 # linking stage, so a compiler warning is unav << 
 47 # restructuring the Makefile. Avoid this by si << 
 48 CFLAGS += -Wno-unused-command-line-argument    << 
 49 endif                                          << 
 50 endif                                              43 endif
 51                                                    44 
 52 define gen-target-rule-32                          45 define gen-target-rule-32
 53 $(1) $(1)_32: $(OUTPUT)/$(1)_32                    46 $(1) $(1)_32: $(OUTPUT)/$(1)_32
 54 .PHONY: $(1) $(1)_32                               47 .PHONY: $(1) $(1)_32
 55 endef                                              48 endef
 56                                                    49 
 57 define gen-target-rule-64                          50 define gen-target-rule-64
 58 $(1) $(1)_64: $(OUTPUT)/$(1)_64                    51 $(1) $(1)_64: $(OUTPUT)/$(1)_64
 59 .PHONY: $(1) $(1)_64                               52 .PHONY: $(1) $(1)_64
 60 endef                                              53 endef
 61                                                    54 
 62 ifeq ($(CAN_BUILD_I386),1)                         55 ifeq ($(CAN_BUILD_I386),1)
 63 all: all_32                                        56 all: all_32
 64 TEST_PROGS += $(BINARIES_32)                       57 TEST_PROGS += $(BINARIES_32)
 65 EXTRA_CFLAGS += -DCAN_BUILD_32                     58 EXTRA_CFLAGS += -DCAN_BUILD_32
 66 $(foreach t,$(TARGETS_C_32BIT_ALL),$(eval $(ca     59 $(foreach t,$(TARGETS_C_32BIT_ALL),$(eval $(call gen-target-rule-32,$(t))))
 67 endif                                              60 endif
 68                                                    61 
 69 ifeq ($(CAN_BUILD_X86_64),1)                       62 ifeq ($(CAN_BUILD_X86_64),1)
 70 all: all_64                                        63 all: all_64
 71 TEST_PROGS += $(BINARIES_64)                       64 TEST_PROGS += $(BINARIES_64)
 72 EXTRA_CFLAGS += -DCAN_BUILD_64                     65 EXTRA_CFLAGS += -DCAN_BUILD_64
 73 $(foreach t,$(TARGETS_C_64BIT_ALL),$(eval $(ca     66 $(foreach t,$(TARGETS_C_64BIT_ALL),$(eval $(call gen-target-rule-64,$(t))))
 74 endif                                              67 endif
 75                                                    68 
 76 all_32: $(BINARIES_32)                             69 all_32: $(BINARIES_32)
 77                                                    70 
 78 all_64: $(BINARIES_64)                             71 all_64: $(BINARIES_64)
 79                                                    72 
 80 EXTRA_CLEAN := $(BINARIES_32) $(BINARIES_64) s !!  73 EXTRA_CLEAN := $(BINARIES_32) $(BINARIES_64)
 81                                                    74 
 82 $(BINARIES_32): $(OUTPUT)/%_32: %.c helpers.h      75 $(BINARIES_32): $(OUTPUT)/%_32: %.c helpers.h
 83         $(CC) -m32 -o $@ $(CFLAGS) $(EXTRA_CFL !!  76         $(CC) -m32 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl -lm
 84                                                    77 
 85 $(BINARIES_64): $(OUTPUT)/%_64: %.c helpers.h      78 $(BINARIES_64): $(OUTPUT)/%_64: %.c helpers.h
 86         $(CC) -m64 -o $@ $(CFLAGS) $(EXTRA_CFL !!  79         $(CC) -m64 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl
 87                                                    80 
 88 # x86_64 users should be encouraged to install     81 # x86_64 users should be encouraged to install 32-bit libraries
 89 ifeq ($(CAN_BUILD_I386)$(CAN_BUILD_X86_64),01)     82 ifeq ($(CAN_BUILD_I386)$(CAN_BUILD_X86_64),01)
 90 all: warn_32bit_failure                            83 all: warn_32bit_failure
 91                                                    84 
 92 warn_32bit_failure:                                85 warn_32bit_failure:
 93         @echo "Warning: you seem to have a bro     86         @echo "Warning: you seem to have a broken 32-bit build" 2>&1;   \
 94         echo "environment.  This will reduce t     87         echo "environment.  This will reduce test coverage of 64-bit" 2>&1; \
 95         echo "kernels.  If you are using a Deb     88         echo "kernels.  If you are using a Debian-like distribution," 2>&1; \
 96         echo "try:"; 2>&1; \                       89         echo "try:"; 2>&1; \
 97         echo "";                                   90         echo "";                                                        \
 98         echo "  apt-get install gcc-multilib l     91         echo "  apt-get install gcc-multilib libc6-i386 libc6-dev-i386"; \
 99         echo "";                                   92         echo "";                                                        \
100         echo "If you are using a Fedora-like d     93         echo "If you are using a Fedora-like distribution, try:";       \
101         echo "";                                   94         echo "";                                                        \
102         echo "  yum install glibc-devel.*i686"     95         echo "  yum install glibc-devel.*i686";                         \
103         echo "";                                   96         echo "";                                                        \
104         echo "If you are using a SUSE-like dis     97         echo "If you are using a SUSE-like distribution, try:";         \
105         echo "";                                   98         echo "";                                                        \
106         echo "  zypper install gcc-32bit glibc     99         echo "  zypper install gcc-32bit glibc-devel-static-32bit";     \
107         exit 0;                                   100         exit 0;
108 endif                                             101 endif
109                                                   102 
110 # Add an additional file to the source file li !! 103 # Some tests have additional dependencies.
111 # add a Makefile dependency on that same file. !! 104 $(OUTPUT)/sysret_ss_attrs_64: thunks.S
112 # that the compiler invocation ("$(CC) file1.c !! 105 $(OUTPUT)/ptrace_syscall_32: raw_syscall_helper_32.S
113 # the dependencies ("header3.h"), because clan !! 106 $(OUTPUT)/test_syscall_vdso_32: thunks_32.S
114 # header files as an input to the compiler inv << 
115 define extra-files                             << 
116 $(OUTPUT)/$(1): EXTRA_FILES := $(2)            << 
117 $(OUTPUT)/$(1): $(2)                           << 
118 endef                                          << 
119                                                << 
120 $(eval $(call extra-files,sysret_ss_attrs_64,t << 
121 $(eval $(call extra-files,ptrace_syscall_32,ra << 
122 $(eval $(call extra-files,test_syscall_vdso_32 << 
123 $(eval $(call extra-files,fsgsbase_restore_64, << 
124 $(eval $(call extra-files,fsgsbase_restore_32, << 
125 $(eval $(call extra-files,sysret_rip_64,clang_ << 
126                                                   107 
127 # check_initial_reg_state is special: it needs    108 # check_initial_reg_state is special: it needs a custom entry, and it
128 # needs to be static so that its interpreter d    109 # needs to be static so that its interpreter doesn't destroy its initial
129 # state.                                          110 # state.
130 $(OUTPUT)/check_initial_reg_state_32: CFLAGS +    111 $(OUTPUT)/check_initial_reg_state_32: CFLAGS += -Wl,-ereal_start -static
131 $(OUTPUT)/check_initial_reg_state_64: CFLAGS +    112 $(OUTPUT)/check_initial_reg_state_64: CFLAGS += -Wl,-ereal_start -static
132                                                   113 
133 $(OUTPUT)/nx_stack_32: CFLAGS += -Wl,-z,noexec    114 $(OUTPUT)/nx_stack_32: CFLAGS += -Wl,-z,noexecstack
134 $(OUTPUT)/nx_stack_64: CFLAGS += -Wl,-z,noexec    115 $(OUTPUT)/nx_stack_64: CFLAGS += -Wl,-z,noexecstack
                                                      

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php