SHA256
1
0
forked from pool/glibc
Petr Baudis 2010-03-25 16:12:02 +00:00 committed by Git OBS Bridge
parent 9aaedfde6b
commit 67f6df3eb9
17 changed files with 605 additions and 31 deletions

View File

@ -1,19 +0,0 @@
Index: powerpc-cpu/sysdeps/powerpc/powerpc32/powerpc64/fpu/s_llrint.S
===================================================================
--- powerpc-cpu/sysdeps/powerpc/powerpc32/powerpc64/fpu/s_llrint.S.orig
+++ powerpc-cpu/sysdeps/powerpc/powerpc32/powerpc64/fpu/s_llrint.S
@@ -18,6 +18,7 @@
02110-1301 USA. */
#include <sysdep.h>
+#include <math_ldbl_opt.h>
/* long long int[r3, r4] __llrint (double x[fp1]) */
ENTRY (__llrint)
@@ -41,3 +42,6 @@ weak_alias (__llrint, llrint)
strong_alias (__llrint, __llrintl)
weak_alias (__llrint, llrintl)
#endif
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __llrint, llrintl, GLIBC_2_1)
+#endif

11
glibc-dl-x86-64-pc32.diff Normal file
View File

@ -0,0 +1,11 @@
--- sysdeps/x86_64/dl-machine.h~ 2010-03-01 18:51:13.914317000 +0100
+++ sysdeps/x86_64/dl-machine.h 2010-03-01 18:52:01.258038000 +0100
@@ -453,7 +453,7 @@
case R_X86_64_PC32:
value += reloc->r_addend - (Elf64_Addr) reloc_addr;
*(unsigned int *) reloc_addr = value;
- if (__builtin_expect (value != (unsigned int) value, 0))
+ if (__builtin_expect (value != (int) value, 0))
{
fmt = "\
%s: Symbol `%s' causes overflow in R_X86_64_PC32 relocation\n";

148
glibc-getnprocs.diff Normal file
View File

@ -0,0 +1,148 @@
This bug is in reference to a bug introduced in glibc 2.11 but present in glibc
HEAD by the following patch set:
http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=6a3d03ff58742430a252beac4a1917506512e319
The patch came from this bugzilla bug:
https://bugzilla.redhat.com/show_bug.cgi?id=494631
Which simply proposed the first part:
+ nl = memchr (*cp, '\n', *re - *cp);
+ while (nl == NULL && *re == buffer_end)
+ {
+ /* Truncate too long lines. */
+ *re = buffer + 3 * (buffer_end - buffer) / 4;
+ n = read_not_cancel (fd, *re, buffer_end - *re);
+ if (n < 0)
+ return NULL;
+
+ nl = memchr (*re, '\n', n);
+ **re = '\n';
+ *re += n;
+ }
}
+ else
+ nl = memchr (*cp, '\n', *re - *cp);
This was checked in with a second part:
else if (nl + 5 >= *re)
{
memmove (buffer, nl, *re - nl);
*re = buffer + (*re - nl);
nl = *cp = buffer;
ssize_t n = read_not_cancel (fd, *re, buffer_end - *re);
if (n < 0)
return NULL;
*re += n;
}
Which is meant to determine whether there's enough room at the end of the
buffer to hold "cpu*\n".
else if (nl + 5 >= *re)
{
memmove (buffer, nl, *re - nl);
*re = buffer + (*re - nl);
nl = *cp = buffer;
ssize_t n = read_not_cancel (fd, *re, buffer_end - *re);
if (n < 0)
return NULL;
*re += n;
}
*cp = nl + 1;
This second block is erroneous (and redundant). If there's not enough room to
complete a cpu[:digit:] line it'll try to move what's partially in the end of
the buffer to the front (preserving that portion) and then read in a bunch
more, assuming that a \n is in the next read.
But it actually ends up overwriting the current line with the contents of the
second line.
Consider the following line
| C | P | U | 1 | \n | C | P | U | 2 | \n | C | P | U | 3 | F | O | O | B | A |
R | F | O | O | B |
A | R | \n | ...
where sizeof(buffer) == 12.
The first time through 'buffer' is filled as follows:
| C | P | U | 1 | \n | C | P | U | 2 | \n | C | P |
and 'cpu1' is the line that is returned. The second time through 'cpu2' is the
line that is supposed to be returned but this problematic branch is hit and the
last C P is copied to the front of the buffer over top of C P U 2. Following
this U 3 F O O B A R F O is read into the rest of 'buffer':
| C | P ||| U | 3 | F | O | O | B | A | R | F | O |
This throws off the whole incrementing calculation.
This second else block isn't necessary. Jakub's first part covers the scenario
shown in the example above quite well:
The following test case:
#include<stdio.h>
#include<sys/sysinfo.h>
int main()
{
int lcpus=get_nprocs();
printf("logical cpus = %d\n",lcpus);
return 0;
}
Can be run against the attached /proc/stat file which is known to reproduce the
problem:
This stat file can be used with the testcase by bind mounting it over
/proc/stat:
cp stat /dev/shm/stat
mount --bind /dev/shm/stat /proc/stat
When run this should show:
logical cpus = 1024
since cpu1024 is high cpu number. But it shows something like:
logical cpus = 137
Also attached is a patch which removes the erroneous else block.
When re-run against with this patch it reports the correct number of cpus.
Thanks to Milton Miller for describing this problem.
--- glibc-2.11.1/sysdeps/unix/sysv/linux/getsysstats.c 2010-01-18 11:01:41.000000000 -0600
+++ glibc-2.11.1-new/sysdeps/unix/sysv/linux/getsysstats.c 2010-03-23 08:00:26.000000000 -0500
@@ -117,18 +117,6 @@
if (nl == NULL)
nl = *re - 1;
}
- else if (nl + 5 >= *re)
- {
- memmove (buffer, nl, *re - nl);
- *re = buffer + (*re - nl);
- nl = *cp = buffer;
-
- ssize_t n = read_not_cancel (fd, *re, buffer_end - *re);
- if (n < 0)
- return NULL;
-
- *re += n;
- }
*cp = nl + 1;
assert (*cp <= *re);

