Hi Thomas, Thomas Petazzoni wrote,
Hello,
While looking at some uClibc code, I stumbled across the following snippet in Rules.mak:
UCLIBC_LDSO_NAME := ld-uClibc ARCH_NATIVE_BIT := 32 ifneq ($(findstring $(TARGET_ARCH) , hppa64 ia64 powerpc64 s390x sparc64 x86_64 kvx ),) UCLIBC_LDSO_NAME := ld64-uClibc ARCH_NATIVE_BIT := 64 else ifeq ($(CONFIG_MIPS_N64_ABI),y) UCLIBC_LDSO_NAME := ld64-uClibc ARCH_NATIVE_BIT := 64 endif endif
I was surprised not to see aarch64 in the list of 64-bit architectures here. Turns out that the situation is not that simple in fact. Indeed, gcc does not expect all 64-bit architecture to have their dynamic loader called ld64-uClibc. For aarch64 specifically, it indeed assumes the dynamic loader is called ld-uClibc, which explains why it is working today.
However, it means that ARCH_NATIVE_BIT is defined to 32 on aarch64, which is obviously (?) wrong.
But turns out that ARCH_NATIVE_BIT is only used in utils/porting.h to define __WORDSIZE and __WORDSIZE is only used in utils/ldd.c.
So to me, it seems like this would gain in being clarified. Something like (completely untested):
Thanks for your report.
I tested your patch and it seems to work and is now part of 1.0.42 release.
best regards Waldemar