blob: 1cf14a8da43803249f72fe1b09689c8834806986 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001# SPDX-License-Identifier: GPL-2.0
Jason A. Donenfeld67a121a2024-09-01 15:05:01 +02002include ../../../scripts/Makefile.arch
Shuah Khan (Samsung OSG)29ee9232018-06-22 11:23:00 -06003
John Hubbardbb2a6052024-07-05 09:57:35 -10004TEST_GEN_PROGS := vdso_test_gettimeofday
5TEST_GEN_PROGS += vdso_test_getcpu
6TEST_GEN_PROGS += vdso_test_abi
7TEST_GEN_PROGS += vdso_test_clock_getres
Vincenzo Frascinoc7e57892020-10-26 11:49:44 +00008ifeq ($(ARCH),$(filter $(ARCH),x86 x86_64))
John Hubbardbb2a6052024-07-05 09:57:35 -10009TEST_GEN_PROGS += vdso_standalone_test_x86
Shuah Khan (Samsung OSG)29ee9232018-06-22 11:23:00 -060010endif
John Hubbardbb2a6052024-07-05 09:57:35 -100011TEST_GEN_PROGS += vdso_test_correctness
Jason A. Donenfeld4920a252024-07-07 01:40:16 +020012TEST_GEN_PROGS += vdso_test_getrandom
Jason A. Donenfeld3b5992e2024-10-07 23:45:56 +020013TEST_GEN_PROGS += vdso_test_chacha
Shuah Khan (Samsung OSG)29ee9232018-06-22 11:23:00 -060014
Christophe Leroyecb8bd72024-09-01 19:24:03 +020015CFLAGS := -std=gnu99 -O2
John Hubbard66cde332024-07-05 09:57:36 -100016
Shuah Khanf9b6b0e2016-09-13 12:06:20 -060017ifeq ($(CONFIG_X86_32),y)
18LDLIBS += -lgcc_s
19endif
20
John Hubbardbb2a6052024-07-05 09:57:35 -100021include ../lib.mk
Mark Brownbabf8a92020-05-21 21:37:05 +010022$(OUTPUT)/vdso_test_gettimeofday: parse_vdso.c vdso_test_gettimeofday.c
Mark Brown2e9a9722020-05-22 17:21:39 +010023$(OUTPUT)/vdso_test_getcpu: parse_vdso.c vdso_test_getcpu.c
Vincenzo Frascino693f5ca2020-10-26 11:49:42 +000024$(OUTPUT)/vdso_test_abi: parse_vdso.c vdso_test_abi.c
Vincenzo Frascino03f55c72020-10-26 11:49:43 +000025$(OUTPUT)/vdso_test_clock_getres: vdso_test_clock_getres.c
John Hubbard66cde332024-07-05 09:57:36 -100026
Dominik Brodowski70b574e2018-02-11 11:59:50 +010027$(OUTPUT)/vdso_standalone_test_x86: vdso_standalone_test_x86.c parse_vdso.c
John Hubbard66cde332024-07-05 09:57:36 -100028$(OUTPUT)/vdso_standalone_test_x86: CFLAGS +=-nostdlib -fno-asynchronous-unwind-tables -fno-stack-protector
29
Vincenzo Frascinoc7e57892020-10-26 11:49:44 +000030$(OUTPUT)/vdso_test_correctness: vdso_test_correctness.c
John Hubbard66cde332024-07-05 09:57:36 -100031$(OUTPUT)/vdso_test_correctness: LDFLAGS += -ldl
Jason A. Donenfeld4920a252024-07-07 01:40:16 +020032
33$(OUTPUT)/vdso_test_getrandom: parse_vdso.c
34$(OUTPUT)/vdso_test_getrandom: CFLAGS += -isystem $(top_srcdir)/tools/include \
Xi Ruoyaob90eeff2024-08-28 13:29:57 +020035 $(KHDR_INCLUDES) \
Jason A. Donenfeld4920a252024-07-07 01:40:16 +020036 -isystem $(top_srcdir)/include/uapi
37
Jason A. Donenfeld3b5992e2024-10-07 23:45:56 +020038$(OUTPUT)/vdso_test_chacha: vgetrandom-chacha.S
Jason A. Donenfeld4920a252024-07-07 01:40:16 +020039$(OUTPUT)/vdso_test_chacha: CFLAGS += -idirafter $(top_srcdir)/tools/include \
Jason A. Donenfeld8bc7c5e2024-09-03 14:52:45 +020040 -idirafter $(top_srcdir)/tools/include/generated \
Jason A. Donenfeld67a121a2024-09-01 15:05:01 +020041 -idirafter $(top_srcdir)/arch/$(SRCARCH)/include \
Christophe Leroyf8d92fc2024-08-22 09:13:23 +020042 -idirafter $(top_srcdir)/include \
Jason A. Donenfeld3b5992e2024-10-07 23:45:56 +020043 -Wa,--noexecstack