Makefile 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # SPDX-License-Identifier: GPL-2.0
  2. include ../../../scripts/Makefile.arch
  3. TEST_GEN_PROGS := vdso_test_gettimeofday
  4. TEST_GEN_PROGS += vdso_test_getcpu
  5. TEST_GEN_PROGS += vdso_test_abi
  6. ifeq ($(ARCH),$(filter $(ARCH),x86 x86_64))
  7. TEST_GEN_PROGS += vdso_standalone_test_x86
  8. endif
  9. TEST_GEN_PROGS += vdso_test_correctness
  10. TEST_GEN_PROGS += vdso_test_getrandom
  11. TEST_GEN_PROGS += vdso_test_chacha
  12. CFLAGS := -std=gnu99 -O2 -Wall -Wstrict-prototypes
  13. ifeq ($(CONFIG_X86_32),y)
  14. LDLIBS += -lgcc_s
  15. endif
  16. include ../lib.mk
  17. CFLAGS += $(TOOLS_INCLUDES)
  18. CFLAGS_NOLIBC := -nostdlib -nostdinc -ffreestanding -fno-asynchronous-unwind-tables \
  19. -fno-stack-protector -include $(top_srcdir)/tools/include/nolibc/nolibc.h \
  20. -I$(top_srcdir)/tools/include/nolibc/ $(KHDR_INCLUDES)
  21. $(OUTPUT)/vdso_test_gettimeofday: parse_vdso.c vdso_test_gettimeofday.c
  22. $(OUTPUT)/vdso_test_getcpu: parse_vdso.c vdso_test_getcpu.c
  23. $(OUTPUT)/vdso_test_abi: parse_vdso.c vdso_test_abi.c
  24. $(OUTPUT)/vdso_standalone_test_x86: vdso_standalone_test_x86.c parse_vdso.c | headers
  25. $(OUTPUT)/vdso_standalone_test_x86: CFLAGS:=$(CFLAGS_NOLIBC) $(CFLAGS)
  26. $(OUTPUT)/vdso_test_correctness: vdso_test_correctness.c
  27. $(OUTPUT)/vdso_test_correctness: LDFLAGS += -ldl
  28. $(OUTPUT)/vdso_test_getrandom: parse_vdso.c
  29. $(OUTPUT)/vdso_test_getrandom: CFLAGS += -isystem $(top_srcdir)/tools/include \
  30. $(KHDR_INCLUDES) \
  31. -isystem $(top_srcdir)/include/uapi
  32. $(OUTPUT)/vdso_test_chacha: vgetrandom-chacha.S
  33. $(OUTPUT)/vdso_test_chacha: CFLAGS += -idirafter $(top_srcdir)/tools/include \
  34. -idirafter $(top_srcdir)/tools/include/generated \
  35. -idirafter $(top_srcdir)/arch/$(SRCARCH)/include \
  36. -idirafter $(top_srcdir)/include \
  37. -Wa,--noexecstack