From 46b124f0b96cb8f11d76ddce7b8e36e59d8536a9 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Tue, 2 Mar 2021 17:09:40 -0300 Subject: elf: Use LFS and 64 bit time_t for installed programs The patch enables for pldd, sprof, ldconfig, and sln. Checked on i686-linux-gnu and x86_64-linux-gnu. --- elf/Makefile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/elf/Makefile b/elf/Makefile index b06bf6ca20..bad8594e64 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -79,6 +79,8 @@ ifeq (yes,$(have-loop-to-function)) CFLAGS-rtld.c += -fno-tree-loop-distribute-patterns endif +CFLAGS-pldd.c += -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 + # Compile rtld itself without stack protection. # Also compile all routines in the static library that are elided from # the shared libc because they are in libc.a in the same way. @@ -663,14 +665,23 @@ $(objpfx)ldd: ldd.bash.in $(common-objpfx)soversions.mk \ mv -f $@.new $@ $(objpfx)sprof: $(libdl) +CFLAGS-sprof.c += -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 $(objpfx)sln: $(sln-modules:%=$(objpfx)%.o) +CFLAGS-sln.c += -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 $(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o) +include $(o-iterator) +define o-iterator-doit +$(foreach f,$(ldconfig-modules),$(objpfx)$(f)$(o)): CFLAGS += -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 +endef +object-suffixes-left := $(all-object-suffixes) +include $(o-iterator) SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"' CFLAGS-ldconfig.c += $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \ - -D'SLIBDIR="$(slibdir)"' + -D'SLIBDIR="$(slibdir)"' \ + -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 libof-ldconfig = ldconfig CFLAGS-dl-cache.c += $(SYSCONF-FLAGS) CFLAGS-cache.c += $(SYSCONF-FLAGS) -- cgit v1.2.1