This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch gentoo/2.22 updated. glibc-2.22-13-g7bc2caf
- From: vapier at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 5 Aug 2015 13:39:56 -0000
- Subject: GNU C Library master sources branch gentoo/2.22 updated. glibc-2.22-13-g7bc2caf
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, gentoo/2.22 has been updated
via 7bc2cafecb7b32902f85ef39112fcb5537f28b04 (commit)
via ebe01981adb3d4baf60da2623b031db97498eb18 (commit)
via 8175e9150a768a1eb135347bdb40b8161cb872dc (commit)
via 6fef29c020d055f994cf7c4602b01a553b7a9860 (commit)
via 98b9c13e1abcf8d941d7934eed1a33527d6fd39b (commit)
via ca167a22d2be6653898bfd168c9909387381e0f1 (commit)
via 016376847a12b35e43cd82d6964451b3d391b8ed (commit)
via e973063f44ce67dd737e88765afb024a06fca847 (commit)
via 57dbdc64994f65c96d7ffcf4ead6b24bb78e7135 (commit)
via e6a8de48ec06fb5dd8f8168c97e03115ec271804 (commit)
via de1e604b49e03d2dc6d24e6f30f1e120481101b6 (commit)
via 9eef0eeeff0eb128fea73e3530e686c0afbdc78a (commit)
via b49a9c12c0bfda5c03372539c22e89b9d0bc4b85 (commit)
from 78bd7499af46d739ce94410eaeea006e874ca9e5 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7bc2cafecb7b32902f85ef39112fcb5537f28b04
commit 7bc2cafecb7b32902f85ef39112fcb5537f28b04
Author: Mike Frysinger <vapier@gentoo.org>
Date: Wed Jul 29 22:53:28 2015 -0400
nptl: fix set-but-unused warning w/_STACK_GROWS_UP
On arches that set _STACK_GROWS_UP, the stacktop variable is declared
and set, but never actually used. Refactor the code a bit so that the
variable is only declared/set under _STACK_GROWS_DOWN settings.
diff --git a/ChangeLog b/ChangeLog
index cb9124e..95cc5a2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-08-05 Mike Frysinger <vapier@gentoo.org>
+
+ * nptl/allocatestack.c (allocate_stack): Move stacktop decl down to
+ bottom and under _STACK_GROWS_DOWN. Move the stacktop assignment
+ in there too.
+
2015-08-05 Carlos O'Donell <carlos@systemhalted.org>
* version.h (RELEASE): Set to "stable".
diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c
index d97c89a..f182e9a 100644
--- a/nptl/allocatestack.c
+++ b/nptl/allocatestack.c
@@ -353,7 +353,6 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
struct pthread *pd;
size_t size;
size_t pagesize_m1 = __getpagesize () - 1;
- void *stacktop;
assert (powerof2 (pagesize_m1 + 1));
assert (TCB_ALIGNMENT >= STACK_ALIGN);
@@ -724,19 +723,23 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
/* We place the thread descriptor at the end of the stack. */
*pdp = pd;
-#if TLS_TCB_AT_TP
+#if _STACK_GROWS_DOWN
+ void *stacktop;
+
+# if TLS_TCB_AT_TP
/* The stack begins before the TCB and the static TLS block. */
stacktop = ((char *) (pd + 1) - __static_tls_size);
-#elif TLS_DTV_AT_TP
+# elif TLS_DTV_AT_TP
stacktop = (char *) (pd - 1);
-#endif
+# endif
-#ifdef NEED_SEPARATE_REGISTER_STACK
+# ifdef NEED_SEPARATE_REGISTER_STACK
*stack = pd->stackblock;
*stacksize = stacktop - *stack;
-#elif _STACK_GROWS_DOWN
+# else
*stack = stacktop;
-#elif _STACK_GROWS_UP
+# endif
+#else
*stack = pd->stackblock;
#endif
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ebe01981adb3d4baf60da2623b031db97498eb18
commit ebe01981adb3d4baf60da2623b031db97498eb18
Author: Kevin F. Quinn <kevquinn@gentoo.org>
Date: Tue Sep 9 17:41:57 2014 -0400
disable PIE when checking for PIC default
When the compiler builds PIEs by default, the configure PIC check is
confused into thinking PIC code is default. The end result is that
we end up with only PIC being produced.
Run the configure check with -fno-PIE so that we produce PIC & non-PIC
(PIE) objects like normal.
2014-09-09 Kevin F. Quinn <kevquinn@gentoo.org>
* configure.ac (libc_cv_pic_default): Pass -fno-PIE.
* configure: Regenerated.
diff --git a/configure b/configure
index 45cc7cb..f714fce 100755
--- a/configure
+++ b/configure
@@ -7309,7 +7309,7 @@ cat > conftest.c <<EOF
# error PIC is default.
#endif
EOF
-if eval "${CC-cc} -S conftest.c 2>&5 1>&5"; then
+if eval "${CC-cc} -fno-PIE -S conftest.c 2>&5 1>&5"; then
libc_cv_pic_default=no
fi
rm -f conftest.*
diff --git a/configure.ac b/configure.ac
index 7e9383a..ab3920b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2069,7 +2069,7 @@ cat > conftest.c <<EOF
# error PIC is default.
#endif
EOF
-if eval "${CC-cc} -S conftest.c 2>&AS_MESSAGE_LOG_FD 1>&AS_MESSAGE_LOG_FD"; then
+if eval "${CC-cc} -fno-PIE -S conftest.c 2>&AS_MESSAGE_LOG_FD 1>&AS_MESSAGE_LOG_FD"; then
libc_cv_pic_default=no
fi
rm -f conftest.*])
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8175e9150a768a1eb135347bdb40b8161cb872dc
commit 8175e9150a768a1eb135347bdb40b8161cb872dc
Author: John David Anglin <dave.anglin@bell.net>
Date: Sun Aug 10 09:54:53 2014 -0400
hppa: fix pthread spinlock
diff --git a/sysdeps/hppa/nptl/pthread_spin_init.c b/sysdeps/hppa/nptl/pthread_spin_init.c
index 865ef2b..a49a846 100644
--- a/sysdeps/hppa/nptl/pthread_spin_init.c
+++ b/sysdeps/hppa/nptl/pthread_spin_init.c
@@ -20,9 +20,9 @@
int
pthread_spin_init (pthread_spinlock_t *lock, int pshared)
{
- int tmp = 0;
- /* This should be a memory barrier to newer compilers */
- __asm__ __volatile__ ("stw,ma %1,0(%0)"
- : : "r" (lock), "r" (tmp) : "memory");
+ /* The LWS-CAS operation on hppa is a synthetic atomic operation
+ that doesn't provide the type of coherency that we need. Therefore
+ we force that coherency by using LWS-CAS again. */
+ atomic_exchange_rel (lock, 0);
return 0;
}
diff --git a/sysdeps/hppa/nptl/pthread_spin_unlock.c b/sysdeps/hppa/nptl/pthread_spin_unlock.c
index a183fed..b576649 100644
--- a/sysdeps/hppa/nptl/pthread_spin_unlock.c
+++ b/sysdeps/hppa/nptl/pthread_spin_unlock.c
@@ -20,9 +20,9 @@
int
pthread_spin_unlock (pthread_spinlock_t *lock)
{
- int tmp = 0;
- /* This should be a memory barrier to newer compilers */
- __asm__ __volatile__ ("stw,ma %1,0(%0)"
- : : "r" (lock), "r" (tmp) : "memory");
+ /* The LWS-CAS operation on hppa is a synthetic atomic operation
+ that doesn't provide the type of coherency that we need. Therefore
+ we force that coherency by using LWS-CAS again. */
+ atomic_exchange_rel (lock, 0);
return 0;
}
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=6fef29c020d055f994cf7c4602b01a553b7a9860
commit 6fef29c020d055f994cf7c4602b01a553b7a9860
Author: John David Anglin <dave.anglin@bell.net>
Date: Sun Aug 10 09:39:25 2014 -0400
hppa: fix build problems with atomic code
Specifically:
../sysdeps/unix/sysv/linux/hppa/bits/atomic.h:68:6: error:
can't find a register in class 'R1_REGS' while reloading 'asm'
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/atomic.h b/sysdeps/unix/sysv/linux/hppa/bits/atomic.h
index abde83e..b2294ba 100644
--- a/sysdeps/unix/sysv/linux/hppa/bits/atomic.h
+++ b/sysdeps/unix/sysv/linux/hppa/bits/atomic.h
@@ -64,35 +64,39 @@ typedef uintmax_t uatomic_max_t;
#if __ASSUME_LWS_CAS
/* The only basic operation needed is compare and exchange. */
+static int __attribute__((noinline, unused))
+__atomic_compare_and_exchange_val_acq (int mem, int newval, int oldval)
+{
+ volatile int lws_errno;
+ volatile int lws_ret;
+ asm volatile(
+ "0: \n\t"
+ "copy %2, %%r26 \n\t"
+ "copy %3, %%r25 \n\t"
+ "copy %4, %%r24 \n\t"
+ "ble " _LWS "(%%sr2, %%r0) \n\t"
+ "ldi " _LWS_CAS ", %%r20 \n\t"
+ "ldi " _ASM_EAGAIN ", %%r24 \n\t"
+ "cmpb,=,n %%r24, %%r21, 0b \n\t"
+ "nop \n\t"
+ "ldi " _ASM_EDEADLOCK ", %%r25 \n\t"
+ "cmpb,=,n %%r25, %%r21, 0b \n\t"
+ "nop \n\t"
+ "stw %%r28, %0 \n\t"
+ "stw %%r21, %1 \n\t"
+ : "=m" (lws_ret), "=m" (lws_errno)
+ : "r" (mem), "r" (oldval), "r" (newval)
+ : _LWS_CLOBBER
+ );
+
+ if (lws_errno == -EFAULT || lws_errno == -ENOSYS)
+ ABORT_INSTRUCTION;
+
+ return lws_ret;
+}
# define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
- ({ \
- volatile int lws_errno; \
- __typeof__ (*mem) lws_ret; \
- asm volatile( \
- "0: \n\t" \
- "copy %2, %%r26 \n\t" \
- "copy %3, %%r25 \n\t" \
- "copy %4, %%r24 \n\t" \
- "ble " _LWS "(%%sr2, %%r0) \n\t" \
- "ldi " _LWS_CAS ", %%r20 \n\t" \
- "ldi " _ASM_EAGAIN ", %%r24 \n\t" \
- "cmpb,=,n %%r24, %%r21, 0b \n\t" \
- "nop \n\t" \
- "ldi " _ASM_EDEADLOCK ", %%r25 \n\t" \
- "cmpb,=,n %%r25, %%r21, 0b \n\t" \
- "nop \n\t" \
- "stw %%r28, %0 \n\t" \
- "stw %%r21, %1 \n\t" \
- : "=m" (lws_ret), "=m" (lws_errno) \
- : "r" (mem), "r" (oldval), "r" (newval) \
- : _LWS_CLOBBER \
- ); \
- \
- if(lws_errno == -EFAULT || lws_errno == -ENOSYS) \
- ABORT_INSTRUCTION; \
- \
- lws_ret; \
- })
+ ((__typeof__(oldval)) \
+ __atomic_compare_and_exchange_val_acq ((int)mem, (int)newval, (int)oldval))
# define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) \
({ \
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=98b9c13e1abcf8d941d7934eed1a33527d6fd39b
commit 98b9c13e1abcf8d941d7934eed1a33527d6fd39b
Author: David Lamparter <equinox-gentoo@diac24.net>
Date: Fri Aug 16 15:06:34 2013 -0400
arm: fix PIC vs SHARED typos
the logic in setjmp/__longjmp incorrectly tie to "PIC" to figure out
whether the code is going into a shared library when it should be using
"SHARED". otherwise, building static PIC code goes wrong.
https://bugs.gentoo.org/336914
http://sourceware.org/ml/libc-ports/2011-09/msg00018.html
2011-09-19 David Lamparter <equinox-gentoo@diac24.net>
* sysdeps/arm/setjmp.S: Change PIC to SHARED.
* sysdeps/arm/__longjmp.S: Likewise
diff --git a/sysdeps/arm/__longjmp.S b/sysdeps/arm/__longjmp.S
index fc60a5d..1033e13 100644
--- a/sysdeps/arm/__longjmp.S
+++ b/sysdeps/arm/__longjmp.S
@@ -81,7 +81,7 @@ ENTRY (__longjmp)
C_SYMBOL_NAME(_rtld_local_ro) \
+ RTLD_GLOBAL_RO_DL_HWCAP_OFFSET)
# else
-# ifdef PIC
+# ifdef SHARED
LDR_GLOBAL (a4, a3, C_SYMBOL_NAME(_rtld_global_ro), \
RTLD_GLOBAL_RO_DL_HWCAP_OFFSET)
# else
diff --git a/sysdeps/arm/setjmp.S b/sysdeps/arm/setjmp.S
index e44beb4..be0a4ec 100644
--- a/sysdeps/arm/setjmp.S
+++ b/sysdeps/arm/setjmp.S
@@ -62,7 +62,7 @@ ENTRY (__sigsetjmp)
C_SYMBOL_NAME(_rtld_local_ro) \
+ RTLD_GLOBAL_RO_DL_HWCAP_OFFSET)
# else
-# ifdef PIC
+# ifdef SHARED
LDR_GLOBAL (a3, a4, C_SYMBOL_NAME(_rtld_global_ro), \
RTLD_GLOBAL_RO_DL_HWCAP_OFFSET)
# else
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ca167a22d2be6653898bfd168c9909387381e0f1
commit ca167a22d2be6653898bfd168c9909387381e0f1
Author: Mike Frysinger <vapier@gentoo.org>
Date: Fri Aug 16 15:05:26 2013 -0400
gentoo: disable building in timezone subdir
We've split this out into the package sys-libs/timezone-data
diff --git a/Makeconfig b/Makeconfig
index 0dbcafd..a1166d5 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -1096,7 +1096,7 @@ all-subdirs = csu assert ctype locale intl catgets math setjmp signal \
stdlib stdio-common libio malloc string wcsmbs time dirent \
grp pwd posix io termios resource misc socket sysvipc gmon \
gnulib iconv iconvdata wctype manual shadow gshadow po argp \
- crypt localedata timezone rt conform debug mathvec \
+ crypt localedata rt conform debug mathvec \
$(add-on-subdirs) dlfcn elf
ifndef avoid-generated
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=016376847a12b35e43cd82d6964451b3d391b8ed
commit 016376847a12b35e43cd82d6964451b3d391b8ed
Author: Stephanie J. Lockwood-Childs <wormo@gentoo.org>
Date: Fri Aug 16 15:03:41 2013 -0400
gentoo: support running tests under sandbox
when glibc runs its tests, it does so by invoking the local library loader.
in Gentoo, we build/run inside of our "sandbox" which itself is linked against
libdl (so that it can load libraries and pull out symbols). the trouble
is that when you upgrade from an older glibc to the new one, often times
internal symbols change name or abi. this is normally OK as you cannot use
libc.so from say version 2.3.6 but libpthread.so from say version 2.5, so
we always say "keep all of the glibc libraries from the same build". but
when glibc runs its tests, it uses dynamic paths to point to its new local
copies of libraries. if the test doesnt use libdl, then glibc doesnt add
its path, and when sandbox triggers the loading of libdl, glibc does so
from the host system system. this gets us into the case of all libraries
are from the locally compiled version of glibc except for libdl.so.
http://bugs.gentoo.org/56898
diff --git a/Makeconfig b/Makeconfig
index f136b88..0dbcafd 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -648,7 +648,7 @@ comma = ,
sysdep-library-path = \
$(subst $(empty) ,:,$(strip $(patsubst -Wl$(comma)-rpath-link=%, %,\
$(filter -Wl$(comma)-rpath-link=%,\
- $(sysdep-LDFLAGS)))))
+ $(sysdep-LDFLAGS)))) $(common-objpfx)/dlfcn)
# $(run-via-rtld-prefix) is a command that, when prepended to the name
# of a program built with the newly built library, produces a command
# that, executed on the host for which the library is built, runs that
diff --git a/iconvdata/run-iconv-test.sh b/iconvdata/run-iconv-test.sh
index 557db6b..23c2c35 100755
--- a/iconvdata/run-iconv-test.sh
+++ b/iconvdata/run-iconv-test.sh
@@ -31,7 +31,7 @@ temp2=$codir/iconvdata/iconv-test.yyy
trap "rm -f $temp1 $temp2" 1 2 3 15
# We have to have some directories in the library path.
-LIBPATH=$codir:$codir/iconvdata
+LIBPATH=$codir:$codir/iconvdata:$codir/dlfcn
# How the start the iconv(1) program.
ICONV='$codir/elf/ld.so --library-path $LIBPATH --inhibit-rpath ${from}.so \
diff --git a/nptl/tst-tls6.sh b/nptl/tst-tls6.sh
index 3533474..e58f3f6 100755
--- a/nptl/tst-tls6.sh
+++ b/nptl/tst-tls6.sh
@@ -26,7 +26,7 @@ run_program_env=$1; shift
logfile=$common_objpfx/nptl/tst-tls6.out
# We have to find libc and nptl
-library_path=${common_objpfx}:${common_objpfx}nptl
+library_path=${common_objpfx}:${common_objpfx}nptl:${common_objpfx}/dlfcn
tst_tls5="${test_via_rtld_prefix} ${common_objpfx}/nptl/tst-tls5"
> $logfile
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e973063f44ce67dd737e88765afb024a06fca847
commit e973063f44ce67dd737e88765afb024a06fca847
Author: Guy Martin <gmsoft@tuxicoman.be>
Date: Fri Aug 16 15:00:05 2013 -0400
rtld: do not ignore arch-specific CFLAGS
https://bugs.gentoo.org/452184
http://sourceware.org/bugzilla/show_bug.cgi?id=15005
http://sourceware.org/ml/libc-alpha/2013-01/msg00247.html
diff --git a/elf/Makefile b/elf/Makefile
index 4ceeaf8..a995bd2 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -449,7 +449,7 @@ CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \
libof-ldconfig = ldconfig
CFLAGS-dl-cache.c = $(SYSCONF-FLAGS)
CFLAGS-cache.c = $(SYSCONF-FLAGS)
-CFLAGS-rtld.c = $(SYSCONF-FLAGS)
+CFLAGS-rtld.c += $(SYSCONF-FLAGS)
cpp-srcs-left := $(all-rtld-routines:=.os)
lib := rtld
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=57dbdc64994f65c96d7ffcf4ead6b24bb78e7135
commit 57dbdc64994f65c96d7ffcf4ead6b24bb78e7135
Author: Carlos O'Donell <carlos@systemhalted.org>
Date: Fri Aug 16 14:57:59 2013 -0400
nptl: support thread stacks that grow up
http://bugs.gentoo.org/301642
diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c
index c56a4df..d97c89a 100644
--- a/nptl/allocatestack.c
+++ b/nptl/allocatestack.c
@@ -373,6 +373,13 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
if (__glibc_unlikely (attr->flags & ATTR_FLAG_STACKADDR))
{
uintptr_t adj;
+ char *stackaddr = (char *) attr->stackaddr;
+
+ /* Assume the same layout as the _STACK_GROWS_DOWN case, with struct
+ pthread at the top of the stack block. Later we adjust the guard
+ location and stack address to match the _STACK_GROWS_UP case. */
+ if (_STACK_GROWS_UP)
+ stackaddr += attr->stacksize;
/* If the user also specified the size of the stack make sure it
is large enough. */
@@ -382,11 +389,11 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
/* Adjust stack size for alignment of the TLS block. */
#if TLS_TCB_AT_TP
- adj = ((uintptr_t) attr->stackaddr - TLS_TCB_SIZE)
+ adj = ((uintptr_t) stackaddr - TLS_TCB_SIZE)
& __static_tls_align_m1;
assert (size > adj + TLS_TCB_SIZE);
#elif TLS_DTV_AT_TP
- adj = ((uintptr_t) attr->stackaddr - __static_tls_size)
+ adj = ((uintptr_t) stackaddr - __static_tls_size)
& __static_tls_align_m1;
assert (size > adj);
#endif
@@ -396,10 +403,10 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
the stack. It is the user's responsibility to do this if it
is wanted. */
#if TLS_TCB_AT_TP
- pd = (struct pthread *) ((uintptr_t) attr->stackaddr
+ pd = (struct pthread *) ((uintptr_t) stackaddr
- TLS_TCB_SIZE - adj);
#elif TLS_DTV_AT_TP
- pd = (struct pthread *) (((uintptr_t) attr->stackaddr
+ pd = (struct pthread *) (((uintptr_t) stackaddr
- __static_tls_size - adj)
- TLS_PRE_TCB_SIZE);
#endif
@@ -411,7 +418,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
pd->specific[0] = pd->specific_1stblock;
/* Remember the stack-related values. */
- pd->stackblock = (char *) attr->stackaddr - size;
+ pd->stackblock = (char *) stackaddr - size;
pd->stackblock_size = size;
/* This is a user-provided stack. It will not be queued in the
@@ -635,7 +642,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
char *guard = mem + (((size - guardsize) / 2) & ~pagesize_m1);
#elif _STACK_GROWS_DOWN
char *guard = mem;
-# elif _STACK_GROWS_UP
+#elif _STACK_GROWS_UP
char *guard = (char *) (((uintptr_t) pd - guardsize) & ~pagesize_m1);
#endif
if (mprotect (guard, guardsize, PROT_NONE) != 0)
@@ -731,7 +738,6 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
*stack = stacktop;
#elif _STACK_GROWS_UP
*stack = pd->stackblock;
- assert (*stack > 0);
#endif
return 0;
diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
index d10f4ea..b08ba45 100644
--- a/nptl/pthread_create.c
+++ b/nptl/pthread_create.c
@@ -428,12 +428,25 @@ START_THREAD_DEFN
#ifdef _STACK_GROWS_DOWN
char *sp = CURRENT_STACK_FRAME;
size_t freesize = (sp - (char *) pd->stackblock) & ~pagesize_m1;
-#else
-# error "to do"
-#endif
assert (freesize < pd->stackblock_size);
if (freesize > PTHREAD_STACK_MIN)
__madvise (pd->stackblock, freesize - PTHREAD_STACK_MIN, MADV_DONTNEED);
+#else
+ /* Page aligned start of memory to free (higher than or equal
+ to current sp plus the minimum stack size). */
+ void *freeblock = (void*)((size_t)(CURRENT_STACK_FRAME
+ + PTHREAD_STACK_MIN
+ + pagesize_m1)
+ & ~pagesize_m1);
+ char *free_end = (char *) (((uintptr_t) pd - pd->guardsize) & ~pagesize_m1);
+ /* Is there any space to free? */
+ if (free_end > (char *)freeblock)
+ {
+ size_t freesize = (size_t)(free_end - (char *)freeblock);
+ assert (freesize < pd->stackblock_size);
+ __madvise (freeblock, freesize, MADV_DONTNEED);
+ }
+#endif
/* If the thread is detached free the TCB. */
if (IS_DETACHED (pd))
diff --git a/nptl/pthread_getattr_np.c b/nptl/pthread_getattr_np.c
index 52a4602..9834302 100644
--- a/nptl/pthread_getattr_np.c
+++ b/nptl/pthread_getattr_np.c
@@ -60,7 +60,11 @@ pthread_getattr_np (thread_id, attr)
if (__glibc_likely (thread->stackblock != NULL))
{
iattr->stacksize = thread->stackblock_size;
+#if _STACK_GROWS_DOWN
iattr->stackaddr = (char *) thread->stackblock + iattr->stacksize;
+#else
+ iattr->stackaddr = (char *) thread->stackblock;
+#endif
}
else
{
@@ -105,7 +109,9 @@ pthread_getattr_np (thread_id, attr)
char *line = NULL;
size_t linelen = 0;
+#if _STACK_GROWS_DOWN
uintptr_t last_to = 0;
+#endif
while (! feof_unlocked (fp))
{
@@ -129,17 +135,24 @@ pthread_getattr_np (thread_id, attr)
stack extension request. */
iattr->stacksize = (iattr->stacksize
& -(intptr_t) GLRO(dl_pagesize));
-
+#if _STACK_GROWS_DOWN
/* The limit might be too high. */
if ((size_t) iattr->stacksize
> (size_t) iattr->stackaddr - last_to)
iattr->stacksize = (size_t) iattr->stackaddr - last_to;
-
+#else
+ /* The limit might be too high. */
+ if ((size_t) iattr->stacksize
+ > to - (size_t) iattr->stackaddr)
+ iattr->stacksize = to - (size_t) iattr->stackaddr;
+#endif
/* We succeed and no need to look further. */
ret = 0;
break;
}
+#if _STACK_GROWS_DOWN
last_to = to;
+#endif
}
free (line);
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e6a8de48ec06fb5dd8f8168c97e03115ec271804
commit e6a8de48ec06fb5dd8f8168c97e03115ec271804
Author: Thorsten Kukuk <kukuk@suse.de>
Date: Fri Aug 16 14:54:23 2013 -0400
reload /etc/resolv.conf when it has changed
if /etc/resolv.conf is updated, then make sure applications
already running get the updated information.
ripped from SuSE
http://bugs.gentoo.org/177416
diff --git a/resolv/res_libc.c b/resolv/res_libc.c
index ee3fa21..f30b3a9 100644
--- a/resolv/res_libc.c
+++ b/resolv/res_libc.c
@@ -22,6 +22,7 @@
#include <arpa/nameser.h>
#include <resolv.h>
#include <bits/libc-lock.h>
+#include <sys/stat.h>
/* The following bit is copied from res_data.c (where it is #ifdef'ed
@@ -95,6 +96,20 @@ int
__res_maybe_init (res_state resp, int preinit)
{
if (resp->options & RES_INIT) {
+ static time_t last_mtime, last_check;
+ time_t now;
+ struct stat statbuf;
+
+ time (&now);
+ if (now != last_check) {
+ last_check = now;
+ if (stat (_PATH_RESCONF, &statbuf) == 0 && last_mtime != statbuf.st_mtime) {
+ last_mtime = statbuf.st_mtime;
+ atomicinclock (lock);
+ atomicinc (__res_initstamp);
+ atomicincunlock (lock);
+ }
+ }
if (__res_initstamp != resp->_u._ext.initstamp) {
if (resp->nscount > 0)
__res_iclose (resp, true);
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=de1e604b49e03d2dc6d24e6f30f1e120481101b6
commit de1e604b49e03d2dc6d24e6f30f1e120481101b6
Author: Jakub Jelinek <jakub@redhat.com>
Date: Fri Aug 16 14:52:25 2013 -0400
Fix localedef segfault when run under exec-shield, PaX or similar
http://bugs.debian.org/198099
http://bugs.debian.org/231438
diff --git a/locale/programs/3level.h b/locale/programs/3level.h
index 5602fd8..72416b2 100644
--- a/locale/programs/3level.h
+++ b/locale/programs/3level.h
@@ -204,6 +204,42 @@ CONCAT(TABLE,_iterate) (struct TABLE *t,
}
}
}
+
+/* GCC ATM seems to do a poor job with pointers to nested functions passed
+ to inlined functions. Help it a little bit with this hack. */
+#define wchead_table_iterate(tp, fn) \
+do \
+ { \
+ struct wchead_table *t = (tp); \
+ uint32_t index1; \
+ for (index1 = 0; index1 < t->level1_size; index1++) \
+ { \
+ uint32_t lookup1 = t->level1[index1]; \
+ if (lookup1 != ((uint32_t) ~0)) \
+ { \
+ uint32_t lookup1_shifted = lookup1 << t->q; \
+ uint32_t index2; \
+ for (index2 = 0; index2 < (1 << t->q); index2++) \
+ { \
+ uint32_t lookup2 = t->level2[index2 + lookup1_shifted]; \
+ if (lookup2 != ((uint32_t) ~0)) \
+ { \
+ uint32_t lookup2_shifted = lookup2 << t->p; \
+ uint32_t index3; \
+ for (index3 = 0; index3 < (1 << t->p); index3++) \
+ { \
+ struct element_t *lookup3 \
+ = t->level3[index3 + lookup2_shifted]; \
+ if (lookup3 != NULL) \
+ fn ((((index1 << t->q) + index2) << t->p) + index3, \
+ lookup3); \
+ } \
+ } \
+ } \
+ } \
+ } \
+ } while (0)
+
#endif
#ifndef NO_ADD_LOCALE
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=9eef0eeeff0eb128fea73e3530e686c0afbdc78a
commit 9eef0eeeff0eb128fea73e3530e686c0afbdc78a
Author: Mike Frysinger <vapier@gentoo.org>
Date: Sat May 4 14:10:41 2013 -0400
workaround crash when handling signals in static PIEs
work around ... not entirely sure what is going on here.
2011-03-01 squeezy <vina@mailserver.eu>
* sysdeps/unix/sysv/linux/x86_64/sigaction.c fix the __restore_rt symbol
http://bugs.gentoo.org/283470
diff --git a/sysdeps/unix/sysv/linux/x86_64/sigaction.c b/sysdeps/unix/sysv/linux/x86_64/sigaction.c
index efc837f..344ca10 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sigaction.c
+++ b/sysdeps/unix/sysv/linux/x86_64/sigaction.c
@@ -37,7 +37,7 @@
/* Using the hidden attribute here does not change the code but it
helps to avoid warnings. */
-extern void restore_rt (void) asm ("__restore_rt") attribute_hidden;
+extern void restore_rt (void) asm ("__restore_rt") __attribute__((__visibility__("hidden")));
/* If ACT is not NULL, change the action for SIG to *ACT.
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b49a9c12c0bfda5c03372539c22e89b9d0bc4b85
commit b49a9c12c0bfda5c03372539c22e89b9d0bc4b85
Author: Mike Frysinger <vapier@gentoo.org>
Date: Sat May 4 14:07:11 2013 -0400
disable ldconfig during install
do not bother running ldconfig on DESTDIR. it wants to write the temp cache
file outside of the chroot. doesnt matter anyways as we wont use the cache
results (portage will rebuild cache), so running ldconfig is simply a waste
of time.
http://sourceware.org/ml/libc-alpha/2012-08/msg00118.html
https://bugs.gentoo.org/431038
diff --git a/Makefile b/Makefile
index 658ccfa..3788867 100644
--- a/Makefile
+++ b/Makefile
@@ -105,6 +105,7 @@ install-symbolic-link: subdir_install
rm -f $(symbolic-link-list)
install:
+dont-bother-with-destdir:
-test ! -x $(elf-objpfx)ldconfig || LC_ALL=C \
$(elf-objpfx)ldconfig $(addprefix -r ,$(install_root)) \
$(slibdir) $(libdir)
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 6 +++
Makeconfig | 4 +-
Makefile | 1 +
configure | 2 +-
configure.ac | 2 +-
elf/Makefile | 2 +-
iconvdata/run-iconv-test.sh | 2 +-
locale/programs/3level.h | 36 +++++++++++++++++
nptl/allocatestack.c | 37 +++++++++++------
nptl/pthread_create.c | 19 +++++++-
nptl/pthread_getattr_np.c | 17 +++++++-
nptl/tst-tls6.sh | 2 +-
resolv/res_libc.c | 15 +++++++
sysdeps/arm/__longjmp.S | 2 +-
sysdeps/arm/setjmp.S | 2 +-
sysdeps/hppa/nptl/pthread_spin_init.c | 8 ++--
sysdeps/hppa/nptl/pthread_spin_unlock.c | 8 ++--
sysdeps/unix/sysv/linux/hppa/bits/atomic.h | 60 +++++++++++++++-------------
sysdeps/unix/sysv/linux/x86_64/sigaction.c | 2 +-
19 files changed, 162 insertions(+), 65 deletions(-)
hooks/post-receive
--
GNU C Library master sources