xref: /linux/tools/testing/selftests/vDSO/Makefile (revision 7a0e692a0381254b2f77c54dec100cd3325a6fdf)
1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
267a121acSJason A. Donenfeldinclude ../../../scripts/Makefile.arch
329ee9239SShuah Khan (Samsung OSG)
4bb2a605dSJohn HubbardTEST_GEN_PROGS := vdso_test_gettimeofday
5bb2a605dSJohn HubbardTEST_GEN_PROGS += vdso_test_getcpu
6bb2a605dSJohn HubbardTEST_GEN_PROGS += vdso_test_abi
7c7e5789bSVincenzo Frascinoifeq ($(ARCH),$(filter $(ARCH),x86 x86_64))
8bb2a605dSJohn HubbardTEST_GEN_PROGS += vdso_standalone_test_x86
929ee9239SShuah Khan (Samsung OSG)endif
10bb2a605dSJohn HubbardTEST_GEN_PROGS += vdso_test_correctness
114920a259SJason A. DonenfeldTEST_GEN_PROGS += vdso_test_getrandom
123b5992eaSJason A. DonenfeldTEST_GEN_PROGS += vdso_test_chacha
1329ee9239SShuah Khan (Samsung OSG)
1458265d64SThomas WeißschuhCFLAGS := -std=gnu99 -O2 -Wall -Wstrict-prototypes
1566cde337SJohn Hubbard
16f9b6b0efSShuah Khanifeq ($(CONFIG_X86_32),y)
17f9b6b0efSShuah KhanLDLIBS += -lgcc_s
18f9b6b0efSShuah Khanendif
19f9b6b0efSShuah Khan
20bb2a605dSJohn Hubbardinclude ../lib.mk
21c9fbaa87SThomas Weißschuh
228770a918SThomas WeißschuhCFLAGS_NOLIBC := -nostdlib -nostdinc -ffreestanding -fno-asynchronous-unwind-tables \
238770a918SThomas Weißschuh		 -fno-stack-protector -include $(top_srcdir)/tools/include/nolibc/nolibc.h \
248770a918SThomas Weißschuh		 -I$(top_srcdir)/tools/include/nolibc/ $(KHDR_INCLUDES)
258770a918SThomas Weißschuh
26babf8a97SMark Brown$(OUTPUT)/vdso_test_gettimeofday: parse_vdso.c vdso_test_gettimeofday.c
272e9a9725SMark Brown$(OUTPUT)/vdso_test_getcpu: parse_vdso.c vdso_test_getcpu.c
28693f5ca0SVincenzo Frascino$(OUTPUT)/vdso_test_abi: parse_vdso.c vdso_test_abi.c
29*a8b22a15SThomas Weißschuh$(OUTPUT)/vdso_test_correctness: parse_vdso.c vdso_test_correctness.c
3066cde337SJohn Hubbard
318770a918SThomas Weißschuh$(OUTPUT)/vdso_standalone_test_x86: vdso_standalone_test_x86.c parse_vdso.c | headers
328770a918SThomas Weißschuh$(OUTPUT)/vdso_standalone_test_x86: CFLAGS:=$(CFLAGS_NOLIBC) $(CFLAGS)
3366cde337SJohn Hubbard
344920a259SJason A. Donenfeld$(OUTPUT)/vdso_test_getrandom: parse_vdso.c
354920a259SJason A. Donenfeld$(OUTPUT)/vdso_test_getrandom: CFLAGS += -isystem $(top_srcdir)/tools/include \
36b90eeff1SXi Ruoyao                                         $(KHDR_INCLUDES) \
374920a259SJason A. Donenfeld                                         -isystem $(top_srcdir)/include/uapi
384920a259SJason A. Donenfeld
393b5992eaSJason A. Donenfeld$(OUTPUT)/vdso_test_chacha: vgetrandom-chacha.S
404920a259SJason A. Donenfeld$(OUTPUT)/vdso_test_chacha: CFLAGS += -idirafter $(top_srcdir)/tools/include \
418bc7c5e5SJason A. Donenfeld                                      -idirafter $(top_srcdir)/tools/include/generated \
4267a121acSJason A. Donenfeld                                      -idirafter $(top_srcdir)/arch/$(SRCARCH)/include \
43f8d92fc5SChristophe Leroy                                      -idirafter $(top_srcdir)/include \
443b5992eaSJason A. Donenfeld                                      -Wa,--noexecstack
45