diff options
Diffstat (limited to 'debug/Makefile')
-rw-r--r-- | debug/Makefile | 41 |
1 files changed, 29 insertions, 12 deletions
diff --git a/debug/Makefile b/debug/Makefile index 99cdf3221b..f73c739da7 100644 --- a/debug/Makefile +++ b/debug/Makefile @@ -120,8 +120,10 @@ CPPFLAGS-tst-chk-cancel.c += -D_FORTIFY_SOURCE=2 # CFLAGS for the file. tests-all-chk = tst-fortify -tests-c-chk = -tests-cc-chk = +tests-c-def-chk = +tests-cc-def-chk = +tests-c-time64-chk = +tests-cc-time64-chk = CFLAGS-tst-fortify.c += -Wno-format -Wno-deprecated-declarations -Wno-error @@ -130,11 +132,11 @@ define cflags-default endef define cflags-lfs -CFLAGS-tst-fortify-$(1)-lfs-$(2).$(1) += -D_FILE_OFFSET_BITS=64 +CFLAGS-tst-fortify-$(1)-lfs-$(2)-$(3).$(1) += -D_FILE_OFFSET_BITS=64 endef define cflags-nongnu -CFLAGS-tst-fortify-$(1)-nongnu-$(2).$(1) += -D_LARGEFILE64_SOURCE=1 +CFLAGS-tst-fortify-$(1)-nongnu-$(2)-$(3).$(1) += -D_LARGEFILE64_SOURCE=1 endef src-chk-nongnu = \#undef _GNU_SOURCE @@ -145,12 +147,12 @@ src-chk-nongnu = \#undef _GNU_SOURCE # And they also generate warnings from warning attributes, which # cannot be disabled via pragmas, so require -Wno-error to be used. define gen-chk-test -tests-$(1)-chk += tst-fortify-$(1)-$(2)-$(3) -CFLAGS-tst-fortify-$(1)-$(2)-$(3).$(1) += -D_FORTIFY_SOURCE=$(3) -Wno-format \ +tests-$(1)-$(4)-chk += tst-fortify-$(1)-$(2)-$(3)-$(4) +CFLAGS-tst-fortify-$(1)-$(2)-$(3)-$(4).$(1) += -D_FORTIFY_SOURCE=$(3) -Wno-format \ -Wno-deprecated-declarations \ -Wno-error -$(eval $(call cflags-$(2),$(1),$(3))) -$(objpfx)tst-fortify-$(1)-$(2)-$(3).$(1): tst-fortify.c Makefile +$(eval $(call cflags-$(2),$(1),$(3),$(4))) +$(objpfx)tst-fortify-$(1)-$(2)-$(3)-$(4).$(1): tst-fortify.c Makefile ( echo "/* Autogenerated from Makefile. */"; \ echo "$(src-chk-$(2))"; \ echo "#include \"tst-fortify.c\"" ) > $$@.tmp @@ -159,19 +161,29 @@ endef chk-extensions = c cc chk-types = default lfs nongnu +# 64 bit time_t implies LFS. +chk-types-time64 = default nongnu chk-levels = 1 2 3 $(foreach e,$(chk-extensions), \ $(foreach t,$(chk-types), \ $(foreach l,$(chk-levels), \ - $(eval $(call gen-chk-test,$(e),$(t),$(l)))))) + $(eval $(call gen-chk-test,$(e),$(t),$(l),def))))) -tests-all-chk += $(tests-c-chk) $(tests-cc-chk) +tests-all-chk += $(tests-c-def-chk) $(tests-cc-def-chk) + +$(foreach e,$(chk-extensions), \ + $(foreach t,$(chk-types-time64), \ + $(foreach l,$(chk-levels), \ + $(eval $(call gen-chk-test,$(e),$(t),$(l),time64))))) + +tests-all-time64-chk += $(tests-c-time64-chk) $(tests-cc-time64-chk) define link-cc LDLIBS-$(1) = -lstdc++ endef -$(foreach t,$(tests-cc-chk), $(eval $(call link-cc,$(t)))) +$(foreach t,$(tests-cc-def-chk), $(eval $(call link-cc,$(t)))) +$(foreach t,$(tests-cc-time64-chk), $(eval $(call link-cc,$(t)))) # backtrace_symbols only works if we link with -rdynamic. backtrace # requires unwind tables on most architectures. @@ -201,6 +213,10 @@ tests = backtrace-tst \ tst-realpath-chk \ $(tests-all-chk) +tests-time64 += \ + $(tests-all-time64-chk) \ + # tests-time64 + ifeq ($(have-ssp),yes) tests += tst-ssp-1 endif @@ -210,7 +226,7 @@ tests += tst-chk-cancel endif ifeq (,$(CXX)) -tests-unsupported = $(tests-cc-chk) +tests-unsupported = $(tests-cc-def-chk) $(test-cc-time64-chk) endif extra-libs = libpcprofile @@ -235,6 +251,7 @@ define chk-gen-locales $(objpfx)$(1).out: $(gen-locales) endef $(foreach t, $(tests-all-chk), $(eval $(call chk-gen-locales,$(t)))) +$(foreach t, $(tests-all-time64-chk), $(eval $(call chk-gen-locales,$(t)))) endif sLIBdir := $(shell echo $(slibdir) | sed 's,lib\(\|64\)$$,\\\\$$LIB,') |