config-afl.mk 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. CC = contrib/fuzzing/afl/afl-clang-lto
  2. CXX = contrib/fuzzing/afl/afl-clang-lto++
  3. LD = contrib/fuzzing/afl/afl-clang-lto++
  4. AR = ar
  5. ifneq ($(STDCXX),)
  6. CXXFLAGS_STDCXX = -std=$(STDCXX)
  7. else
  8. ifeq ($(shell printf '\n' > bin/empty.cpp ; if $(CXX) -std=c++17 -c bin/empty.cpp -o bin/empty.out > /dev/null 2>&1 ; then echo 'c++17' ; fi ), c++17)
  9. CXXFLAGS_STDCXX = -std=c++17
  10. endif
  11. endif
  12. CFLAGS_STDC = -std=c99
  13. CXXFLAGS += $(CXXFLAGS_STDCXX)
  14. CFLAGS += $(CFLAGS_STDC)
  15. DYNLINK=0
  16. SHARED_LIB=0
  17. STATIC_LIB=1
  18. CPPFLAGS +=
  19. CXXFLAGS += -fPIC -fno-strict-aliasing
  20. CFLAGS += -fPIC -fno-strict-aliasing
  21. LDFLAGS +=
  22. LDLIBS += -lm
  23. ARFLAGS := rcs
  24. CXXFLAGS_WARNINGS += -Wmissing-declarations
  25. CFLAGS_WARNINGS += -Wmissing-prototypes
  26. ifeq ($(CHECKED_ADDRESS),1)
  27. CXXFLAGS += -fsanitize=address
  28. CFLAGS += -fsanitize=address
  29. endif
  30. ifeq ($(CHECKED_UNDEFINED),1)
  31. CXXFLAGS += -fsanitize=undefined
  32. CFLAGS += -fsanitize=undefined
  33. endif
  34. include build/make/warnings-clang.mk
  35. EXESUFFIX=
  36. FUZZ=1
  37. CPPFLAGS += -DMPT_BUILD_FUZZER -DMPT_BUILD_FATAL_ASSERTS