39
glibc-memchr-ia64.diff Normal file
View File

@ -0,0 +1,39 @@
2010-02-05 H.J. Lu <hongjiu.lu@intel.com>
PR libc/11230
* sysdeps/ia64/memchr.S: Don't read beyond the last byte
during recovery.
diff --git a/sysdeps/ia64/memchr.S b/sysdeps/ia64/memchr.S
index cdd71ca..56d8056 100644
--- a/sysdeps/ia64/memchr.S
+++ b/sysdeps/ia64/memchr.S
@@ -47,7 +47,7 @@
#define saved_lc r16
#define chr r17
#define len r18
-#define pos0 r20
+#define last r20
#define val r21
#define tmp r24
#define chrx8 r25
@@ -67,6 +67,7 @@ ENTRY(__memchr)
mov saved_pr = pr // save the predicates
.body
mov ret0 = str
+ add last = str, in2 // last byte
and tmp = 7, str // tmp = str % 8
cmp.ne p7, p0 = r0, r0 // clear p7
extr.u chr = in1, 0, 8 // chr = (unsigned char) in1
@@ -143,7 +144,10 @@ ENTRY(__memchr)
ld8 tmp = [ret0];; // load the first unchecked 8byte
xor aux[1] = tmp, chrx8;;
czx1.r poschr[1] = aux[1];;
- cmp.ne p7, p0 = 8, poschr[1]
+ cmp.ne p7, p0 = 8, poschr[1];;
+(p7) add ret0 = addr[MEMLAT+2], poschr[1];;
+(p7) cmp.geu p6, p7 = ret0, last // don't go over the last byte
+(p6) br.cond.spnt .notfound;;
(p7) br.cond.spnt .foundit;;
adds ret0 = 8, ret0 // load the next unchecked 8byte
br.sptk .l4;;

View File

