From 5c6a78d92d0a3cd8cf9812c71feb9ef9ac7e5a54 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Mon, 25 Mar 2013 22:01:08 +0100 Subject: [PATCH] glibc: add patch (via alarm) to fix ld.so.cache on armhf. --- .../patches/arm-fix-hf-ld.so.cache.patch | 68 +++++++++++++++++++ srcpkgs/glibc/template | 16 ++--- 2 files changed, 74 insertions(+), 10 deletions(-) create mode 100644 srcpkgs/glibc/patches/arm-fix-hf-ld.so.cache.patch diff --git a/srcpkgs/glibc/patches/arm-fix-hf-ld.so.cache.patch b/srcpkgs/glibc/patches/arm-fix-hf-ld.so.cache.patch new file mode 100644 index 00000000000..3980aa9c95a --- /dev/null +++ b/srcpkgs/glibc/patches/arm-fix-hf-ld.so.cache.patch @@ -0,0 +1,68 @@ +diff --git a/elf/cache.c b/elf/cache.c +index 9901952..699550b 100644 +--- elf/cache.c ++++ 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: +diff --git a/sysdeps/generic/ldconfig.h b/sysdeps/generic/ldconfig.h +index 57a9a46..91190aa 100644 +--- sysdeps/generic/ldconfig.h ++++ 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" +diff --git a/ports/sysdeps/unix/sysv/linux/arm/dl-cache.h b/ports/sysdeps/unix/sysv/linux/arm/dl-cache.h +index acc4f28..1221181 100644 +--- ports/sysdeps/unix/sysv/linux/arm/dl-cache.h ++++ 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 +diff --git a/ports/sysdeps/unix/sysv/linux/arm/readelflib.c b/ports/sysdeps/unix/sysv/linux/arm/readelflib.c +index 81e5ccb..0fbd0dc 100644 +--- ports/sysdeps/unix/sysv/linux/arm/readelflib.c ++++ 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; + } + } diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template index f910610e650..f7bd4fcfef3 100644 --- a/srcpkgs/glibc/template +++ b/srcpkgs/glibc/template @@ -1,7 +1,7 @@ # Template file for 'glibc' pkgname=glibc version=2.17 -revision=4 +revision=5 short_desc="The GNU C library" maintainer="Juan RP " homepage="http://www.gnu.org/software/libc" @@ -24,11 +24,7 @@ nostrip_files=" conf_files="/etc/rpc /etc/ld.so.conf" subpackages="glibc-devel glibc-locales nscd" depends="base-files glibc-locales" -makedepends="bison perl kernel-libc-headers>=3.7<3.8" - -if [ -n "$XBPS_CROSS_TRIPLET" ]; then - makedepends="bison perl" -fi +hostmakedepends="bison perl kernel-libc-headers>=3.7<3.8" do_configure() { local _headers _floatabi @@ -39,17 +35,17 @@ do_configure() { echo "bindir=/usr/bin" >> configparms echo "sbindir=/usr/sbin" >> configparms - if [ "${XBPS_MACHINE}" = "i686" ]; then + if [ "$XBPS_TARGET_MACHINE" = "i686" ]; then # Build with -mno-tls-direct-seg-refs to avoid performance # problems with Xen on x86 32bit. export CFLAGS="${CFLAGS} -mno-tls-direct-seg-refs" - elif [ "$XBPS_MACHINE" = "armv6l" ]; then + elif [ "$XBPS_TARGET_MACHINE" = "armv6l" ]; then # Force hard float ABI. # To build for soft float: --with-float=soft --without-fp. _floatabi="--with-float=hard" fi - if [ -n "$XBPS_CROSS_TRIPLET" ]; then - _headers="--with-headers=/usr/$XBPS_CROSS_TRIPLET/include" + if [ "$XBPS_CROSS_BUILD" ]; then + _headers="--with-headers=$XBPS_CROSS_BASE/include" else _headers="--with-headers=/usr/include" fi