From 67114c114fb723309c117b9bb3c02a63a7fe0b71 Mon Sep 17 00:00:00 2001 From: Kevin Mihelich Date: Sun, 10 Feb 2013 03:46:53 +0000 Subject: [PATCH] core/glibc patchins and fixins --- core/glibc/PKGBUILD | 22 ++++++++-- core/glibc/fix-hf-ld.so.cache.patch | 68 +++++++++++++++++++++++++++++ core/glibc/glibc.install | 3 +- 3 files changed, 87 insertions(+), 6 deletions(-) create mode 100644 core/glibc/fix-hf-ld.so.cache.patch diff --git a/core/glibc/PKGBUILD b/core/glibc/PKGBUILD index eee1e7feb..ce51aaa8a 100644 --- a/core/glibc/PKGBUILD +++ b/core/glibc/PKGBUILD @@ -5,7 +5,8 @@ # NOTE: valgrind requires rebuilt with each major glibc version # ALARM: Kevin Mihelich -# - Patch glibc for ld-linux-armhf.so.3 and symlink ld-linux.so.3 +# - Patch for ld-linux-armhf.so.3 transition and symlink ld-linux.so.3 +# - Patch for hard-float ld.so.cache transition # - Changed configure to enable ports add-on, specify our build host type # - Disabled distcc @@ -24,11 +25,12 @@ makedepends=('gcc>=4.7') backup=(etc/gai.conf etc/locale.gen etc/nscd.conf) -options=('!strip') +options=('!strip' '!distcc') install=glibc.install source=(http://ftp.gnu.org/gnu/libc/${pkgname}-${pkgver}.tar.xz{,.sig} glibc-2.17-sync-with-linux37.patch local-soname-hack.diff + fix-hf-ld.so.cache.patch nscd.service nscd.tmpfiles locale.gen.txt @@ -48,7 +50,10 @@ build() { patch -p1 -i ${srcdir}/glibc-2.17-sync-with-linux37.patch # ALARM: patch for hard-float ld-linux soname - [[ $CARCH == "armv6h" || $CARCH == "armv7h" ]] && patch -p1 -i ${srcdir}/local-soname-hack.diff + if [[ $CARCH == "armv6h" || $CARCH == "armv7h" ]]; then + patch -p1 -i ${srcdir}/local-soname-hack.diff + patch -p1 -i ${srcdir}/fix-hf-ld.so.cache.patch + fi cd ${srcdir} mkdir glibc-build @@ -133,7 +138,7 @@ package() { ${srcdir}/glibc-${pkgver}/localedata/SUPPORTED >> ${pkgdir}/etc/locale.gen # ALARM: symlink ld-linux.so.3 for hard-float - [[ $CARCH == "armv6h" || $CARCH == "armv7h" ]] && ln -s /lib/ld-${pkgver}.so ${pkgdir}/lib/ld-linux.so.3 + [[ $CARCH == "armv6h" || $CARCH == "armv7h" ]] && ln -s /lib/ld-${pkgver}.so ${pkgdir}/usr/lib/ld-linux.so.3 # Do not strip the following files for improved debugging support # ("improved" as in not breaking gdb and valgrind...): @@ -158,3 +163,12 @@ package() { usr/lib/{libmemusage,libpcprofile,libSegFault}.so \ usr/lib/{pt_chown,{audit,gconv}/*.so} } +md5sums=('87bf675c8ee523ebda4803e8e1cec638' + '6db4d1661cf34282755dc90330465f6d' + 'fb99380d94598cc76d793deebf630022' + 'fa192d063312907797eb48f59da99588' + 'dee46cbd2e544a61c263a0af39cc934c' + 'ad8a9af15ab7eeaa23dc7ee85024af9f' + 'bccbe5619e75cf1d97312ec3681c605c' + '07ac979b6ab5eeb778d55f041529d623' + '476e9113489f93b348b21e144b6a8fcf') diff --git a/core/glibc/fix-hf-ld.so.cache.patch b/core/glibc/fix-hf-ld.so.cache.patch new file mode 100644 index 000000000..bfaea2f09 --- /dev/null +++ b/core/glibc/fix-hf-ld.so.cache.patch @@ -0,0 +1,68 @@ +diff --git a/elf/cache.c b/elf/cache.c +index 9901952..699550b 100644 +--- 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: +diff --git a/sysdeps/generic/ldconfig.h b/sysdeps/generic/ldconfig.h +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" +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 +--- 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 +diff --git a/ports/sysdeps/unix/sysv/linux/arm/readelflib.c b/ports/sysdeps/unix/sysv/linux/arm/readelflib.c +index 81e5ccb..0fbd0dc 100644 +--- 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; + } + } diff --git a/core/glibc/glibc.install b/core/glibc/glibc.install index 7f85ade96..83bde9c13 100644 --- a/core/glibc/glibc.install +++ b/core/glibc/glibc.install @@ -3,8 +3,7 @@ filelist=(libc.info{,-1,-2,-3,-4,-5,-6,-7,-8,-9,-10,-11}) post_upgrade() { sbin/ldconfig -r . - [ -x sbin/init ] && sbin/init u - usr/sbin/locale-gen + locale-gen [ -x usr/bin/install-info ] || return 0 for file in ${filelist[@]}; do