diff options
author | William Pitcock <nenolod@dereferenced.org> | 2011-03-08 02:08:50 -0600 |
---|---|---|
committer | William Pitcock <nenolod@dereferenced.org> | 2011-03-08 02:09:56 -0600 |
commit | ac0cf8d026433de1a9e7cc70f0a9def32d73bd2f (patch) | |
tree | f1cd165aacbd335b6b853aa41a918ff6336f19cd /main/libc0.9.32 | |
parent | fc887182246471ffc05faf4c367941e41ea20225 (diff) | |
download | aports-ac0cf8d026433de1a9e7cc70f0a9def32d73bd2f.tar.bz2 aports-ac0cf8d026433de1a9e7cc70f0a9def32d73bd2f.tar.xz |
main/libc0.9.32: rebase x86-64 ssp and nptl fixes based on patches queued for upstream submission
Diffstat (limited to 'main/libc0.9.32')
-rw-r--r-- | main/libc0.9.32/1.patch | 41 | ||||
-rw-r--r-- | main/libc0.9.32/2.patch | 110 | ||||
-rw-r--r-- | main/libc0.9.32/APKBUILD | 10 | ||||
-rw-r--r-- | main/libc0.9.32/pthread.patch | 81 | ||||
-rw-r--r-- | main/libc0.9.32/ssp.patch | 27 |
5 files changed, 113 insertions, 156 deletions
diff --git a/main/libc0.9.32/1.patch b/main/libc0.9.32/1.patch deleted file mode 100644 index 49a43df0a..000000000 --- a/main/libc0.9.32/1.patch +++ /dev/null @@ -1,41 +0,0 @@ -From ca7ec3c7b1a65070d9abbf2414b6a2f24917d863 Mon Sep 17 00:00:00 2001 -From: William Pitcock <nenolod@dereferenced.org> -Date: Wed, 20 Oct 2010 09:41:31 -0500 -Subject: [PATCH 1/2] libc: Fix build with stack protector enabled on x86_64. - -The code used HIDDEN_JUMPTARGET() but these symbols aren't aliased. -So we just replace that with __chk_fail@PLT. ---- - libc/string/x86_64/memcpy.S | 2 +- - libc/string/x86_64/memset.S | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/libc/string/x86_64/memcpy.S b/libc/string/x86_64/memcpy.S -index 6d941e0..f8b9e23 100644 ---- a/libc/string/x86_64/memcpy.S -+++ b/libc/string/x86_64/memcpy.S -@@ -30,7 +30,7 @@ - ENTRY (__memcpy_chk) - cmpq %rdx, %rcx - #if defined __UCLIBC_HAS_SSP__ -- jb HIDDEN_JUMPTARGET (__chk_fail) -+ jb __chk_fail@PLT - #endif - END (__memcpy_chk) - #endif -diff --git a/libc/string/x86_64/memset.S b/libc/string/x86_64/memset.S -index df265f3..38744cf 100644 ---- a/libc/string/x86_64/memset.S -+++ b/libc/string/x86_64/memset.S -@@ -33,7 +33,7 @@ - ENTRY (__memset_chk) - cmpq %rdx, %rcx - #if defined __UCLIBC_HAS_SSP__ -- jb HIDDEN_JUMPTARGET (__chk_fail) -+ jb __chk_fail@PLT - #endif - END (__memset_chk) - #endif --- -1.7.2.1 - diff --git a/main/libc0.9.32/2.patch b/main/libc0.9.32/2.patch deleted file mode 100644 index 57064f545..000000000 --- a/main/libc0.9.32/2.patch +++ /dev/null @@ -1,110 +0,0 @@ -From 1560d8c409c802ea06ecb921fcc5a534b70d32d7 Mon Sep 17 00:00:00 2001 -From: William Pitcock <nenolod@dereferenced.org> -Date: Wed, 20 Oct 2010 09:48:33 -0500 -Subject: [PATCH 2/2] libpthread: Fix compilation on x86_64. - ---- - .../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S | 2 +- - .../unix/sysv/linux/x86_64/lowlevelrobustlock.S | 2 +- - .../sysv/linux/x86_64/pthread_cond_timedwait.S | 10 +--------- - .../sysv/linux/x86_64/pthread_rwlock_timedrdlock.S | 2 +- - .../sysv/linux/x86_64/pthread_rwlock_timedwrlock.S | 2 +- - .../sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S | 2 +- - 6 files changed, 6 insertions(+), 14 deletions(-) - -diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S -index f875323..5f1d11e 100644 ---- a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S -+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S -@@ -163,7 +163,7 @@ __lll_timedlock_wait: - cfi_startproc - # ifndef __ASSUME_FUTEX_CLOCK_REALTIME - # ifdef __PIC__ -- cmpl $0, __have_futex_clock_realtime(%rip) -+ cmpl $0, __have_futex_clock_realtime@PLT - # else - cmpl $0, __have_futex_clock_realtime - # endif -diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S -index 2eb8e29..bfd9a14 100644 ---- a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S -+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S -@@ -118,7 +118,7 @@ __lll_robust_timedlock_wait: - cfi_startproc - # ifndef __ASSUME_FUTEX_CLOCK_REALTIME - # ifdef __PIC__ -- cmpl $0, __have_futex_clock_realtime(%rip) -+ cmpl $0, __have_futex_clock_realtime@PLT - # else - cmpl $0, __have_futex_clock_realtime - # endif -diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S -index 3a965ad..787298d 100644 ---- a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S -+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S -@@ -98,7 +98,7 @@ __pthread_cond_timedwait: - 22: - #ifndef __ASSUME_FUTEX_CLOCK_REALTIME - # ifdef __PIC__ -- cmpl $0, __have_futex_clock_realtime(%rip) -+ cmpl $0, __have_futex_clock_realtime@PLT - # else - cmpl $0, __have_futex_clock_realtime - # endif -@@ -437,14 +437,6 @@ __pthread_cond_timedwait: - /* Only clocks 0 and 1 are allowed so far. Both are handled in the - kernel. */ - leaq 32(%rsp), %rsi --# ifdef SHARED -- movq __vdso_clock_gettime@GOTPCREL(%rip), %rax -- movq (%rax), %rax -- PTR_DEMANGLE (%rax) -- jz 26f -- call *%rax -- jmp 27f --# endif - 26: movl $__NR_clock_gettime, %eax - syscall - 27: -diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S -index 3629ffb..5329ddd 100644 ---- a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S -+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S -@@ -96,7 +96,7 @@ pthread_rwlock_timedrdlock: - 11: - #ifndef __ASSUME_FUTEX_CLOCK_REALTIME - # ifdef __PIC__ -- cmpl $0, __have_futex_clock_realtime(%rip) -+ cmpl $0, __have_futex_clock_realtime@PLT - # else - cmpl $0, __have_futex_clock_realtime - # endif -diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S -index 23e1ee1..e31c014 100644 ---- a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S -+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S -@@ -93,7 +93,7 @@ pthread_rwlock_timedwrlock: - 11: - #ifndef __ASSUME_FUTEX_CLOCK_REALTIME - # ifdef __PIC__ -- cmpl $0, __have_futex_clock_realtime(%rip) -+ cmpl $0, __have_futex_clock_realtime@PLT - # else - cmpl $0, __have_futex_clock_realtime - # endif -diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S -index 704a222..7dfc788 100644 ---- a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S -+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S -@@ -61,7 +61,7 @@ sem_timedwait: - - #ifndef __ASSUME_FUTEX_CLOCK_REALTIME - # ifdef __PIC__ -- cmpl $0, __have_futex_clock_realtime(%rip) -+ cmpl $0, __have_futex_clock_realtime@PLT - # else - cmpl $0, __have_futex_clock_realtime - # endif --- -1.7.2.1 - diff --git a/main/libc0.9.32/APKBUILD b/main/libc0.9.32/APKBUILD index 1b21d2ee4..7e5d8d82a 100644 --- a/main/libc0.9.32/APKBUILD +++ b/main/libc0.9.32/APKBUILD @@ -4,7 +4,7 @@ pkgname=libc$_abiver _gitver= pkgver=0.9.32_rc2 _ver=${pkgver/_/-} -pkgrel=1 +pkgrel=2 pkgdesc="C library for developing embedded Linux systems" url=http://uclibc.org license="LGPL-2" @@ -20,8 +20,8 @@ _snapurl="http://git.uclibc.org/uClibc/snapshot/master.tar.bz2" _snapfile="$pkgname-$pkgver.tar.bz2" source="http://uclibc.org/downloads/uClibc-${_ver}.tar.bz2 compat-stack-guard.patch - 1.patch - 2.patch + ssp.patch + pthread.patch 0001-libm-x86_64-implement-fesetround.patch arm-nptl-tls.patch uclibcconfig.x86 @@ -120,8 +120,8 @@ libthread_db() { md5sums="c8d2cd2c4dbcf5218b6db843cf66ac0f uClibc-0.9.32-rc2.tar.bz2 4d408f72142ce55a0754948cc9cfe447 compat-stack-guard.patch -8f55efc31c41bf70d99006a7d2f7fe1e 1.patch -350a608e3d3b148af882f6e074225465 2.patch +6401044fb02f80c5e50a568d2948a5d7 ssp.patch +c92ab246b4f92487c98938a297208829 pthread.patch e0c901502602f7e9e002d910d0f32ab9 0001-libm-x86_64-implement-fesetround.patch 2b4e27207b15e2d4b3e9b853513634f6 arm-nptl-tls.patch 145aaeb1833159397cfac9902e3877ab uclibcconfig.x86 diff --git a/main/libc0.9.32/pthread.patch b/main/libc0.9.32/pthread.patch new file mode 100644 index 000000000..47f99b217 --- /dev/null +++ b/main/libc0.9.32/pthread.patch @@ -0,0 +1,81 @@ +--- uClibc-0.9.32-rc2.orig/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S ++++ uClibc-0.9.32-rc2/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S +@@ -163,7 +163,7 @@ + cfi_startproc + # ifndef __ASSUME_FUTEX_CLOCK_REALTIME + # ifdef __PIC__ +- cmpl $0, __have_futex_clock_realtime(%rip) ++ cmpl $0, __have_futex_clock_realtime@GOTOFF(%rip) + # else + cmpl $0, __have_futex_clock_realtime + # endif +--- uClibc-0.9.32-rc2.orig/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S ++++ uClibc-0.9.32-rc2/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S +@@ -118,7 +118,7 @@ + cfi_startproc + # ifndef __ASSUME_FUTEX_CLOCK_REALTIME + # ifdef __PIC__ +- cmpl $0, __have_futex_clock_realtime(%rip) ++ cmpl $0, __have_futex_clock_realtime@GOTOFF(%rip) + # else + cmpl $0, __have_futex_clock_realtime + # endif +--- uClibc-0.9.32-rc2.orig/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S ++++ uClibc-0.9.32-rc2/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S +@@ -98,7 +98,7 @@ + 22: + #ifndef __ASSUME_FUTEX_CLOCK_REALTIME + # ifdef __PIC__ +- cmpl $0, __have_futex_clock_realtime(%rip) ++ cmpl $0, __have_futex_clock_realtime@GOTOFF(%rip) + # else + cmpl $0, __have_futex_clock_realtime + # endif +@@ -437,14 +437,6 @@ + /* Only clocks 0 and 1 are allowed so far. Both are handled in the + kernel. */ + leaq 32(%rsp), %rsi +-# ifdef SHARED +- movq __vdso_clock_gettime@GOTPCREL(%rip), %rax +- movq (%rax), %rax +- PTR_DEMANGLE (%rax) +- jz 26f +- call *%rax +- jmp 27f +-# endif + 26: movl $__NR_clock_gettime, %eax + syscall + 27: +--- uClibc-0.9.32-rc2.orig/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S ++++ uClibc-0.9.32-rc2/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S +@@ -96,7 +96,7 @@ + 11: + #ifndef __ASSUME_FUTEX_CLOCK_REALTIME + # ifdef __PIC__ +- cmpl $0, __have_futex_clock_realtime(%rip) ++ cmpl $0, __have_futex_clock_realtime@GOTOFF(%rip) + # else + cmpl $0, __have_futex_clock_realtime + # endif +--- uClibc-0.9.32-rc2.orig/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S ++++ uClibc-0.9.32-rc2/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S +@@ -93,7 +93,7 @@ + 11: + #ifndef __ASSUME_FUTEX_CLOCK_REALTIME + # ifdef __PIC__ +- cmpl $0, __have_futex_clock_realtime(%rip) ++ cmpl $0, __have_futex_clock_realtime@GOTOFF(%rip) + # else + cmpl $0, __have_futex_clock_realtime + # endif +--- uClibc-0.9.32-rc2.orig/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S ++++ uClibc-0.9.32-rc2/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S +@@ -61,7 +61,7 @@ + + #ifndef __ASSUME_FUTEX_CLOCK_REALTIME + # ifdef __PIC__ +- cmpl $0, __have_futex_clock_realtime(%rip) ++ cmpl $0, __have_futex_clock_realtime@GOTOFF(%rip) + # else + cmpl $0, __have_futex_clock_realtime + # endif diff --git a/main/libc0.9.32/ssp.patch b/main/libc0.9.32/ssp.patch new file mode 100644 index 000000000..f0f75a7d8 --- /dev/null +++ b/main/libc0.9.32/ssp.patch @@ -0,0 +1,27 @@ +--- uClibc-0.9.32-rc2/libc/sysdeps/linux/common/ssp.c ++++ uClibc-0.9.32-rc2.mod/libc/sysdeps/linux/common/ssp.c +@@ -86,6 +86,7 @@ + } + + void __stack_chk_fail(void) attribute_noreturn __cold; ++libc_hidden_proto(__stack_chk_fail) + void __stack_chk_fail(void) + { + static const char msg1[] = "stack smashing detected: "; +@@ -99,8 +100,10 @@ + while(1) + terminate(); + } ++libc_hidden_def(__stack_chk_fail) + + void __chk_fail(void) attribute_noreturn; ++libc_hidden_proto(__chk_fail) + void __chk_fail(void) + { + static const char msg1[] = "buffer overflow detected: "; +@@ -114,4 +117,5 @@ + while(1) + terminate(); + } ++libc_hidden_def(__chk_fail) + |