@ -0,0 +1,28 @@
2010-03-04 Carlos Eduardo Seo <cseo@linux.vnet.ibm.com>
* sysdeps/unix/sysv/linux/powerpc/powerpc64/time.c: New file.
Index: src/sysdeps/unix/sysv/linux/powerpc/powerpc64/time.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ src/sysdeps/unix/sysv/linux/powerpc/powerpc64/time.c 2010-03-04 20:02:23.000000000 -0300
@@ -0,0 +1,19 @@
+/* Copyright (C) 2010 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <sysdeps/unix/time.c>

View File

@ -117,7 +117,7 @@ diff -ur resolv.orig/res_libc.c resolv/res_libc.c
if (resp->options & RES_INIT) { if (resp->options & RES_INIT) {
+ __res_check_resconf (); + __res_check_resconf ();
if (__res_initstamp != resp->_u._ext.initstamp) { if (__res_initstamp != resp->_u._ext.initstamp) {
if (resp->nscount > 0) { if (resp->nscount > 0)
__res_iclose (resp, true); __res_iclose (resp, true);

View File

@ -0,0 +1,11 @@
--- localedata/locales/i18n~ 2010-01-19 03:51:14.208960000 +0100
+++ localedata/locales/i18n 2010-01-19 03:51:24.444040000 +0100
@@ -928,7 +928,7 @@
(<U006D>,<U004D>);(<U006E>,<U004E>);(<U006F>,<U004F>);(<U0070>,<U0050>);/
(<U0071>,<U0051>);(<U0072>,<U0052>);(<U0073>,<U0053>);(<U0074>,<U0054>);/
(<U0075>,<U0055>);(<U0076>,<U0056>);(<U0077>,<U0057>);(<U0078>,<U0058>);/
- (<U0079>,<U0059>);(<U007A>,<U005A>);(<U00B5>,<U039C>);(<U00DF>,<U1E9E>);/
+ (<U0079>,<U0059>);(<U007A>,<U005A>);(<U00B5>,<U039C>);/
(<U00E0>,<U00C0>);/
(<U00E1>,<U00C1>);(<U00E2>,<U00C2>);(<U00E3>,<U00C3>);(<U00E4>,<U00C4>);/
(<U00E5>,<U00C5>);(<U00E6>,<U00C6>);(<U00E7>,<U00C7>);(<U00E8>,<U00C8>);/

12
glibc-statfs64-ia64.diff Normal file
View File

@ -0,0 +1,12 @@
--- sysdeps/unix/sysv/linux/statfs64.c~ 2010-01-27 02:47:32.884315000 +0100
+++ sysdeps/unix/sysv/linux/statfs64.c 2010-01-27 02:49:17.943657000 +0100
@@ -24,6 +24,9 @@
#include <sysdep.h>
#include <kernel-features.h>
+/* On IA64, ia32el does not provide wrapper for statfs64() for some reason.
+ Force the compatibility code to get compiled in. [bnc#534828] */
+#undef __ASSUME_STATFS64
# if __ASSUME_STATFS64 == 0
int __no_statfs64 attribute_hidden;

84
glibc-utf-s390.diff Normal file
View File

