https://454200.bugs.gentoo.org/attachment.cgi?id=346650 http://sourceware.org/bugzilla/attachment.cgi?id=7008 We can now build an ld.so.cache of ARM shared objects on an x86 machine. --- a/elf/cache.c +++ b/elf/cache.c @@ -100,6 +100,10 @@ print_entry (const char *lib, int flag, unsigned int osversion, case FLAG_AARCH64_LIB64: fputs (",AArch64", stdout); break; + /* Uses the ARM soft-float ABI. */ + case FLAG_ARM_LIBSF: + fputs (",soft-float", stdout); + break; case 0: break; default: index 57a9a46..91190aa 100644 --- a/sysdeps/generic/ldconfig.h +++ b/sysdeps/generic/ldconfig.h @@ -36,6 +36,7 @@ #define FLAG_X8664_LIBX32 0x0800 #define FLAG_ARM_LIBHF 0x0900 #define FLAG_AARCH64_LIB64 0x0a00 +#define FLAG_ARM_LIBSF 0x0b00 /* Name of auxiliary cache. */ #define _PATH_LDCONFIG_AUX_CACHE "/var/cache/ldconfig/aux-cache" --- a/ports/sysdeps/unix/sysv/linux/arm/dl-cache.h +++ b/ports/sysdeps/unix/sysv/linux/arm/dl-cache.h @@ -18,12 +18,17 @@ #include +/* In order to support the transition from unmarked objects + to marked objects we must treat unmarked objects as + compatible with either FLAG_ARM_LIBHF or FLAG_ARM_LIBSF. */ #ifdef __ARM_PCS_VFP # define _dl_cache_check_flags(flags) \ - ((flags) == (FLAG_ARM_LIBHF | FLAG_ELF_LIBC6)) + ((flags) == (FLAG_ARM_LIBHF | FLAG_ELF_LIBC6) \ + || (flags) == FLAG_ELF_LIBC6) #else # define _dl_cache_check_flags(flags) \ - ((flags) == FLAG_ELF_LIBC6) + ((flags) == (FLAG_ARM_LIBSF | FLAG_ELF_LIBC6) \ + || (flags) == FLAG_ELF_LIBC6) #endif #include_next --- a/ports/sysdeps/unix/sysv/linux/arm/readelflib.c +++ b/ports/sysdeps/unix/sysv/linux/arm/readelflib.c @@ -46,6 +46,12 @@ process_elf_file (const char *file_name, const char *lib, int *flag, if (elf32_header->e_flags & EF_ARM_ABI_FLOAT_HARD) *flag = FLAG_ARM_LIBHF|FLAG_ELF_LIBC6; else if (elf32_header->e_flags & EF_ARM_ABI_FLOAT_SOFT) + *flag = FLAG_ARM_LIBSF|FLAG_ELF_LIBC6; + else + /* We must assume the unmarked objects are compatible + with all ABI variants. Such objects may have been + generated in a transitional period when the ABI + tags were not added to all objects. */ *flag = FLAG_ELF_LIBC6; } }