diff mbox series

[47/52] elf: Use LFS and 64 bit time_t for installed programs

Message ID 20210305201518.798584-48-adhemerval.zanella@linaro.org
State New
Headers show
Series Add 64 bit time support on legacy ABIs | expand

Commit Message

Adhemerval Zanella March 5, 2021, 8:15 p.m. UTC
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(-)

Comments

Florian Weimer March 5, 2021, 8:43 p.m. UTC | #1
* Adhemerval Zanella via Libc-alpha:

> The patch enables for pldd, sprof, ldconfig, and sln.

Should we do this globally at the Makerules level?

Thanks,
Florian
Adhemerval Zanella March 8, 2021, 1:14 p.m. UTC | #2
On 05/03/2021 17:43, Florian Weimer wrote:
> * Adhemerval Zanella via Libc-alpha:
> 
>> The patch enables for pldd, sprof, ldconfig, and sln.
> 
> Should we do this globally at the Makerules level?

Do we have a simple way to accomplish it?  _TIME_SIZE and LFS defines
should work for 64-bit ABIs, so we have a global rule to enable it
I think it would be better indeed.
Florian Weimer March 8, 2021, 3:26 p.m. UTC | #3
* Adhemerval Zanella:

> On 05/03/2021 17:43, Florian Weimer wrote:
>> * Adhemerval Zanella via Libc-alpha:
>> 
>>> The patch enables for pldd, sprof, ldconfig, and sln.
>> 
>> Should we do this globally at the Makerules level?
>
> Do we have a simple way to accomplish it?  _TIME_SIZE and LFS defines
> should work for 64-bit ABIs, so we have a global rule to enable it
> I think it would be better indeed.

Would it be okay to do this for MODULE_NAME=nonlib and
MODULE_NAME=ldconfig?  Then I think there would be various ways of
achieving the desired effect.

Thanks,
Florian
diff mbox series

Patch

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)