@ -0,0 +1,84 @@
Hi,
unfortunately it turned out that the UTF-16 to UTF-32 and UTF-16 to
UTF-8 conversion instructions fail to recognize certain conditions if
the input stream is corrupted.
The attached patch disables these instructions and adjusts the
software implementation in order to take care of the error condition.
Hopefully we can re-enable them if a millicode fix becomes available.
Tested without regressions on s390x.
Please apply if you think it is ok.
Bye,
-Andreas-
2010-02-11 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* sysdeps/s390/s390-64/utf8-utf16-z9.c: Disable hardware
instructions cu21 and cu24. Add well-formedness checking
parameter and adjust the software implementation.
* sysdeps/s390/s390-64/utf16-utf32-z9.c: Likewise.
Index: libc/sysdeps/s390/s390-64/utf8-utf16-z9.c
===================================================================
--- libc.orig/sysdeps/s390/s390-64/utf8-utf16-z9.c
+++ libc/sysdeps/s390/s390-64/utf8-utf16-z9.c
@@ -345,9 +345,12 @@ gconv_end (struct __gconv_step *data)
Operation. */
#define BODY \
{ \
- if (GLRO (dl_hwcap) & HWCAP_S390_ETF3EH) \
+ /* The hardware instruction currently fails to report an error for \
+ isolated low surrogates so we have to disable the instruction \
+ until this gets resolved. */ \
+ if (0) /* (GLRO (dl_hwcap) & HWCAP_S390_ETF3EH) */ \
{ \
- HARDWARE_CONVERT ("cu21 %0, %1"); \
+ HARDWARE_CONVERT ("cu21 %0, %1, 1"); \
if (inptr != inend) \
{ \
/* Check if the third byte is \
@@ -388,7 +391,7 @@ gconv_end (struct __gconv_step *data)
\
outptr += 2; \
} \
- else if (c >= 0x0800 && c <= 0xd7ff) \
+ else if ((c >= 0x0800 && c <= 0xd7ff) || c > 0xdfff) \
{ \
/* Three byte UTF-8 char. */ \
\
Index: libc/sysdeps/s390/s390-64/utf16-utf32-z9.c
===================================================================
--- libc.orig/sysdeps/s390/s390-64/utf16-utf32-z9.c
+++ libc/sysdeps/s390/s390-64/utf16-utf32-z9.c
@@ -203,7 +203,10 @@ gconv_end (struct __gconv_step *data)
swapping). */
#define BODY \
{ \
- if (GLRO (dl_hwcap) & HWCAP_S390_ETF3EH) \
+ /* The hardware instruction currently fails to report an error for \
+ isolated low surrogates so we have to disable the instruction \
+ until this gets resolved. */ \
+ if (0) /* (GLRO (dl_hwcap) & HWCAP_S390_ETF3EH) */ \
{ \
HARDWARE_CONVERT ("cu24 %0, %1, 1"); \
if (inptr != inend) \
@@ -229,6 +232,12 @@ gconv_end (struct __gconv_step *data)
} \
else \
{ \
+ /* An isolated low-surrogate was found. This has to be \
+ considered ill-formed. */ \
+ if (__builtin_expect (u1 >= 0xdc00, 0)) \
+ { \
+ STANDARD_FROM_LOOP_ERR_HANDLER (2); \
+ } \
/* It's a surrogate character. At least the first word says \
it is. */ \
if (__builtin_expect (inptr + 4 > inend, 0)) \

32
glibc-valloc-assert.diff Normal file
View File

@ -0,0 +1,32 @@
Index: glibc-2.11.1/malloc/malloc.c
===================================================================
--- glibc-2.11.1.orig/malloc/malloc.c 2010-01-18 18:01:41.000000000 +0100
+++ glibc-2.11.1/malloc/malloc.c 2010-02-23 13:47:59.000000000 +0100
@@ -3933,9 +3933,10 @@ public_vALLOc(size_t bytes)
if(!p) {
/* Maybe the failure is due to running out of mmapped areas. */
if(ar_ptr != &main_arena) {
- (void)mutex_lock(&main_arena.mutex);
- p = _int_memalign(&main_arena, pagesz, bytes);
- (void)mutex_unlock(&main_arena.mutex);
+ ar_ptr = &main_arena;
+ (void)mutex_lock(&ar_ptr->mutex);
+ p = _int_memalign(ar_ptr, pagesz, bytes);
+ (void)mutex_unlock(&ar_ptr->mutex);
} else {
#if USE_ARENAS
/* ... or sbrk() has failed and there is still a chance to mmap() */
@@ -3978,9 +3979,10 @@ public_pVALLOc(size_t bytes)
if(!p) {
/* Maybe the failure is due to running out of mmapped areas. */
if(ar_ptr != &main_arena) {
- (void)mutex_lock(&main_arena.mutex);
- p = _int_memalign(&main_arena, pagesz, rounded_bytes);
- (void)mutex_unlock(&main_arena.mutex);
+ ar_ptr = &main_arena;
+ (void)mutex_lock(&ar_ptr->mutex);
+ p = _int_memalign(ar_ptr, pagesz, rounded_bytes);
+ (void)mutex_unlock(&ar_ptr->mutex);
} else {
#if USE_ARENAS
/* ... or sbrk() has failed and there is still a chance to mmap() */

View File

@ -1,14 +1,89 @@
-------------------------------------------------------------------
Wed Mar 24 13:04:12 CET 2010 - pbaudis@suse.cz
- Fix get_nprocs() large CPU count handling [bnc#590665]
-------------------------------------------------------------------
Tue Mar 23 15:09:09 CET 2010 - pbaudis@suse.cz
- Fix interference of STB_GNU_UNIQUE and prelink [bnc#586979]
- Make time() use VDSO on PPC64 [bnc#590216]
- Make pthread_cond_timedway() use VDSO on PPC64 [bnc#590517]
-------------------------------------------------------------------
Thu Mar 18 14:45:34 CET 2010 - pbaudis@suse.cz
- Add PreReq for cat to glibc-locale [bnc#588997]
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Mar 18 14:29:42 CET 2010 - pbaudis@suse.cz Thu Mar 18 14:29:42 CET 2010 - pbaudis@suse.cz
- Fix /etc/resolv.conf change detection for multi-threaded applications - Fix /etc/resolv.conf change detection for multi-threaded applications
(by Sebastian Kienzl) (by Sebastian Kienzl)
-------------------------------------------------------------------
Fri Mar 5 12:59:44 CET 2010 - pbaudis@suse.cz
- Fix spurious mapping from lowercase sharp s to uppercase sharp S
which is less standard and causes problems for ISO encodings [bnc#541773]
-------------------------------------------------------------------
Mon Mar 1 18:55:37 CET 2010 - pbaudis@suse.cz
- Fix spurious overflow messages on some R_X86_64_PC32 relocations,
patch by Richard Guenther [bnc#583019]
-------------------------------------------------------------------
Wed Feb 24 11:53:41 CET 2010 - pbaudis@suse.cz
- Fix assertion failures within valloc(), patch by Michael Matz
[bnc#581391]
-------------------------------------------------------------------
Wed Feb 17 12:02:24 CET 2010 - pbaudis@suse.cz
- S/390: Disable two UTF conversion instructions due to the hardware
mishandling some error conditions in the input stream [bnc#579871]
-------------------------------------------------------------------
Mon Feb 15 22:34:29 CET 2010 - pbaudis@suse.cz
- Further fix previous power5 fix
------------------------------------------------------------------- -------------------------------------------------------------------
Sun Feb 14 15:33:33 CET 2010 - rguenther@suse.de Sun Feb 14 15:33:33 CET 2010 - rguenther@suse.de
- avoid spurious differences in nscd on rebuilds. - avoid spurious differences in nscd on rebuilds.
-------------------------------------------------------------------
Thu Feb 11 21:36:32 CET 2010 - pbaudis@suse.cz
- Fix another upgrade problem on power5 and older - correctly remove
the old optimized libraries; found out by matz@suse.de [bnc#563978]
-------------------------------------------------------------------
Fri Feb 5 21:07:54 CET 2010 - pbaudis@suse.cz
- Final fix for memchr() overflow on IA64 provided by upstream
[bnc#567516]
-------------------------------------------------------------------
Thu Jan 28 17:11:59 CET 2010 - pbaudis@suse.cz
- Fix another memchr() overflow on IA64; another known one still
remains a mystery [bnc#567516]
-------------------------------------------------------------------
Wed Jan 27 02:49:46 CET 2010 - pbaudis@suse.cz
- Remove now-obsolete powerpc-cpu addon usage [bnc#572819]
- Fix statfs64() on IA64 in 32-bit mode ia32el [bnc#534828]
-------------------------------------------------------------------
Tue Jan 26 03:33:38 CET 2010 - pbaudis@suse.cz
- Fix upgrade from previous distributions on power5 and older [bnc#563978]
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Jan 25 17:35:25 CET 2010 - meissner@suse.de Mon Jan 25 17:35:25 CET 2010 - meissner@suse.de

View File

@ -70,7 +70,6 @@ Source9: nscd.init
Source10: bindresvport.blacklist Source10: bindresvport.blacklist
Source11: ctype_b.c Source11: ctype_b.c
Source12: glibc_post_upgrade.c Source12: glibc_post_upgrade.c
Source14: powerpc-cpu.tar.bz2
Source15: glibc.rpmlintrc Source15: glibc.rpmlintrc
Source16: baselibs.conf Source16: baselibs.conf
%if %_target_cpu == "i686" %if %_target_cpu == "i686"
@ -106,7 +105,6 @@ Patch24: glibc-2.3.3-nscd-db-path.diff
Patch25: glibc-2.3.5-nscd-zeronegtimeout.diff Patch25: glibc-2.3.5-nscd-zeronegtimeout.diff
Patch26: glibc-2.3.90-langpackdir.diff Patch26: glibc-2.3.90-langpackdir.diff
Patch27: glibc-nptl-2.4-nofixsyscallnr.diff Patch27: glibc-nptl-2.4-nofixsyscallnr.diff
Patch29: glibc-2.5-ppc-llrintl.diff
Patch30: glibc-2.6-configure.diff Patch30: glibc-2.6-configure.diff
Patch31: glibc-2.2-sunrpc.diff Patch31: glibc-2.2-sunrpc.diff
Patch32: glibc-2.8-getconf.diff Patch32: glibc-2.8-getconf.diff
@ -125,6 +123,16 @@ Patch46: glibc-2.10.99-ia64-include.diff
Patch47: libm-x86-64-exceptions.diff Patch47: libm-x86-64-exceptions.diff
Patch48: glibc-uio-cell.diff Patch48: glibc-uio-cell.diff
Patch50: glibc-nameserver-localhost.diff Patch50: glibc-nameserver-localhost.diff
Patch54: glibc-statfs64-ia64.diff
Patch55: glibc-memchr-ia64.diff
Patch56: glibc-utf-s390.diff
Patch57: glibc-valloc-assert.diff
Patch58: glibc-dl-x86-64-pc32.diff
Patch59: glibc-sap-captialsharps.diff
Patch60: ld-prelink-unique.diff
Patch61: glibc-ppc64-vdso-time.diff
Patch62: nptl-ppc64-vdso-timedwait.diff
Patch63: glibc-getnprocs.diff
Patch500: ARM_glibc-2.10.1-local-eabi-wchar.diff Patch500: ARM_glibc-2.10.1-local-eabi-wchar.diff
Patch501: ARM_glibc-2.10.1-local-hwcap-updates.diff Patch501: ARM_glibc-2.10.1-local-hwcap-updates.diff
Patch502: ARM_glibc-2.10.1-local-lowlevellock.diff Patch502: ARM_glibc-2.10.1-local-lowlevellock.diff
@ -184,6 +192,7 @@ License: GPLv2+ ; LGPLv2.1+
Summary: Locale Data for Localized Programs Summary: Locale Data for Localized Programs
Group: System/Libraries Group: System/Libraries
Requires: glibc = %{version} Requires: glibc = %{version}
PreReq: /bin/cat
AutoReqProv: on AutoReqProv: on
# bug437293 # bug437293
%ifarch ppc64 %ifarch ppc64
@ -278,10 +287,10 @@ versions of your software.
# add glibc-ports for arm # add glibc-ports for arm
# this is CURRENTLY BROKEN; ARM-interested contributors need to provide # this is CURRENTLY BROKEN; ARM-interested contributors need to provide
# new tested glibc-ports source # new tested glibc-ports source
%setup -n glibc-%{version} -q -a 2 -a 3 -a 4 -a 14 %setup -n glibc-%{version} -q -a 2 -a 3 -a 4
%else %else
# any other leave out ports # any other leave out ports
%setup -n glibc-%{version} -q -a 3 -a 4 -a 14 %setup -n glibc-%{version} -q -a 3 -a 4
%endif %endif
%patch0 %patch0
# libNoVersion part is only active on ix86 # libNoVersion part is only active on ix86
@ -320,7 +329,6 @@ touch -r nscd/s-stamp nscd/nscd_stat.c
rm nscd/s-stamp rm nscd/s-stamp
%patch26 %patch26
%patch27 %patch27
%patch29
%patch30 %patch30
%patch31 %patch31
%patch32 %patch32
@ -339,6 +347,16 @@ rm nscd/s-stamp
%patch47 %patch47
%patch48 -p1 %patch48 -p1
%patch50 -p1 %patch50 -p1
%patch54
%patch55 -p1
%patch56 -p1
%patch57 -p1
%patch58
%patch59
%patch60 -p1
%patch61 -p1
%patch62 -p1
%patch63 -p1
%ifarch %arm armv5tel armv7l %ifarch %arm armv5tel armv7l
%patch500 %patch500
%patch501 %patch501
@ -478,7 +496,7 @@ configure_and_build_glibc() {
# #
# First, base build: # First, base build:
pBuildFlags="$BuildFlags -mcpu=%{powerpc_optimize_base} -mtune=%{powerpc_optimize_tune}" pBuildFlags="$BuildFlags -mcpu=%{powerpc_optimize_base} -mtune=%{powerpc_optimize_tune}"
configure_and_build_glibc base "$pBuildFlags" "$add_ons,powerpc-cpu" --with-cpu=%{powerpc_optimize_base} configure_and_build_glibc base "$pBuildFlags" "$add_ons" --with-cpu=%{powerpc_optimize_base}
# Then other power variants: # Then other power variants:
for pcpu in \ for pcpu in \
%if %{powerpc_optimize_cpu_power6} %if %{powerpc_optimize_cpu_power6}
@ -488,7 +506,7 @@ configure_and_build_glibc() {
power7 \ power7 \
%endif %endif
; do ; do
configure_and_build_glibc $pcpu "$BuildFlags -mcpu=$pcpu" "$add_ons,powerpc-cpu" \ configure_and_build_glibc $pcpu "$BuildFlags -mcpu=$pcpu" "$add_ons" \
--with-cpu=$pcpu --disable-runbinaries --with-cpu=$pcpu --disable-runbinaries
done done
# Eventually, special Cell variant: # Eventually, special Cell variant:
@ -507,7 +525,7 @@ make -C cc-base html
# #
$BuildCC -static -Os -g $RPM_SOURCE_DIR/glibc_post_upgrade.c -o glibc_post_upgrade \ $BuildCC -static -Os -g $RPM_SOURCE_DIR/glibc_post_upgrade.c -o glibc_post_upgrade \
-Lcc-base -Bcc-base/csu \ -Lcc-base -Bcc-base/csu \
'-DREMOVE_TLS_DIRS' \ '-DREMOVE_TLS_DIRS' '-DREMOVE_PPC_OPTIMIZE_POWER4' '-DREMOVE_PPC_OPTIMIZE_POWER5' \
%ifarch ppc ppc64 %ifarch ppc ppc64
%if !%{powerpc_optimize_cpu_power6} %if !%{powerpc_optimize_cpu_power6}
'-DREMOVE_PPC_OPTIMIZE_POWER6' \ '-DREMOVE_PPC_OPTIMIZE_POWER6' \

View File

@ -34,6 +34,9 @@ main (void)
char initpath[256]; char initpath[256];
struct stat root, init_root; struct stat root, init_root;
/* First, get rid of platform-optimized libraries. We remove any we have
ever built, since otherwise we might end up using some old leftover
libraries when new ones aren't installed in their place anymore. */
#ifdef REMOVE_TLS_DIRS #ifdef REMOVE_TLS_DIRS
const char *library[] = {"libc.so.6", "libc.so.6.1", "libm.so.6", const char *library[] = {"libc.so.6", "libc.so.6.1", "libm.so.6",
"libm.so.6.1", "librt.so.1", "librtkaio.so.1", "libm.so.6.1", "librt.so.1", "librtkaio.so.1",
@ -43,6 +46,14 @@ main (void)
"/lib/i686/", "/lib/i686/",
#endif #endif
#ifdef __powerpc64__ #ifdef __powerpc64__
#ifdef REMOVE_PPC_OPTIMIZE_POWER4
"/lib64/power4/",
"/lib64/ppc970/",
#endif
#ifdef REMOVE_PPC_OPTIMIZE_POWER5
"/lib64/power5/",
"/lib64/power5+/",
#endif
#ifdef REMOVE_PPC_OPTIMIZE_POWER6 #ifdef REMOVE_PPC_OPTIMIZE_POWER6
"/lib64/power6/", "/lib64/power6/",
"/lib64/power6x/", "/lib64/power6x/",
@ -55,6 +66,14 @@ main (void)
#endif #endif
#endif /* __powerpc64__ */ #endif /* __powerpc64__ */
#ifdef __powerpc__ #ifdef __powerpc__
#ifdef REMOVE_PPC_OPTIMIZE_POWER4
"/lib/power4/",
"/lib/ppc970/",
#endif
#ifdef REMOVE_PPC_OPTIMIZE_POWER5
"/lib/power5/",
"/lib/power5+/",
#endif
#ifdef REMOVE_PPC_OPTIMIZE_POWER6 #ifdef REMOVE_PPC_OPTIMIZE_POWER6
"/lib/power6/", "/lib/power6/",
"/lib/power6x/", "/lib/power6x/",

57
ld-prelink-unique.diff Normal file
View File

@ -0,0 +1,57 @@
2010-03-23 Jakub Jelinek <jakub@redhat.com>
* elf/dl-lookup.c (do_lookup_x): If tab->entries is NULL,
but tab->size != 0, just unlock and goto success, without
allocating anything or entering anything into the hash table.
(_dl_debug_bindings): Temporarily set tab->entries to NULL
around do_lookup_x in undef_map->l_local_scope[0].
--- libc/elf/dl-lookup.c.jj 2009-12-16 00:10:37.000000000 +0100
+++ libc/elf/dl-lookup.c 2010-03-23 11:03:45.850560036 +0100
@@ -1,5 +1,6 @@
/* Look up a symbol in the loaded objects.
- Copyright (C) 1995-2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+ Copyright (C) 1995-2005, 2006, 2007, 2009, 2010
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -414,6 +415,20 @@ do_lookup_x (const char *undef_name, uin
assert (!RTLD_CHECK_FOREIGN_CALL);
#endif
+#ifdef SHARED
+ /* If tab->entries is NULL, but tab->size is not, it means
+ this is the second, conflict finding, lookup for
+ LD_TRACE_PRELINKING in _dl_debug_bindings. Don't
+ allocate anything and don't enter anything into the
+ hash table. */
+ if (__builtin_expect (tab->size, 0))
+ {
+ assert (GLRO(dl_debug_mask) & DL_DEBUG_PRELINK);
+ __rtld_lock_unlock_recursive (tab->lock);
+ goto success;
+ }
+#endif
+
#define INITIAL_NUNIQUE_SYM_TABLE 31
size = INITIAL_NUNIQUE_SYM_TABLE;
entries = calloc (sizeof (struct unique_sym), size);
@@ -917,13 +932,17 @@ _dl_debug_bindings (const char *undef_na
{
const uint_fast32_t new_hash = dl_new_hash (undef_name);
unsigned long int old_hash = 0xffffffff;
+ struct unique_sym *saved_entries
+ = GL(dl_ns)[LM_ID_BASE]._ns_unique_sym_table.entries;
+ GL(dl_ns)[LM_ID_BASE]._ns_unique_sym_table.entries = NULL;
do_lookup_x (undef_name, new_hash, &old_hash, *ref, &val,
undef_map->l_local_scope[0], 0, version, 0, NULL,
type_class, undef_map);
if (val.s != value->s || val.m != value->m)
conflict = 1;
+ GL(dl_ns)[LM_ID_BASE]._ns_unique_sym_table.entries = saved_entries;
}
if (value->s)

View File

@ -0,0 +1,29 @@
Index: glibc-2.11.1/nptl/pthread_cond_timedwait.c
===================================================================
--- glibc-2.11.1.old/nptl/pthread_cond_timedwait.c
+++ glibc-2.11.1/nptl/pthread_cond_timedwait.c
@@ -27,6 +27,15 @@
#include <shlib-compat.h>
+#ifndef HAVE_CLOCK_GETTIME_VSYSCALL
+# undef INTERNAL_VSYSCALL
+# define INTERNAL_VSYSCALL INTERNAL_SYSCALL
+# undef INLINE_VSYSCALL
+# define INLINE_VSYSCALL INLINE_SYSCALL
+#else
+# include <bits/libc-vdso.h>
+#endif
+
/* Cleanup handler, defined in pthread_cond_wait.c. */
extern void __condvar_cleanup (void *arg)
@@ -102,7 +111,7 @@ __pthread_cond_timedwait (cond, mutex, a
#ifdef __NR_clock_gettime
INTERNAL_SYSCALL_DECL (err);
int ret;
- ret = INTERNAL_SYSCALL (clock_gettime, err, 2,
+ ret = INTERNAL_VSYSCALL (clock_gettime, err, 2,
(cond->__data.__nwaiters
& ((1 << COND_NWAITERS_SHIFT) - 1)),
&rt);

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c59f80e38c9f6ad339d72bbfbc454364659686567b7689d33483b9cb4a12bf2a
size 36248

33
resolv.dynamic.diff Normal file
View File

@ -0,0 +1,33 @@
Index: resolv/res_libc.c
===================================================================
--- resolv/res_libc.c.orig
+++ 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);