diff options
80 files changed, 385 insertions, 30 deletions
diff --git a/Makeconfig b/Makeconfig index c3496452b6..b6357d0b19 100644 --- a/Makeconfig +++ b/Makeconfig @@ -1235,6 +1235,20 @@ $(common-objpfx)versions.stmp: $(common-objpfx)Versions.all \ touch $@ endif # avoid-generated endif # $(build-shared) = yes + +-include $(common-objpfx)time64-compat.mk +postclean-generated += time64-compat.mk + +$(common-objpfx)time64-compat.mk: $(sysd-versions-force) \ + $(common-objpfx)time64-compat.i + sed '/^[ ]*#/d;/^[ ]*$$/d' $< > $@T + mv -f $@T $@ +$(common-objpfx)time64-compat.i: $(..)Makeconfig + printf "#include <time64-compat.h>\n#ifdef TIME64_NON_DEFAULT\nhave-time64-compat = yes\n#endif" \ + | $(CC) -E -undef $(CPPFLAGS) -x assembler-with-cpp - > $@T + mv -f $@T $@ + + endif # sysd-sorted-done # The name under which the run-time dynamic linker is installed. @@ -771,7 +771,8 @@ endif $(patsubst %.o,%.d,$(filter %.o,$(extra-objs:.os=.o))) \ $(patsubst %.oS,%.d,$(filter %.oS,$(extra-objs))) \ $(patsubst %.o,%.d,$(filter %.o,$(extra-test-objs:.os=.o))) \ - $(addsuffix .d,$(tests) $(tests-internal) $(xtests) $(test-srcs)) + $(addsuffix .d,$(tests) $(tests-internal) $(xtests) \ + $(test-srcs) $(tests-time64) $(xtests-time64)) ifeq ($(build-programs),yes) +depfiles += $(addsuffix .d,$(others) $(sysdep-others)) endif @@ -1286,6 +1287,21 @@ check: tests .PHONY: xcheck xcheck: xtests +# Handle tests-time64 and xtests-time64 that should built with LFS +# and 64-bit time support. +include $(o-iterator) +define o-iterator-doit +$(foreach f,$(tests-time64) $(xtests-time64),\ + $(objpfx)$(f)$(o)): CFLAGS += -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 +endef +object-suffixes-left := $(all-object-suffixes) +include $(o-iterator) + +ifeq ($(have-time64-compat),yes) +tests += $(foreach t,$(tests-time64),$(t)) +xtests += $(foreach t,$(xtests-time64),$(t)) +endif + # The only difference between MODULE_NAME=testsuite and MODULE_NAME=nonlib is # that almost all internal declarations from config.h, libc-symbols.h, and # include/*.h are not available to 'testsuite' code, but are to 'nonlib' code. diff --git a/io/Makefile b/io/Makefile index d35e966258..ba8bd37355 100644 --- a/io/Makefile +++ b/io/Makefile @@ -59,7 +59,7 @@ routines := \ ftw64-time64 others := pwd -test-srcs := ftwtest +test-srcs := ftwtest ftwtest-time64 tests := test-utime test-stat test-stat2 test-lfs tst-getcwd \ tst-fcntl bug-ftw1 bug-ftw2 bug-ftw3 bug-ftw4 tst-statvfs \ tst-openat tst-unlinkat tst-fstatat tst-futimesat \ @@ -78,12 +78,24 @@ tests := test-utime test-stat test-stat2 test-lfs tst-getcwd \ tst-futimens \ tst-utimensat \ +tests-time64 := \ + tst-futimens-time64 \ + tst-futimes-time64\ + tst-fts-time64 \ + tst-lutimes-time64 \ + tst-stat-time64 \ + tst-futimesat-time64 \ + tst-utime-time64 \ + tst-utimensat-time64 \ + tst-utimes-time64 \ + # Likewise for statx, but we do not need static linking here. tests-internal += tst-statx tests-static += tst-statx ifeq ($(run-built-tests),yes) -tests-special += $(objpfx)ftwtest.out +tests-special += $(objpfx)ftwtest.out \ + $(objpfx)ftwtest-time64.out endif include ../Rules @@ -125,8 +137,14 @@ tst-statvfs-ARGS = $(objpfx)tst-statvfs tst-statvfs.c /tmp tst-open-tmpfile-ARGS = --test-dir=$(objpfx) +CFLAGS-ftwtest-time64.c += -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 + ifeq ($(run-built-tests),yes) $(objpfx)ftwtest.out: ftwtest-sh $(objpfx)ftwtest $(SHELL) $< $(common-objpfx) '$(test-program-cmd)' > $@; \ $(evaluate-test) + +$(objpfx)ftwtest-time64.out: ftwtest-sh $(objpfx)ftwtest-time64 + $(SHELL) $< $(common-objpfx) '$(test-program-cmd)' > $@; \ + $(evaluate-test) endif diff --git a/io/ftwtest-time64.c b/io/ftwtest-time64.c new file mode 100644 index 0000000000..67f1c46826 --- /dev/null +++ b/io/ftwtest-time64.c @@ -0,0 +1 @@ +#include "ftwtest.c" diff --git a/io/tst-fts-time64.c b/io/tst-fts-time64.c new file mode 100644 index 0000000000..a4a41fe1cf --- /dev/null +++ b/io/tst-fts-time64.c @@ -0,0 +1 @@ +#include "tst-fts.c" diff --git a/io/tst-futimens-time64.c b/io/tst-futimens-time64.c new file mode 100644 index 0000000000..88fcb38489 --- /dev/null +++ b/io/tst-futimens-time64.c @@ -0,0 +1,2 @@ +#define struct_stat struct stat +#include "tst-futimens.c" diff --git a/io/tst-futimens.c b/io/tst-futimens.c index b3e3f3137f..4c18ede573 100644 --- a/io/tst-futimens.c +++ b/io/tst-futimens.c @@ -20,13 +20,17 @@ #include <support/xunistd.h> |
