Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
f03af64931 | ||
|
690b76f49a | ||
|
63801099f4 | ||
|
989b0e1237 | ||
|
1c2d86471d | ||
|
005e850828 | ||
|
456c7dc140 | ||
|
98034c49e9 | ||
|
37f89d6bda | ||
|
d8f6a3c530 | ||
|
a5e3dfc4f0 | ||
|
3c36f8f7e6 | ||
|
89117e90e2 | ||
|
9a93e02318 |
0
.cvsignore → .gitignore
vendored
0
.cvsignore → .gitignore
vendored
21
Makefile
21
Makefile
@ -1,21 +0,0 @@
|
|||||||
# Makefile for source rpm: glibc
|
|
||||||
# $Id: Makefile,v 1.1 2004/09/09 05:16:51 cvsdist Exp $
|
|
||||||
NAME := glibc
|
|
||||||
SPECFILE = $(firstword $(wildcard *.spec))
|
|
||||||
|
|
||||||
define find-makefile-common
|
|
||||||
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
|
|
||||||
endef
|
|
||||||
|
|
||||||
MAKEFILE_COMMON := $(shell $(find-makefile-common))
|
|
||||||
|
|
||||||
ifeq ($(MAKEFILE_COMMON),)
|
|
||||||
# attempt a checkout
|
|
||||||
define checkout-makefile-common
|
|
||||||
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
|
|
||||||
endef
|
|
||||||
|
|
||||||
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
|
|
||||||
endif
|
|
||||||
|
|
||||||
include $(MAKEFILE_COMMON)
|
|
27
glibc-bz3406.patch
Normal file
27
glibc-bz3406.patch
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
2008-02-11 Joseph Myers <joseph@codesourcery.com>
|
||||||
|
|
||||||
|
[BZ #3406]
|
||||||
|
* sysdeps/ieee754/flt-32/w_expf.c (o_threshold): Correct value.
|
||||||
|
* math/libm-test.inc (exp_test): Test 88.72269439697265625.
|
||||||
|
|
||||||
|
--- libc/math/libm-test.inc 11 Apr 2008 19:32:30 -0000 1.79
|
||||||
|
+++ libc/math/libm-test.inc 22 May 2008 19:59:10 -0000 1.81
|
||||||
|
@@ -2510,6 +2510,7 @@ exp_test (void)
|
||||||
|
TEST_f_f (exp, 3, M_E3l);
|
||||||
|
TEST_f_f (exp, 0.75L, 2.11700001661267466854536981983709561L);
|
||||||
|
TEST_f_f (exp, 50.0L, 5184705528587072464087.45332293348538L);
|
||||||
|
+ TEST_f_f (exp, 88.72269439697265625L, 3.40233126623160774937554134772290447915e38L);
|
||||||
|
#ifdef TEST_LDOUBLE
|
||||||
|
/* The result can only be represented in long double. */
|
||||||
|
TEST_f_f (exp, 1000.0L, 0.197007111401704699388887935224332313e435L);
|
||||||
|
--- libc/sysdeps/ieee754/flt-32/w_expf.c 14 Jul 1999 00:03:46 -0000 1.1
|
||||||
|
+++ libc/sysdeps/ieee754/flt-32/w_expf.c 11 May 2008 17:49:19 -0000 1.2
|
||||||
|
@@ -29,7 +29,7 @@ static const float
|
||||||
|
#else
|
||||||
|
static float
|
||||||
|
#endif
|
||||||
|
-o_threshold= 8.8721679688e+01, /* 0x42b17180 */
|
||||||
|
+o_threshold= 8.8722831726e+01, /* 0x42b17217 */
|
||||||
|
u_threshold= -1.0397208405e+02; /* 0xc2cff1b5 */
|
||||||
|
|
||||||
|
#ifdef __STDC__
|
39
glibc-bz6461.patch
Normal file
39
glibc-bz6461.patch
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
2008-05-14 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
[BZ #6461]
|
||||||
|
* iconv/gconv_simple.c (BODY for __gconv_transform_ascii_internal):
|
||||||
|
Add missing braces.
|
||||||
|
(BODY for __gconv_transform_internal_ascii): Likewise.
|
||||||
|
|
||||||
|
--- libc/iconv/gconv_simple.c 12 Oct 2007 04:40:33 -0000 1.67
|
||||||
|
+++ libc/iconv/gconv_simple.c 14 May 2008 22:52:44 -0000 1.68
|
||||||
|
@@ -820,9 +820,11 @@ ucs4le_internal_loop_single (struct __gc
|
||||||
|
STANDARD_FROM_LOOP_ERR_HANDLER (1); \
|
||||||
|
} \
|
||||||
|
else \
|
||||||
|
- /* It's an one byte sequence. */ \
|
||||||
|
- *((uint32_t *) outptr) = *inptr++; \
|
||||||
|
- outptr += sizeof (uint32_t); \
|
||||||
|
+ { \
|
||||||
|
+ /* It's an one byte sequence. */ \
|
||||||
|
+ *((uint32_t *) outptr) = *inptr++; \
|
||||||
|
+ outptr += sizeof (uint32_t); \
|
||||||
|
+ } \
|
||||||
|
}
|
||||||
|
#define LOOP_NEED_FLAGS
|
||||||
|
#include <iconv/loop.c>
|
||||||
|
@@ -851,9 +853,11 @@ ucs4le_internal_loop_single (struct __gc
|
||||||
|
STANDARD_TO_LOOP_ERR_HANDLER (4); \
|
||||||
|
} \
|
||||||
|
else \
|
||||||
|
- /* It's an one byte sequence. */ \
|
||||||
|
- *outptr++ = *((const uint32_t *) inptr); \
|
||||||
|
- inptr += sizeof (uint32_t); \
|
||||||
|
+ { \
|
||||||
|
+ /* It's an one byte sequence. */ \
|
||||||
|
+ *outptr++ = *((const uint32_t *) inptr); \
|
||||||
|
+ inptr += sizeof (uint32_t); \
|
||||||
|
+ } \
|
||||||
|
}
|
||||||
|
#define LOOP_NEED_FLAGS
|
||||||
|
#include <iconv/loop.c>
|
48
glibc-bz6472.patch
Normal file
48
glibc-bz6472.patch
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
2008-05-14 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
[BZ #6472]
|
||||||
|
* sysdeps/posix/getaddrinfo.c (get_scope): Loopback addresses have
|
||||||
|
to be treated like link-local addresses.
|
||||||
|
(match_prefix): Don't treat IPv4 loopback address special when
|
||||||
|
converting to v4 mapped addressed.
|
||||||
|
|
||||||
|
--- libc/sysdeps/posix/getaddrinfo.c 14 May 2008 21:53:40 -0000 1.129
|
||||||
|
+++ libc/sysdeps/posix/getaddrinfo.c 14 May 2008 22:46:55 -0000 1.131
|
||||||
|
@@ -1112,7 +1112,10 @@ get_scope (const struct sockaddr_in6 *in
|
||||||
|
{
|
||||||
|
if (! IN6_IS_ADDR_MULTICAST (&in6->sin6_addr))
|
||||||
|
{
|
||||||
|
- if (IN6_IS_ADDR_LINKLOCAL (&in6->sin6_addr))
|
||||||
|
+ if (IN6_IS_ADDR_LINKLOCAL (&in6->sin6_addr)
|
||||||
|
+ /* RFC 4291 2.5.3 says that the loopback address is to be
|
||||||
|
+ treated like a link-local address. */
|
||||||
|
+ || IN6_IS_ADDR_LOOPBACK (&in6->sin6_addr))
|
||||||
|
scope = 2;
|
||||||
|
else if (IN6_IS_ADDR_SITELOCAL (&in6->sin6_addr))
|
||||||
|
scope = 5;
|
||||||
|
@@ -1245,20 +1248,14 @@ match_prefix (const struct sockaddr_in6
|
||||||
|
{
|
||||||
|
const struct sockaddr_in *in = (const struct sockaddr_in *) in6;
|
||||||
|
|
||||||
|
- /* Convert to IPv6 address. */
|
||||||
|
+ /* Construct a V4-to-6 mapped address. */
|
||||||
|
in6_mem.sin6_family = PF_INET6;
|
||||||
|
in6_mem.sin6_port = in->sin_port;
|
||||||
|
in6_mem.sin6_flowinfo = 0;
|
||||||
|
- if (in->sin_addr.s_addr == htonl (0x7f000001))
|
||||||
|
- in6_mem.sin6_addr = (struct in6_addr) IN6ADDR_LOOPBACK_INIT;
|
||||||
|
- else
|
||||||
|
- {
|
||||||
|
- /* Construct a V4-to-6 mapped address. */
|
||||||
|
- memset (&in6_mem.sin6_addr, '\0', sizeof (in6_mem.sin6_addr));
|
||||||
|
- in6_mem.sin6_addr.s6_addr16[5] = 0xffff;
|
||||||
|
- in6_mem.sin6_addr.s6_addr32[3] = in->sin_addr.s_addr;
|
||||||
|
- in6_mem.sin6_scope_id = 0;
|
||||||
|
- }
|
||||||
|
+ memset (&in6_mem.sin6_addr, '\0', sizeof (in6_mem.sin6_addr));
|
||||||
|
+ in6_mem.sin6_addr.s6_addr16[5] = 0xffff;
|
||||||
|
+ in6_mem.sin6_addr.s6_addr32[3] = in->sin_addr.s_addr;
|
||||||
|
+ in6_mem.sin6_scope_id = 0;
|
||||||
|
|
||||||
|
in6 = &in6_mem;
|
||||||
|
}
|
101
glibc-bz6612.patch
Normal file
101
glibc-bz6612.patch
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
2008-06-12 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* time/strftime.c: Pass reference to tzset_called around to handle
|
||||||
|
recursive calls.
|
||||||
|
|
||||||
|
[BZ #6612]
|
||||||
|
* time/strftime.c (__strftime_internal): Call tzset() only
|
||||||
|
when printing timezone-dependent values.
|
||||||
|
Based on a patch by Petr Baudis <pasky@suse.cz>.
|
||||||
|
|
||||||
|
--- libc/time/strftime_l.c 16 Oct 2007 22:50:20 -0000 1.4
|
||||||
|
+++ libc/time/strftime_l.c 13 Jun 2008 06:08:31 -0000 1.5
|
||||||
|
@@ -1,4 +1,4 @@
|
||||||
|
-/* Copyright (C) 2002, 2004, 2007 Free Software Foundation, Inc.
|
||||||
|
+/* Copyright (C) 2002, 2004, 2007, 2008 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
|
||||||
|
@@ -455,7 +455,8 @@ static CHAR_T const month_name[][10] =
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static size_t __strftime_internal (CHAR_T *, size_t, const CHAR_T *,
|
||||||
|
- const struct tm *, bool ut_argument_spec_iso
|
||||||
|
+ const struct tm *, bool *
|
||||||
|
+ ut_argument_spec_iso
|
||||||
|
LOCALE_PARAM_PROTO) __THROW;
|
||||||
|
|
||||||
|
/* Write information from TP into S according to the format
|
||||||
|
@@ -481,7 +482,8 @@ my_strftime (s, maxsize, format, tp ut_a
|
||||||
|
tmcopy = *tp;
|
||||||
|
tp = &tmcopy;
|
||||||
|
#endif
|
||||||
|
- return __strftime_internal (s, maxsize, format, tp, false
|
||||||
|
+ bool tzset_called = false;
|
||||||
|
+ return __strftime_internal (s, maxsize, format, tp, &tzset_called
|
||||||
|
ut_argument LOCALE_ARG);
|
||||||
|
}
|
||||||
|
#ifdef _LIBC
|
||||||
|
@@ -495,7 +497,7 @@ __strftime_internal (s, maxsize, format,
|
||||||
|
size_t maxsize;
|
||||||
|
const CHAR_T *format;
|
||||||
|
const struct tm *tp;
|
||||||
|
- bool tzset_called;
|
||||||
|
+ bool *tzset_called;
|
||||||
|
ut_argument_spec
|
||||||
|
LOCALE_PARAM_DECL
|
||||||
|
{
|
||||||
|
@@ -563,16 +565,6 @@ __strftime_internal (s, maxsize, format,
|
||||||
|
if (! (zone && *zone))
|
||||||
|
zone = "GMT";
|
||||||
|
}
|
||||||
|
- else
|
||||||
|
- {
|
||||||
|
- /* POSIX.1 requires that local time zone information is used as
|
||||||
|
- though strftime called tzset. */
|
||||||
|
-# if HAVE_TZSET
|
||||||
|
- if (!tzset_called)
|
||||||
|
- tzset ();
|
||||||
|
- tzset_called = true;
|
||||||
|
-# endif
|
||||||
|
- }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (hour12 > 12)
|
||||||
|
@@ -1325,7 +1317,18 @@ __strftime_internal (s, maxsize, format,
|
||||||
|
#if HAVE_TZNAME
|
||||||
|
/* The tzset() call might have changed the value. */
|
||||||
|
if (!(zone && *zone) && tp->tm_isdst >= 0)
|
||||||
|
- zone = tzname[tp->tm_isdst];
|
||||||
|
+ {
|
||||||
|
+ /* POSIX.1 requires that local time zone information is used as
|
||||||
|
+ though strftime called tzset. */
|
||||||
|
+# if HAVE_TZSET
|
||||||
|
+ if (!*tzset_called)
|
||||||
|
+ {
|
||||||
|
+ tzset ();
|
||||||
|
+ *tzset_called = true;
|
||||||
|
+ }
|
||||||
|
+# endif
|
||||||
|
+ zone = tzname[tp->tm_isdst];
|
||||||
|
+ }
|
||||||
|
#endif
|
||||||
|
if (! zone)
|
||||||
|
zone = "";
|
||||||
|
@@ -1361,6 +1364,16 @@ __strftime_internal (s, maxsize, format,
|
||||||
|
struct tm ltm;
|
||||||
|
time_t lt;
|
||||||
|
|
||||||
|
+ /* POSIX.1 requires that local time zone information is used as
|
||||||
|
+ though strftime called tzset. */
|
||||||
|
+# if HAVE_TZSET
|
||||||
|
+ if (!*tzset_called)
|
||||||
|
+ {
|
||||||
|
+ tzset ();
|
||||||
|
+ *tzset_called = true;
|
||||||
|
+ }
|
||||||
|
+# endif
|
||||||
|
+
|
||||||
|
ltm = *tp;
|
||||||
|
lt = mktime (<m);
|
||||||
|
|
85
glibc-bz6657.patch
Normal file
85
glibc-bz6657.patch
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
2008-06-27 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
[BZ #6657]
|
||||||
|
* time/strptime_l.c: Don't clear s.era_cnt after successful match
|
||||||
|
of %EY.
|
||||||
|
Patch by Petr Baudis.
|
||||||
|
|
||||||
|
localedata/
|
||||||
|
2008-06-27 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* tst-strptime.c (do_test): Add test of %EY.
|
||||||
|
|
||||||
|
2008-06-25 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* tst-strptime.c (do_test): Add test for parsing era year
|
||||||
|
representation.
|
||||||
|
|
||||||
|
--- libc/time/strptime_l.c 28 Jul 2007 19:10:08 -0000 1.12
|
||||||
|
+++ libc/time/strptime_l.c 27 Jun 2008 21:36:13 -0000 1.13
|
||||||
|
@@ -951,7 +942,6 @@ __strptime_internal (rp, fmt, tmp, state
|
||||||
|
else
|
||||||
|
{
|
||||||
|
s.decided = loc;
|
||||||
|
- s.era_cnt = -1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
--- libc/localedata/tst-strptime.c 1 Aug 2007 03:42:25 -0000 1.2
|
||||||
|
+++ libc/localedata/tst-strptime.c 27 Jun 2008 17:21:24 -0000 1.5
|
||||||
|
@@ -1,22 +1,53 @@
|
||||||
|
#include <locale.h>
|
||||||
|
#include <time.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
+#include <string.h>
|
||||||
|
|
||||||
|
static int
|
||||||
|
do_test (void)
|
||||||
|
{
|
||||||
|
+ int result = 0;
|
||||||
|
+
|
||||||
|
if (setlocale (LC_ALL, "vi_VN.TCVN5712-1") == NULL)
|
||||||
|
{
|
||||||
|
puts ("cannot set locale");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
struct tm tm;
|
||||||
|
+ memset (&tm, '\0', sizeof (tm));
|
||||||
|
/* This is November in Vietnamese encoded using TCVN5712-1. */
|
||||||
|
static const char s[] = "\
|
||||||
|
-\x54\x68\xb8\x6e\x67\x20\x6d\xad\xea\x69\x20\x6d\xe9\x74";
|
||||||
|
+\x54\x68\xb8\x6e\x67\x20\x6d\xad\xea\x69\x20\x6d\xe9\x74\0";
|
||||||
|
char *r = strptime (s, "%b", &tm);
|
||||||
|
printf ("r = %p, r-s = %tu, tm.tm_mon = %d\n", r, r - s, tm.tm_mon);
|
||||||
|
- return r == NULL || r - s != 14 || tm.tm_mon != 10;
|
||||||
|
+ result = r == NULL || r - s != 14 || tm.tm_mon != 10;
|
||||||
|
+
|
||||||
|
+ if (setlocale (LC_ALL, "ja_JP.UTF-8") == NULL)
|
||||||
|
+ {
|
||||||
|
+ puts ("cannot set locale");
|
||||||
|
+ return 1;
|
||||||
|
+ }
|
||||||
|
+ static const char s2[] = "\
|
||||||
|
+\x32\x35\x20\x30\x36\x20\xe5\xb9\xb3\xe6\x88\x90\x32\x30\0";
|
||||||
|
+ memset (&tm, '\0', sizeof (tm));
|
||||||
|
+ r = strptime (s2, "%d %m %EC%Ey", &tm);
|
||||||
|
+ printf ("\
|
||||||
|
+r = %p, r-s2 = %tu, tm.tm_mday = %d, tm.tm_mon = %d, tm.tm_year = %d\n",
|
||||||
|
+ r, r - s2, tm.tm_mday, tm.tm_mon, tm.tm_year);
|
||||||
|
+ result |= (r == NULL || r - s2 != 14 || tm.tm_mday != 25 || tm.tm_mon != 5
|
||||||
|
+ || tm.tm_year != 108);
|
||||||
|
+
|
||||||
|
+ static const char s3[] = "\
|
||||||
|
+\x32\x35\x20\x30\x36\x20\xe5\xb9\xb3\xe6\x88\x90\x32\x30\xe5\xb9\xb4\0";
|
||||||
|
+ memset (&tm, '\0', sizeof (tm));
|
||||||
|
+ r = strptime (s3, "%d %m %EY", &tm);
|
||||||
|
+ printf ("\
|
||||||
|
+r = %p, r-s3 = %tu, tm.tm_mday = %d, tm.tm_mon = %d, tm.tm_year = %d\n",
|
||||||
|
+ r, r - s3, tm.tm_mday, tm.tm_mon, tm.tm_year);
|
||||||
|
+ result |= (r == NULL || r - s3 != 17 || tm.tm_mday != 25 || tm.tm_mon != 5
|
||||||
|
+ || tm.tm_year != 108);
|
||||||
|
+
|
||||||
|
+ return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define TEST_FUNCTION do_test ()
|
68
glibc-bz6719.patch
Normal file
68
glibc-bz6719.patch
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
2008-07-08 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* stdio-common/Makefile: Add rules to build and run tst-setvbuf1.
|
||||||
|
* stdio-common/tst-setvbuf1.c: New file.
|
||||||
|
* stdio-common/tst-setvbuf1.expect: New file.
|
||||||
|
|
||||||
|
[BZ #6719]
|
||||||
|
* libio/iosetvbuf.c (_IO_setvbuf): Correctly clear buffering flags
|
||||||
|
when selecting fully-buffered stream.
|
||||||
|
Patch by Wang Xin <wxinee@gmail.com>.
|
||||||
|
|
||||||
|
--- libc/libio/iosetvbuf.c 29 Aug 2003 19:58:27 -0000 1.20
|
||||||
|
+++ libc/libio/iosetvbuf.c 8 Jul 2008 16:20:32 -0000 1.21
|
||||||
|
@@ -45,7 +45,7 @@ _IO_setvbuf (fp, buf, mode, size)
|
||||||
|
switch (mode)
|
||||||
|
{
|
||||||
|
case _IOFBF:
|
||||||
|
- fp->_IO_file_flags &= ~_IO_LINE_BUF|_IO_UNBUFFERED;
|
||||||
|
+ fp->_IO_file_flags &= ~(_IO_LINE_BUF|_IO_UNBUFFERED);
|
||||||
|
if (buf == NULL)
|
||||||
|
{
|
||||||
|
if (fp->_IO_buf_base == NULL)
|
||||||
|
--- libc/stdio-common/Makefile 24 May 2008 18:14:36 -0000 1.112
|
||||||
|
+++ libc/stdio-common/Makefile 8 Jul 2008 16:32:28 -0000 1.113
|
||||||
|
@@ -58,7 +58,7 @@ tests := tstscanf test_rdwr test-popen t
|
||||||
|
tst-popen tst-unlockedio tst-fmemopen2 tst-put-error tst-fgets \
|
||||||
|
tst-fwrite bug16 bug17 tst-swscanf tst-sprintf2 bug18 bug18a \
|
||||||
|
bug19 bug19a tst-popen2 scanf13 scanf14 scanf15 bug20 bug21 bug22 \
|
||||||
|
- scanf16 scanf17
|
||||||
|
+ scanf16 scanf17 tst-setvbuf1
|
||||||
|
|
||||||
|
test-srcs = tst-unbputc tst-printf
|
||||||
|
|
||||||
|
@@ -130,3 +130,7 @@ bug15-ENV = LOCPATH=$(common-objpfx)loca
|
||||||
|
ifneq (,$(filter %REENTRANT, $(defines)))
|
||||||
|
CPPFLAGS += -D_IO_MTSAFE_IO
|
||||||
|
endif
|
||||||
|
+
|
||||||
|
+$(objpfx)tst-setvbuf1.out: tst-setvbuf1.expect $(objpfx)tst-setvbuf1
|
||||||
|
+ $(built-program-cmd) > $@ 2>&1
|
||||||
|
+ cmp tst-setvbuf1.expect $@
|
||||||
|
--- libc/stdio-common/tst-setvbuf1.c 1 Jan 1970 00:00:00 -0000
|
||||||
|
+++ libc/stdio-common/tst-setvbuf1.c 8 Jul 2008 16:32:02 -0000 1.1
|
||||||
|
@@ -0,0 +1,19 @@
|
||||||
|
+#include <stdio.h>
|
||||||
|
+
|
||||||
|
+static int
|
||||||
|
+do_test (void)
|
||||||
|
+{
|
||||||
|
+ if (setvbuf (stderr, NULL, _IOFBF, BUFSIZ) != 0)
|
||||||
|
+ {
|
||||||
|
+ puts ("Set full buffer error.");
|
||||||
|
+ return 1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ fprintf (stderr, "Output #1 <stderr>.\n");
|
||||||
|
+ printf ("Output #2 <stdout>.\n");
|
||||||
|
+
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+#define TEST_FUNCTION do_test ()
|
||||||
|
+#include "../test-skeleton.c"
|
||||||
|
--- libc/stdio-common/tst-setvbuf1.expect 1 Jan 1970 00:00:00 -0000
|
||||||
|
+++ libc/stdio-common/tst-setvbuf1.expect 8 Jul 2008 16:32:14 -0000 1.1
|
||||||
|
@@ -0,0 +1,2 @@
|
||||||
|
+Output #2 <stdout>.
|
||||||
|
+Output #1 <stderr>.
|
18
glibc-bz6723.patch
Normal file
18
glibc-bz6723.patch
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
2008-07-06 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
[BZ #6723]
|
||||||
|
* time/mktime.c (__mktime_internal): Normalize tp->tm_isdst value.
|
||||||
|
|
||||||
|
--- libc/time/mktime.c 12 Dec 2007 18:21:29 -0000 1.68
|
||||||
|
+++ libc/time/mktime.c 6 Jul 2008 21:17:58 -0000 1.69
|
||||||
|
@@ -293,7 +293,9 @@ __mktime_internal (struct tm *tp,
|
||||||
|
int mday = tp->tm_mday;
|
||||||
|
int mon = tp->tm_mon;
|
||||||
|
int year_requested = tp->tm_year;
|
||||||
|
- int isdst = tp->tm_isdst;
|
||||||
|
+ /* Normalize the value. */
|
||||||
|
+ int isdst = ((tp->tm_isdst >> (8 * sizeof (tp->tm_isdst) - 1))
|
||||||
|
+ | (tp->tm_isdst != 0));
|
||||||
|
|
||||||
|
/* 1 if the previous probe was DST. */
|
||||||
|
int dst2;
|
441
glibc-c99-scanf.patch
Normal file
441
glibc-c99-scanf.patch
Normal file
@ -0,0 +1,441 @@
|
|||||||
|
2008-05-24 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
* libio/stdio.h (vscanf): Fix -std=c99 redirect.
|
||||||
|
* stdio-common/Makefile (tests): Add scanf16 and scanf17.
|
||||||
|
(CFLAGS-scanf17.c): New.
|
||||||
|
* stdio-common/scanf14.c (main): Add fscanf and scanf tests.
|
||||||
|
* stdio-common/scanf15.c (main): Likewise.
|
||||||
|
* stdio-common/scanf16.c: New file.
|
||||||
|
* stdio-common/scanf17.c: New file.
|
||||||
|
|
||||||
|
--- libc/libio/stdio.h 8 Jan 2008 01:18:40 -0000 1.92
|
||||||
|
+++ libc/libio/stdio.h 24 May 2008 18:14:36 -0000 1.93
|
||||||
|
@@ -475,7 +475,7 @@ extern int __REDIRECT (vfscanf,
|
||||||
|
__isoc99_vfscanf)
|
||||||
|
__attribute__ ((__format__ (__scanf__, 2, 0))) __wur;
|
||||||
|
extern int __REDIRECT (vscanf, (__const char *__restrict __format,
|
||||||
|
- _G_va_list __arg), __isoc99_vfscanf)
|
||||||
|
+ _G_va_list __arg), __isoc99_vscanf)
|
||||||
|
__attribute__ ((__format__ (__scanf__, 1, 0))) __wur;
|
||||||
|
extern int __REDIRECT (vsscanf,
|
||||||
|
(__const char *__restrict __s,
|
||||||
|
--- libc/stdio-common/Makefile 10 Dec 2007 01:43:13 -0000 1.111
|
||||||
|
+++ libc/stdio-common/Makefile 24 May 2008 18:14:36 -0000 1.112
|
||||||
|
@@ -57,7 +57,8 @@ tests := tstscanf test_rdwr test-popen t
|
||||||
|
tst-perror tst-sprintf tst-rndseek tst-fdopen tst-fphex bug14 bug15 \
|
||||||
|
tst-popen tst-unlockedio tst-fmemopen2 tst-put-error tst-fgets \
|
||||||
|
tst-fwrite bug16 bug17 tst-swscanf tst-sprintf2 bug18 bug18a \
|
||||||
|
- bug19 bug19a tst-popen2 scanf13 scanf14 scanf15 bug20 bug21 bug22
|
||||||
|
+ bug19 bug19a tst-popen2 scanf13 scanf14 scanf15 bug20 bug21 bug22 \
|
||||||
|
+ scanf16 scanf17
|
||||||
|
|
||||||
|
test-srcs = tst-unbputc tst-printf
|
||||||
|
|
||||||
|
@@ -109,11 +110,13 @@ CFLAGS-isoc99_scanf.c += $(exceptions)
|
||||||
|
CFLAGS-errlist.c = $(fno-unit-at-a-time)
|
||||||
|
CFLAGS-siglist.c = $(fno-unit-at-a-time)
|
||||||
|
|
||||||
|
-# The following is a hack since we must compile scanf15.c without any
|
||||||
|
+# The following is a hack since we must compile scanf1{5,7}.c without any
|
||||||
|
# GNU extension. The latter are needed, though, when internal headers
|
||||||
|
# are used. So made sure we see the installed headers first.
|
||||||
|
CFLAGS-scanf15.c = -I../libio -I../stdlib -I../wcsmbs -I../time -I../string \
|
||||||
|
-I../wctype
|
||||||
|
+CFLAGS-scanf17.c = -I../libio -I../stdlib -I../wcsmbs -I../time -I../string \
|
||||||
|
+ -I../wctype
|
||||||
|
|
||||||
|
# We know the test has a format string problem.
|
||||||
|
CFLAGS-tst-sprintf.c = -Wno-format
|
||||||
|
--- libc/stdio-common/scanf14.c 18 Sep 2007 17:59:38 -0000 1.1
|
||||||
|
+++ libc/stdio-common/scanf14.c 24 May 2008 18:14:36 -0000 1.2
|
||||||
|
@@ -59,5 +59,58 @@ main (void)
|
||||||
|
else if (d != 5.25 || memcmp (c, " x", 2) != 0)
|
||||||
|
FAIL ();
|
||||||
|
|
||||||
|
+ const char *tmpdir = getenv ("TMPDIR");
|
||||||
|
+ if (tmpdir == NULL || tmpdir[0] == '\0')
|
||||||
|
+ tmpdir = "/tmp";
|
||||||
|
+
|
||||||
|
+ char fname[strlen (tmpdir) + sizeof "/tst-scanf14.XXXXXX"];
|
||||||
|
+ sprintf (fname, "%s/tst-scanf14.XXXXXX", tmpdir);
|
||||||
|
+ if (fname == NULL)
|
||||||
|
+ FAIL ();
|
||||||
|
+
|
||||||
|
+ /* Create a temporary file. */
|
||||||
|
+ int fd = mkstemp (fname);
|
||||||
|
+ if (fd == -1)
|
||||||
|
+ FAIL ();
|
||||||
|
+
|
||||||
|
+ FILE *fp = fdopen (fd, "w+");
|
||||||
|
+ if (fp == NULL)
|
||||||
|
+ FAIL ();
|
||||||
|
+ else
|
||||||
|
+ {
|
||||||
|
+ if (fputs (" 1.25s x", fp) == EOF)
|
||||||
|
+ FAIL ();
|
||||||
|
+ if (fseek (fp, 0, SEEK_SET) != 0)
|
||||||
|
+ FAIL ();
|
||||||
|
+ if (fscanf (fp, "%as%2c", &sp, c) != 2)
|
||||||
|
+ FAIL ();
|
||||||
|
+ else
|
||||||
|
+ {
|
||||||
|
+ if (strcmp (sp, "1.25s") != 0 || memcmp (c, " x", 2) != 0)
|
||||||
|
+ FAIL ();
|
||||||
|
+ memset (sp, 'x', sizeof "1.25s");
|
||||||
|
+ free (sp);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (freopen (fname, "r", stdin) == NULL)
|
||||||
|
+ FAIL ();
|
||||||
|
+ else
|
||||||
|
+ {
|
||||||
|
+ if (scanf ("%as%2c", &sp, c) != 2)
|
||||||
|
+ FAIL ();
|
||||||
|
+ else
|
||||||
|
+ {
|
||||||
|
+ if (strcmp (sp, "1.25s") != 0 || memcmp (c, " x", 2) != 0)
|
||||||
|
+ FAIL ();
|
||||||
|
+ memset (sp, 'x', sizeof "1.25s");
|
||||||
|
+ free (sp);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ fclose (fp);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ remove (fname);
|
||||||
|
+
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
--- libc/stdio-common/scanf15.c 18 Sep 2007 17:59:38 -0000 1.1
|
||||||
|
+++ libc/stdio-common/scanf15.c 24 May 2008 18:14:36 -0000 1.2
|
||||||
|
@@ -50,5 +50,48 @@ main (void)
|
||||||
|
else if (d != 5.25 || memcmp (c, " x", 2) != 0)
|
||||||
|
FAIL ();
|
||||||
|
|
||||||
|
+ const char *tmpdir = getenv ("TMPDIR");
|
||||||
|
+ if (tmpdir == NULL || tmpdir[0] == '\0')
|
||||||
|
+ tmpdir = "/tmp";
|
||||||
|
+
|
||||||
|
+ char fname[strlen (tmpdir) + sizeof "/tst-scanf15.XXXXXX"];
|
||||||
|
+ sprintf (fname, "%s/tst-scanf15.XXXXXX", tmpdir);
|
||||||
|
+ if (fname == NULL)
|
||||||
|
+ FAIL ();
|
||||||
|
+
|
||||||
|
+ /* Create a temporary file. */
|
||||||
|
+ int fd = mkstemp (fname);
|
||||||
|
+ if (fd == -1)
|
||||||
|
+ FAIL ();
|
||||||
|
+
|
||||||
|
+ FILE *fp = fdopen (fd, "w+");
|
||||||
|
+ if (fp == NULL)
|
||||||
|
+ FAIL ();
|
||||||
|
+ else
|
||||||
|
+ {
|
||||||
|
+ if (fputs (" 1.25s x", fp) == EOF)
|
||||||
|
+ FAIL ();
|
||||||
|
+ if (fseek (fp, 0, SEEK_SET) != 0)
|
||||||
|
+ FAIL ();
|
||||||
|
+ if (fscanf (fp, "%as%2c", &f, c) != 2)
|
||||||
|
+ FAIL ();
|
||||||
|
+ else if (f != 1.25 || memcmp (c, " x", 2) != 0)
|
||||||
|
+ FAIL ();
|
||||||
|
+
|
||||||
|
+ if (freopen (fname, "r", stdin) == NULL)
|
||||||
|
+ FAIL ();
|
||||||
|
+ else
|
||||||
|
+ {
|
||||||
|
+ if (scanf ("%as%2c", &f, c) != 2)
|
||||||
|
+ FAIL ();
|
||||||
|
+ else if (f != 1.25 || memcmp (c, " x", 2) != 0)
|
||||||
|
+ FAIL ();
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ fclose (fp);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ remove (fname);
|
||||||
|
+
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
--- libc/stdio-common/scanf16.c 1 Jan 1970 00:00:00 -0000
|
||||||
|
+++ libc/stdio-common/scanf16.c 24 May 2008 18:14:36 -0000 1.1
|
||||||
|
@@ -0,0 +1,147 @@
|
||||||
|
+#include <stdarg.h>
|
||||||
|
+#include <stdio.h>
|
||||||
|
+#include <stdlib.h>
|
||||||
|
+#include <string.h>
|
||||||
|
+#include <wchar.h>
|
||||||
|
+
|
||||||
|
+#define FAIL() \
|
||||||
|
+ do { \
|
||||||
|
+ result = 1; \
|
||||||
|
+ printf ("test at line %d failed\n", __LINE__); \
|
||||||
|
+ } while (0)
|
||||||
|
+
|
||||||
|
+static int
|
||||||
|
+xsscanf (const char *str, const char *fmt, ...)
|
||||||
|
+{
|
||||||
|
+ va_list ap;
|
||||||
|
+ va_start (ap, fmt);
|
||||||
|
+ int ret = vsscanf (str, fmt, ap);
|
||||||
|
+ va_end (ap);
|
||||||
|
+ return ret;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static int
|
||||||
|
+xscanf (const char *fmt, ...)
|
||||||
|
+{
|
||||||
|
+ va_list ap;
|
||||||
|
+ va_start (ap, fmt);
|
||||||
|
+ int ret = vscanf (fmt, ap);
|
||||||
|
+ va_end (ap);
|
||||||
|
+ return ret;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static int
|
||||||
|
+xfscanf (FILE *f, const char *fmt, ...)
|
||||||
|
+{
|
||||||
|
+ va_list ap;
|
||||||
|
+ va_start (ap, fmt);
|
||||||
|
+ int ret = vfscanf (f, fmt, ap);
|
||||||
|
+ va_end (ap);
|
||||||
|
+ return ret;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+int
|
||||||
|
+main (void)
|
||||||
|
+{
|
||||||
|
+ wchar_t *lsp;
|
||||||
|
+ char *sp;
|
||||||
|
+ float f;
|
||||||
|
+ double d;
|
||||||
|
+ char c[8];
|
||||||
|
+ int result = 0;
|
||||||
|
+
|
||||||
|
+ if (xsscanf (" 0.25s x", "%e%3c", &f, c) != 2)
|
||||||
|
+ FAIL ();
|
||||||
|
+ else if (f != 0.25 || memcmp (c, "s x", 3) != 0)
|
||||||
|
+ FAIL ();
|
||||||
|
+ if (xsscanf (" 1.25s x", "%as%2c", &sp, c) != 2)
|
||||||
|
+ FAIL ();
|
||||||
|
+ else
|
||||||
|
+ {
|
||||||
|
+ if (strcmp (sp, "1.25s") != 0 || memcmp (c, " x", 2) != 0)
|
||||||
|
+ FAIL ();
|
||||||
|
+ memset (sp, 'x', sizeof "1.25s");
|
||||||
|
+ free (sp);
|
||||||
|
+ }
|
||||||
|
+ if (xsscanf (" 2.25s x", "%las%2c", &d, c) != 2)
|
||||||
|
+ FAIL ();
|
||||||
|
+ else if (d != 2.25 || memcmp (c, " x", 2) != 0)
|
||||||
|
+ FAIL ();
|
||||||
|
+ if (xsscanf (" 3.25S x", "%4aS%3c", &lsp, c) != 2)
|
||||||
|
+ FAIL ();
|
||||||
|
+ else
|
||||||
|
+ {
|
||||||
|
+ if (wcscmp (lsp, L"3.25") != 0 || memcmp (c, "S x", 3) != 0)
|
||||||
|
+ FAIL ();
|
||||||
|
+ memset (lsp, 'x', sizeof L"3.25");
|
||||||
|
+ free (lsp);
|
||||||
|
+ }
|
||||||
|
+ if (xsscanf ("4.25[0-9.] x", "%a[0-9.]%8c", &sp, c) != 2)
|
||||||
|
+ FAIL ();
|
||||||
|
+ else
|
||||||
|
+ {
|
||||||
|
+ if (strcmp (sp, "4.25") != 0 || memcmp (c, "[0-9.] x", 8) != 0)
|
||||||
|
+ FAIL ();
|
||||||
|
+ memset (sp, 'x', sizeof "4.25");
|
||||||
|
+ free (sp);
|
||||||
|
+ }
|
||||||
|
+ if (xsscanf ("5.25[0-9.] x", "%la[0-9.]%2c", &d, c) != 2)
|
||||||
|
+ FAIL ();
|
||||||
|
+ else if (d != 5.25 || memcmp (c, " x", 2) != 0)
|
||||||
|
+ FAIL ();
|
||||||
|
+
|
||||||
|
+ const char *tmpdir = getenv ("TMPDIR");
|
||||||
|
+ if (tmpdir == NULL || tmpdir[0] == '\0')
|
||||||
|
+ tmpdir = "/tmp";
|
||||||
|
+
|
||||||
|
+ char fname[strlen (tmpdir) + sizeof "/tst-scanf16.XXXXXX"];
|
||||||
|
+ sprintf (fname, "%s/tst-scanf16.XXXXXX", tmpdir);
|
||||||
|
+ if (fname == NULL)
|
||||||
|
+ FAIL ();
|
||||||
|
+
|
||||||
|
+ /* Create a temporary file. */
|
||||||
|
+ int fd = mkstemp (fname);
|
||||||
|
+ if (fd == -1)
|
||||||
|
+ FAIL ();
|
||||||
|
+
|
||||||
|
+ FILE *fp = fdopen (fd, "w+");
|
||||||
|
+ if (fp == NULL)
|
||||||
|
+ FAIL ();
|
||||||
|
+ else
|
||||||
|
+ {
|
||||||
|
+ if (fputs (" 1.25s x", fp) == EOF)
|
||||||
|
+ FAIL ();
|
||||||
|
+ if (fseek (fp, 0, SEEK_SET) != 0)
|
||||||
|
+ FAIL ();
|
||||||
|
+ if (xfscanf (fp, "%as%2c", &sp, c) != 2)
|
||||||
|
+ FAIL ();
|
||||||
|
+ else
|
||||||
|
+ {
|
||||||
|
+ if (strcmp (sp, "1.25s") != 0 || memcmp (c, " x", 2) != 0)
|
||||||
|
+ FAIL ();
|
||||||
|
+ memset (sp, 'x', sizeof "1.25s");
|
||||||
|
+ free (sp);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (freopen (fname, "r", stdin) == NULL)
|
||||||
|
+ FAIL ();
|
||||||
|
+ else
|
||||||
|
+ {
|
||||||
|
+ if (xscanf ("%as%2c", &sp, c) != 2)
|
||||||
|
+ FAIL ();
|
||||||
|
+ else
|
||||||
|
+ {
|
||||||
|
+ if (strcmp (sp, "1.25s") != 0 || memcmp (c, " x", 2) != 0)
|
||||||
|
+ FAIL ();
|
||||||
|
+ memset (sp, 'x', sizeof "1.25s");
|
||||||
|
+ free (sp);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ fclose (fp);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ remove (fname);
|
||||||
|
+
|
||||||
|
+ return result;
|
||||||
|
+}
|
||||||
|
--- libc/stdio-common/scanf17.c 1 Jan 1970 00:00:00 -0000
|
||||||
|
+++ libc/stdio-common/scanf17.c 24 May 2008 18:14:36 -0000 1.1
|
||||||
|
@@ -0,0 +1,128 @@
|
||||||
|
+#undef _GNU_SOURCE
|
||||||
|
+#define _XOPEN_SOURCE 600
|
||||||
|
+/* The following macro definitions are a hack. They word around disabling
|
||||||
|
+ the GNU extension while still using a few internal headers. */
|
||||||
|
+#define u_char unsigned char
|
||||||
|
+#define u_short unsigned short
|
||||||
|
+#define u_int unsigned int
|
||||||
|
+#define u_long unsigned long
|
||||||
|
+#include <stdarg.h>
|
||||||
|
+#include <stdio.h>
|
||||||
|
+#include <stdlib.h>
|
||||||
|
+#include <string.h>
|
||||||
|
+#include <wchar.h>
|
||||||
|
+
|
||||||
|
+#define FAIL() \
|
||||||
|
+ do { \
|
||||||
|
+ result = 1; \
|
||||||
|
+ printf ("test at line %d failed\n", __LINE__); \
|
||||||
|
+ } while (0)
|
||||||
|
+
|
||||||
|
+static int
|
||||||
|
+xsscanf (const char *str, const char *fmt, ...)
|
||||||
|
+{
|
||||||
|
+ va_list ap;
|
||||||
|
+ va_start (ap, fmt);
|
||||||
|
+ int ret = vsscanf (str, fmt, ap);
|
||||||
|
+ va_end (ap);
|
||||||
|
+ return ret;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static int
|
||||||
|
+xscanf (const char *fmt, ...)
|
||||||
|
+{
|
||||||
|
+ va_list ap;
|
||||||
|
+ va_start (ap, fmt);
|
||||||
|
+ int ret = vscanf (fmt, ap);
|
||||||
|
+ va_end (ap);
|
||||||
|
+ return ret;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static int
|
||||||
|
+xfscanf (FILE *f, const char *fmt, ...)
|
||||||
|
+{
|
||||||
|
+ va_list ap;
|
||||||
|
+ va_start (ap, fmt);
|
||||||
|
+ int ret = vfscanf (f, fmt, ap);
|
||||||
|
+ va_end (ap);
|
||||||
|
+ return ret;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+int
|
||||||
|
+main (void)
|
||||||
|
+{
|
||||||
|
+ float f;
|
||||||
|
+ double d;
|
||||||
|
+ char c[8];
|
||||||
|
+ int result = 0;
|
||||||
|
+
|
||||||
|
+ if (xsscanf (" 0.25s x", "%e%3c", &f, c) != 2)
|
||||||
|
+ FAIL ();
|
||||||
|
+ else if (f != 0.25 || memcmp (c, "s x", 3) != 0)
|
||||||
|
+ FAIL ();
|
||||||
|
+ if (xsscanf (" 1.25s x", "%as%2c", &f, c) != 2)
|
||||||
|
+ FAIL ();
|
||||||
|
+ else if (f != 1.25 || memcmp (c, " x", 2) != 0)
|
||||||
|
+ FAIL ();
|
||||||
|
+ if (xsscanf (" 2.25s x", "%las%2c", &d, c) != 2)
|
||||||
|
+ FAIL ();
|
||||||
|
+ else if (d != 2.25 || memcmp (c, " x", 2) != 0)
|
||||||
|
+ FAIL ();
|
||||||
|
+ if (xsscanf (" 3.25S x", "%4aS%2c", &f, c) != 2)
|
||||||
|
+ FAIL ();
|
||||||
|
+ else if (f != 3.25 || memcmp (c, " x", 2) != 0)
|
||||||
|
+ FAIL ();
|
||||||
|
+ if (xsscanf (" 4.25[0-9.] x", "%a[0-9.]%2c", &f, c) != 2)
|
||||||
|
+ FAIL ();
|
||||||
|
+ else if (f != 4.25 || memcmp (c, " x", 2) != 0)
|
||||||
|
+ FAIL ();
|
||||||
|
+ if (xsscanf (" 5.25[0-9.] x", "%la[0-9.]%2c", &d, c) != 2)
|
||||||
|
+ FAIL ();
|
||||||
|
+ else if (d != 5.25 || memcmp (c, " x", 2) != 0)
|
||||||
|
+ FAIL ();
|
||||||
|
+
|
||||||
|
+ const char *tmpdir = getenv ("TMPDIR");
|
||||||
|
+ if (tmpdir == NULL || tmpdir[0] == '\0')
|
||||||
|
+ tmpdir = "/tmp";
|
||||||
|
+
|
||||||
|
+ char fname[strlen (tmpdir) + sizeof "/tst-scanf17.XXXXXX"];
|
||||||
|
+ sprintf (fname, "%s/tst-scanf17.XXXXXX", tmpdir);
|
||||||
|
+ if (fname == NULL)
|
||||||
|
+ FAIL ();
|
||||||
|
+
|
||||||
|
+ /* Create a temporary file. */
|
||||||
|
+ int fd = mkstemp (fname);
|
||||||
|
+ if (fd == -1)
|
||||||
|
+ FAIL ();
|
||||||
|
+
|
||||||
|
+ FILE *fp = fdopen (fd, "w+");
|
||||||
|
+ if (fp == NULL)
|
||||||
|
+ FAIL ();
|
||||||
|
+ else
|
||||||
|
+ {
|
||||||
|
+ if (fputs (" 1.25s x", fp) == EOF)
|
||||||
|
+ FAIL ();
|
||||||
|
+ if (fseek (fp, 0, SEEK_SET) != 0)
|
||||||
|
+ FAIL ();
|
||||||
|
+ if (xfscanf (fp, "%as%2c", &f, c) != 2)
|
||||||
|
+ FAIL ();
|
||||||
|
+ else if (f != 1.25 || memcmp (c, " x", 2) != 0)
|
||||||
|
+ FAIL ();
|
||||||
|
+
|
||||||
|
+ if (freopen (fname, "r", stdin) == NULL)
|
||||||
|
+ FAIL ();
|
||||||
|
+ else
|
||||||
|
+ {
|
||||||
|
+ if (xscanf ("%as%2c", &f, c) != 2)
|
||||||
|
+ FAIL ();
|
||||||
|
+ else if (f != 1.25 || memcmp (c, " x", 2) != 0)
|
||||||
|
+ FAIL ();
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ fclose (fp);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ remove (fname);
|
||||||
|
+
|
||||||
|
+ return result;
|
||||||
|
+}
|
@ -1,6 +1,50 @@
|
|||||||
--- glibc-20080412T0741/ChangeLog 12 Apr 2008 04:17:47 -0000 1.11164
|
--- glibc-20080412T0741/ChangeLog 12 Apr 2008 04:17:47 -0000 1.11164
|
||||||
+++ glibc-20080412T0741-fedora/ChangeLog 12 Apr 2008 07:48:55 -0000 1.8782.2.297
|
+++ glibc-20080412T0741-fedora/ChangeLog 30 Apr 2008 12:11:28 -0000 1.8782.2.298
|
||||||
@@ -4395,6 +4395,13 @@
|
@@ -1,3 +1,43 @@
|
||||||
|
+2008-04-25 David S. Miller <davem@davemloft.net>
|
||||||
|
+
|
||||||
|
+ * sysdeps/unix/sysv/linux/sparc/sparc64/semctl.c (semctl):
|
||||||
|
+ Pass "union semun" properly in to sys_ipc, it must be passed
|
||||||
|
+ by value, not by reference.
|
||||||
|
+
|
||||||
|
+2008-04-22 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
+
|
||||||
|
+ * nscd/Makefile (nscd-cflags): Set back to -fpie.
|
||||||
|
+ * nscd/nscd.h (mem_in_flight): Add attribute_tls_model_ie.
|
||||||
|
+ * nscd/connections.c (mem_in_flight): Likewise.
|
||||||
|
+
|
||||||
|
+ * nscd/nscd.h (dbs): Make hidden.
|
||||||
|
+
|
||||||
|
+2008-04-15 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
+
|
||||||
|
+ [BZ #5381]
|
||||||
|
+ * nscd/nscd.h: Define enum in_flight, mem_in_flight, and
|
||||||
|
+ mem_in_flight_list variables. Add new parameter to mempool_alloc
|
||||||
|
+ prototype.
|
||||||
|
+ * nscd/mem.c (mempool_alloc): Take additional parameter. Initialize
|
||||||
|
+ appropriate mem_in_flight element.
|
||||||
|
+ (gc): Take allocations which have not yet been committed to the
|
||||||
|
+ database into account.
|
||||||
|
+ * nscd/cache.c (cache_add): Add new parameter to mempool_alloc call.
|
||||||
|
+ Reset mem_in_flight before returning.
|
||||||
|
+ * nscd/connections.c (nscd_run_worker): Initialize mem_in_flight and
|
||||||
|
+ cue it up in mem_in_flight_list.
|
||||||
|
+ * nscd/aicache.c: Adjust mempool_alloc call.
|
||||||
|
+ * nscd/grpcache.c: Likewise.
|
||||||
|
+ * nscd/hstcache.c: Likewise.
|
||||||
|
+ * nscd/initgrcache.c: Likewise.
|
||||||
|
+ * nscd/pwdcache.c: Likewise.
|
||||||
|
+ * nscd/servicescache.c: Likewise.
|
||||||
|
+ * nscd/Makefile (nscd-flags): Until ld is fixed, use -fpic instead
|
||||||
|
+ of -fpie.
|
||||||
|
+
|
||||||
|
+ * nscd/connections.c (handle_request): Provide better error message
|
||||||
|
+ in case SELinux forbids the service.
|
||||||
|
+
|
||||||
|
2008-04-11 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* sysdeps/unix/sysv/linux/powerpc/bits/mathinline.h (__signbitl):
|
||||||
|
@@ -4395,6 +4435,13 @@
|
||||||
* include/sys/cdefs.h: Redefine __nonnull so that test for
|
* include/sys/cdefs.h: Redefine __nonnull so that test for
|
||||||
incorrect parameters in the libc code itself are not omitted.
|
incorrect parameters in the libc code itself are not omitted.
|
||||||
|
|
||||||
@ -14,7 +58,7 @@
|
|||||||
2007-05-09 Jakub Jelinek <jakub@redhat.com>
|
2007-05-09 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
* sysdeps/ia64/fpu/fraiseexcpt.c (feraiseexcept): Don't raise overflow
|
* sysdeps/ia64/fpu/fraiseexcpt.c (feraiseexcept): Don't raise overflow
|
||||||
@@ -4690,6 +4697,10 @@
|
@@ -4690,6 +4737,10 @@
|
||||||
[BZ #4368]
|
[BZ #4368]
|
||||||
* stdlib/stdlib.h: Remove obsolete part of comment for realpath.
|
* stdlib/stdlib.h: Remove obsolete part of comment for realpath.
|
||||||
|
|
||||||
@ -25,7 +69,7 @@
|
|||||||
2007-04-16 Ulrich Drepper <drepper@redhat.com>
|
2007-04-16 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
[BZ #4364]
|
[BZ #4364]
|
||||||
@@ -5947,6 +5958,15 @@
|
@@ -5947,6 +5998,15 @@
|
||||||
separators also if no non-zero digits found.
|
separators also if no non-zero digits found.
|
||||||
* stdlib/Makefile (tests): Add tst-strtod3.
|
* stdlib/Makefile (tests): Add tst-strtod3.
|
||||||
|
|
||||||
@ -1222,8 +1266,17 @@
|
|||||||
-#SETENT_BATCH_READ=TRUE
|
-#SETENT_BATCH_READ=TRUE
|
||||||
+SETENT_BATCH_READ=TRUE
|
+SETENT_BATCH_READ=TRUE
|
||||||
--- glibc-20080412T0741/nptl/ChangeLog 9 Apr 2008 17:59:06 -0000 1.1062
|
--- glibc-20080412T0741/nptl/ChangeLog 9 Apr 2008 17:59:06 -0000 1.1062
|
||||||
+++ glibc-20080412T0741-fedora/nptl/ChangeLog 10 Apr 2008 19:21:05 -0000 1.706.2.153
|
+++ glibc-20080412T0741-fedora/nptl/ChangeLog 30 Apr 2008 12:11:30 -0000 1.706.2.154
|
||||||
@@ -3148,6 +3148,15 @@
|
@@ -1,3 +1,8 @@
|
||||||
|
+2008-04-14 David S. Miller <davem@davemloft.net>
|
||||||
|
+
|
||||||
|
+ * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
|
||||||
|
+ (__old_sem_wait): Fix argument to lll_futex_wait().
|
||||||
|
+
|
||||||
|
2007-11-26 Daniel Jacobowitz <dan@codesourcery.com>
|
||||||
|
|
||||||
|
* pthread_create.c: Require pthread_mutex_trylock and
|
||||||
|
@@ -3148,6 +3153,15 @@
|
||||||
Use __sigfillset. Document that sigfillset does the right thing wrt
|
Use __sigfillset. Document that sigfillset does the right thing wrt
|
||||||
to SIGSETXID.
|
to SIGSETXID.
|
||||||
|
|
||||||
@ -1239,7 +1292,7 @@
|
|||||||
2005-07-11 Jakub Jelinek <jakub@redhat.com>
|
2005-07-11 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
[BZ #1102]
|
[BZ #1102]
|
||||||
@@ -3884,6 +3893,11 @@
|
@@ -3884,6 +3898,11 @@
|
||||||
Move definition inside libpthread, libc, librt check. Provide
|
Move definition inside libpthread, libc, librt check. Provide
|
||||||
definition for rtld.
|
definition for rtld.
|
||||||
|
|
||||||
@ -1251,7 +1304,7 @@
|
|||||||
2004-09-02 Ulrich Drepper <drepper@redhat.com>
|
2004-09-02 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
* sysdeps/alpha/jmpbuf-unwind.h: Define __libc_unwind_longjmp.
|
* sysdeps/alpha/jmpbuf-unwind.h: Define __libc_unwind_longjmp.
|
||||||
@@ -5958,6 +5972,11 @@
|
@@ -5958,6 +5977,11 @@
|
||||||
|
|
||||||
* Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
|
* Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
|
||||||
|
|
||||||
@ -1342,6 +1395,323 @@
|
|||||||
+#define _XOPEN_STREAMS -1
|
+#define _XOPEN_STREAMS -1
|
||||||
+
|
+
|
||||||
#endif /* posix_opt.h */
|
#endif /* posix_opt.h */
|
||||||
|
--- glibc-20080412T0741/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c 15 Aug 2007 20:47:42 -0000 1.2
|
||||||
|
+++ glibc-20080412T0741-fedora/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c 30 Apr 2008 12:11:31 -0000 1.1.2.3
|
||||||
|
@@ -155,7 +155,7 @@ __old_sem_wait (sem_t *sem)
|
||||||
|
/* Enable asynchronous cancellation. Required by the standard. */
|
||||||
|
int oldtype = __pthread_enable_asynccancel ();
|
||||||
|
|
||||||
|
- err = lll_futex_wait (futex, 0,
|
||||||
|
+ err = lll_futex_wait (&isem->value, 0,
|
||||||
|
isem->private ^ FUTEX_PRIVATE_FLAG);
|
||||||
|
|
||||||
|
/* Disable asynchronous cancellation. */
|
||||||
|
--- glibc-20080412T0741/nscd/aicache.c 25 Nov 2007 12:56:35 -0000 1.17
|
||||||
|
+++ glibc-20080412T0741-fedora/nscd/aicache.c 30 Apr 2008 12:11:31 -0000 1.5.2.9
|
||||||
|
@@ -262,7 +262,8 @@ addhstaiX (struct database_dyn *db, int
|
||||||
|
{
|
||||||
|
dataset = (struct dataset *) mempool_alloc (db,
|
||||||
|
total
|
||||||
|
- + req->key_len);
|
||||||
|
+ + req->key_len,
|
||||||
|
+ IDX_result_data);
|
||||||
|
if (dataset == NULL)
|
||||||
|
++db->head->addfailed;
|
||||||
|
}
|
||||||
|
@@ -338,7 +339,8 @@ addhstaiX (struct database_dyn *db, int
|
||||||
|
struct dataset *newp
|
||||||
|
= (struct dataset *) mempool_alloc (db,
|
||||||
|
total
|
||||||
|
- + req->key_len);
|
||||||
|
+ + req->key_len,
|
||||||
|
+ IDX_result_data);
|
||||||
|
if (__builtin_expect (newp != NULL, 1))
|
||||||
|
{
|
||||||
|
/* Adjust pointer into the memory block. */
|
||||||
|
@@ -424,7 +426,8 @@ addhstaiX (struct database_dyn *db, int
|
||||||
|
if (fd != -1)
|
||||||
|
TEMP_FAILURE_RETRY (send (fd, ¬found, total, MSG_NOSIGNAL));
|
||||||
|
|
||||||
|
- dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len);
|
||||||
|
+ dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len,
|
||||||
|
+ IDX_result_data);
|
||||||
|
/* If we cannot permanently store the result, so be it. */
|
||||||
|
if (dataset != NULL)
|
||||||
|
{
|
||||||
|
--- glibc-20080412T0741/nscd/cache.c 25 Nov 2007 21:47:35 -0000 1.35
|
||||||
|
+++ glibc-20080412T0741-fedora/nscd/cache.c 30 Apr 2008 12:11:31 -0000 1.19.2.10
|
||||||
|
@@ -155,11 +155,16 @@ cache_add (int type, const void *key, si
|
||||||
|
unsigned long int hash = __nis_hash (key, len) % table->head->module;
|
||||||
|
struct hashentry *newp;
|
||||||
|
|
||||||
|
- newp = mempool_alloc (table, sizeof (struct hashentry));
|
||||||
|
+ newp = mempool_alloc (table, sizeof (struct hashentry), IDX_record_data);
|
||||||
|
/* If we cannot allocate memory, just do not do anything. */
|
||||||
|
if (newp == NULL)
|
||||||
|
{
|
||||||
|
++table->head->addfailed;
|
||||||
|
+
|
||||||
|
+ /* Mark the in-flight memory as unused. */
|
||||||
|
+ for (enum in_flight idx = 0; idx < IDX_record_data; ++idx)
|
||||||
|
+ mem_in_flight.block[idx].dbidx = -1;
|
||||||
|
+
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -215,6 +220,10 @@ cache_add (int type, const void *key, si
|
||||||
|
else
|
||||||
|
next_wakeup = table->wakeup_time;
|
||||||
|
|
||||||
|
+ /* Mark the in-flight memory as unused. */
|
||||||
|
+ for (enum in_flight idx = 0; idx < IDX_last; ++idx)
|
||||||
|
+ mem_in_flight.block[idx].dbidx = -1;
|
||||||
|
+
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
--- glibc-20080412T0741/nscd/connections.c 4 Mar 2008 01:53:50 -0000 1.109
|
||||||
|
+++ glibc-20080412T0741-fedora/nscd/connections.c 30 Apr 2008 12:11:31 -0000 1.55.2.39
|
||||||
|
@@ -225,6 +225,11 @@ static int sock;
|
||||||
|
/* Number of times clients had to wait. */
|
||||||
|
unsigned long int client_queued;
|
||||||
|
|
||||||
|
+/* Data structure for recording in-flight memory allocation. */
|
||||||
|
+__thread struct mem_in_flight mem_in_flight attribute_tls_model_ie;
|
||||||
|
+/* Global list of the mem_in_flight variables of all the threads. */
|
||||||
|
+struct mem_in_flight *mem_in_flight_list;
|
||||||
|
+
|
||||||
|
|
||||||
|
ssize_t
|
||||||
|
writeall (int fd, const void *buf, size_t len)
|
||||||
|
@@ -964,7 +969,7 @@ send_ro_fd (struct database_dyn *db, cha
|
||||||
|
|
||||||
|
/* Handle new request. */
|
||||||
|
static void
|
||||||
|
-handle_request (int fd, request_header *req, void *key, uid_t uid)
|
||||||
|
+handle_request (int fd, request_header *req, void *key, uid_t uid, pid_t pid)
|
||||||
|
{
|
||||||
|
if (__builtin_expect (req->version, NSCD_VERSION) != NSCD_VERSION)
|
||||||
|
{
|
||||||
|
@@ -979,7 +984,31 @@ cannot handle old request version %d; cu
|
||||||
|
if (selinux_enabled && nscd_request_avc_has_perm (fd, req->type) != 0)
|
||||||
|
{
|
||||||
|
if (debug_level > 0)
|
||||||
|
- dbg_log (_("request not handled due to missing permission"));
|
||||||
|
+ {
|
||||||
|
+#ifdef SO_PEERCRED
|
||||||
|
+# ifdef PATH_MAX
|
||||||
|
+ char buf[PATH_MAX];
|
||||||
|
+# else
|
||||||
|
+ char buf[4096];
|
||||||
|
+# endif
|
||||||
|
+
|
||||||
|
+ snprintf (buf, sizeof (buf), "/proc/%ld/exe", (long int) pid);
|
||||||
|
+ ssize_t n = readlink (buf, buf, sizeof (buf) - 1);
|
||||||
|
+
|
||||||
|
+ if (n <= 0)
|
||||||
|
+ dbg_log (_("\
|
||||||
|
+request from %ld not handled due to missing permission"), (long int) pid);
|
||||||
|
+ else
|
||||||
|
+ {
|
||||||
|
+ buf[n] = '\0';
|
||||||
|
+ dbg_log (_("\
|
||||||
|
+request from '%s' [%ld] not handled due to missing permission"),
|
||||||
|
+ buf, (long int) pid);
|
||||||
|
+ }
|
||||||
|
+#else
|
||||||
|
+ dbg_log (_("request not handled due to missing permission"));
|
||||||
|
+#endif
|
||||||
|
+ }
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -1426,6 +1455,16 @@ nscd_run_worker (void *p)
|
||||||
|
{
|
||||||
|
char buf[256];
|
||||||
|
|
||||||
|
+ /* Initialize the memory-in-flight list. */
|
||||||
|
+ for (enum in_flight idx = 0; idx < IDX_last; ++idx)
|
||||||
|
+ mem_in_flight.block[idx].dbidx = -1;
|
||||||
|
+ /* And queue this threads structure. */
|
||||||
|
+ do
|
||||||
|
+ mem_in_flight.next = mem_in_flight_list;
|
||||||
|
+ while (atomic_compare_and_exchange_bool_acq (&mem_in_flight_list,
|
||||||
|
+ &mem_in_flight,
|
||||||
|
+ mem_in_flight.next) != 0);
|
||||||
|
+
|
||||||
|
/* Initial locking. */
|
||||||
|
pthread_mutex_lock (&readylist_lock);
|
||||||
|
|
||||||
|
@@ -1491,6 +1530,8 @@ nscd_run_worker (void *p)
|
||||||
|
if (getsockopt (fd, SOL_SOCKET, SO_PEERCRED, &caller, &optlen) == 0)
|
||||||
|
pid = caller.pid;
|
||||||
|
}
|
||||||
|
+#else
|
||||||
|
+ const pid_t pid = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* It should not be possible to crash the nscd with a silly
|
||||||
|
@@ -1531,7 +1572,7 @@ handle_request: request received (Versio
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Phew, we got all the data, now process it. */
|
||||||
|
- handle_request (fd, &req, keybuf, uid);
|
||||||
|
+ handle_request (fd, &req, keybuf, uid, pid);
|
||||||
|
}
|
||||||
|
|
||||||
|
close_and_out:
|
||||||
|
--- glibc-20080412T0741/nscd/grpcache.c 25 Nov 2007 21:25:22 -0000 1.50
|
||||||
|
+++ glibc-20080412T0741-fedora/nscd/grpcache.c 30 Apr 2008 12:11:31 -0000 1.36.2.12
|
||||||
|
@@ -113,7 +113,8 @@ cache_addgr (struct database_dyn *db, in
|
||||||
|
written = TEMP_FAILURE_RETRY (send (fd, ¬found, total,
|
||||||
|
MSG_NOSIGNAL));
|
||||||
|
|
||||||
|
- dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len);
|
||||||
|
+ dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len,
|
||||||
|
+ IDX_result_data);
|
||||||
|
/* If we cannot permanently store the result, so be it. */
|
||||||
|
if (dataset != NULL)
|
||||||
|
{
|
||||||
|
@@ -204,7 +205,8 @@ cache_addgr (struct database_dyn *db, in
|
||||||
|
|
||||||
|
if (he == NULL)
|
||||||
|
{
|
||||||
|
- dataset = (struct dataset *) mempool_alloc (db, total + n);
|
||||||
|
+ dataset = (struct dataset *) mempool_alloc (db, total + n,
|
||||||
|
+ IDX_result_data);
|
||||||
|
if (dataset == NULL)
|
||||||
|
++db->head->addfailed;
|
||||||
|
}
|
||||||
|
@@ -274,7 +276,8 @@ cache_addgr (struct database_dyn *db, in
|
||||||
|
/* We have to create a new record. Just allocate
|
||||||
|
appropriate memory and copy it. */
|
||||||
|
struct dataset *newp
|
||||||
|
- = (struct dataset *) mempool_alloc (db, total + n);
|
||||||
|
+ = (struct dataset *) mempool_alloc (db, total + n,
|
||||||
|
+ IDX_result_data);
|
||||||
|
if (newp != NULL)
|
||||||
|
{
|
||||||
|
/* Adjust pointers into the memory block. */
|
||||||
|
--- glibc-20080412T0741/nscd/hstcache.c 25 Nov 2007 21:24:14 -0000 1.46
|
||||||
|
+++ glibc-20080412T0741-fedora/nscd/hstcache.c 30 Apr 2008 12:11:31 -0000 1.31.2.11
|
||||||
|
@@ -121,7 +121,8 @@ cache_addhst (struct database_dyn *db, i
|
||||||
|
written = TEMP_FAILURE_RETRY (send (fd, ¬found, total,
|
||||||
|
MSG_NOSIGNAL));
|
||||||
|
|
||||||
|
- dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len);
|
||||||
|
+ dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len,
|
||||||
|
+ IDX_result_data);
|
||||||
|
/* If we cannot permanently store the result, so be it. */
|
||||||
|
if (dataset != NULL)
|
||||||
|
{
|
||||||
|
@@ -226,7 +227,8 @@ cache_addhst (struct database_dyn *db, i
|
||||||
|
if (he == NULL && h_addr_list_cnt == 1)
|
||||||
|
{
|
||||||
|
dataset = (struct dataset *) mempool_alloc (db,
|
||||||
|
- total + req->key_len);
|
||||||
|
+ total + req->key_len,
|
||||||
|
+ IDX_result_data);
|
||||||
|
if (dataset == NULL)
|
||||||
|
++db->head->addfailed;
|
||||||
|
}
|
||||||
|
@@ -312,7 +314,8 @@ cache_addhst (struct database_dyn *db, i
|
||||||
|
appropriate memory and copy it. */
|
||||||
|
struct dataset *newp
|
||||||
|
= (struct dataset *) mempool_alloc (db,
|
||||||
|
- total + req->key_len);
|
||||||
|
+ total + req->key_len,
|
||||||
|
+ IDX_result_data);
|
||||||
|
if (newp != NULL)
|
||||||
|
{
|
||||||
|
/* Adjust pointers into the memory block. */
|
||||||
|
--- glibc-20080412T0741/nscd/initgrcache.c 25 Nov 2007 21:29:04 -0000 1.12
|
||||||
|
+++ glibc-20080412T0741-fedora/nscd/initgrcache.c 30 Apr 2008 12:11:31 -0000 1.1.2.14
|
||||||
|
@@ -197,7 +197,8 @@ addinitgroupsX (struct database_dyn *db,
|
||||||
|
written = TEMP_FAILURE_RETRY (send (fd, ¬found, total,
|
||||||
|
MSG_NOSIGNAL));
|
||||||
|
|
||||||
|
- dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len);
|
||||||
|
+ dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len,
|
||||||
|
+ IDX_result_data);
|
||||||
|
/* If we cannot permanently store the result, so be it. */
|
||||||
|
if (dataset != NULL)
|
||||||
|
{
|
||||||
|
@@ -259,7 +260,8 @@ addinitgroupsX (struct database_dyn *db,
|
||||||
|
if (he == NULL)
|
||||||
|
{
|
||||||
|
dataset = (struct dataset *) mempool_alloc (db,
|
||||||
|
- total + req->key_len);
|
||||||
|
+ total + req->key_len,
|
||||||
|
+ IDX_result_data);
|
||||||
|
if (dataset == NULL)
|
||||||
|
++db->head->addfailed;
|
||||||
|
}
|
||||||
|
@@ -329,7 +331,8 @@ addinitgroupsX (struct database_dyn *db,
|
||||||
|
/* We have to create a new record. Just allocate
|
||||||
|
appropriate memory and copy it. */
|
||||||
|
struct dataset *newp
|
||||||
|
- = (struct dataset *) mempool_alloc (db, total + req->key_len);
|
||||||
|
+ = (struct dataset *) mempool_alloc (db, total + req->key_len,
|
||||||
|
+ IDX_result_data);
|
||||||
|
if (newp != NULL)
|
||||||
|
{
|
||||||
|
/* Adjust pointer into the memory block. */
|
||||||
|
--- glibc-20080412T0741/nscd/mem.c 25 Nov 2007 21:07:14 -0000 1.12
|
||||||
|
+++ glibc-20080412T0741-fedora/nscd/mem.c 30 Apr 2008 12:11:31 -0000 1.3.2.7
|
||||||
|
@@ -197,6 +197,31 @@ gc (struct database_dyn *db)
|
||||||
|
}
|
||||||
|
assert (cnt == db->head->nentries);
|
||||||
|
|
||||||
|
+ /* Go through the list of in-flight memory blocks. */
|
||||||
|
+ struct mem_in_flight *mrunp = mem_in_flight_list;
|
||||||
|
+ while (mrunp != NULL)
|
||||||
|
+ {
|
||||||
|
+ /* NB: There can be no race between this test and another thread
|
||||||
|
+ setting the field to the index we are looking for because
|
||||||
|
+ this would require the other thread to also have the memlock
|
||||||
|
+ for the database.
|
||||||
|
+
|
||||||
|
+ NB2: we do not have to look at latter blocks (higher indices) if
|
||||||
|
+ earlier blocks are not in flight. They are always allocated in
|
||||||
|
+ sequence. */
|
||||||
|
+ for (enum in_flight idx = IDX_result_data;
|
||||||
|
+ idx < IDX_last && mrunp->block[idx].dbidx == db - dbs; ++idx)
|
||||||
|
+ {
|
||||||
|
+ assert ((char *) mrunp->block[idx].blockaddr > db->data);
|
||||||
|
+ assert ((char *) mrunp->block[idx].blockaddr
|
||||||
|
+ + mrunp->block[0].blocklen <= db->data + db->memsize);
|
||||||
|
+ markrange (mark, (char *) mrunp->block[idx].blockaddr - db->data,
|
||||||
|
+ mrunp->block[idx].blocklen);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ mrunp = mrunp->next;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
/* Sort the entries by the addresses of the referenced data. All
|
||||||
|
the entries pointing to the same DATAHEAD object will have the
|
||||||
|
same key. Stability of the sorting is unimportant. */
|
||||||
|
@@ -503,7 +528,7 @@ gc (struct database_dyn *db)
|
||||||
|
|
||||||
|
|
||||||
|
void *
|
||||||
|
-mempool_alloc (struct database_dyn *db, size_t len)
|
||||||
|
+mempool_alloc (struct database_dyn *db, size_t len, enum in_flight idx)
|
||||||
|
{
|
||||||
|
/* Make sure LEN is a multiple of our maximum alignment so we can
|
||||||
|
keep track of used memory is multiples of this alignment value. */
|
||||||
|
@@ -567,6 +592,12 @@ mempool_alloc (struct database_dyn *db,
|
||||||
|
db->head->first_free += len;
|
||||||
|
|
||||||
|
db->last_alloc_failed = false;
|
||||||
|
+
|
||||||
|
+ /* Remember that we have allocated this memory. */
|
||||||
|
+ assert (idx >= 0 && idx < IDX_last);
|
||||||
|
+ mem_in_flight.block[idx].dbidx = db - dbs;
|
||||||
|
+ mem_in_flight.block[idx].blocklen = len;
|
||||||
|
+ mem_in_flight.block[idx].blockaddr = res;
|
||||||
|
}
|
||||||
|
|
||||||
|
pthread_mutex_unlock (&db->memlock);
|
||||||
--- glibc-20080412T0741/nscd/nscd.conf 6 Nov 2007 00:50:48 -0000 1.16
|
--- glibc-20080412T0741/nscd/nscd.conf 6 Nov 2007 00:50:48 -0000 1.16
|
||||||
+++ glibc-20080412T0741-fedora/nscd/nscd.conf 12 Dec 2007 18:13:28 -0000 1.8.2.7
|
+++ glibc-20080412T0741-fedora/nscd/nscd.conf 12 Dec 2007 18:13:28 -0000 1.8.2.7
|
||||||
@@ -33,7 +33,7 @@
|
@@ -33,7 +33,7 @@
|
||||||
@ -1353,6 +1723,59 @@
|
|||||||
# stat-user somebody
|
# stat-user somebody
|
||||||
debug-level 0
|
debug-level 0
|
||||||
# reload-count 5
|
# reload-count 5
|
||||||
|
--- glibc-20080412T0741/nscd/nscd.h 4 Mar 2008 01:53:25 -0000 1.33
|
||||||
|
+++ glibc-20080412T0741-fedora/nscd/nscd.h 30 Apr 2008 12:11:31 -0000 1.17.2.13
|
||||||
|
@@ -130,7 +130,7 @@ struct database_dyn
|
||||||
|
|
||||||
|
|
||||||
|
/* Global variables. */
|
||||||
|
-extern struct database_dyn dbs[lastdb];
|
||||||
|
+extern struct database_dyn dbs[lastdb] attribute_hidden;
|
||||||
|
extern const char *const dbnames[lastdb];
|
||||||
|
extern const char *const serv2str[LASTREQ];
|
||||||
|
|
||||||
|
@@ -181,6 +181,31 @@ extern uid_t old_uid;
|
||||||
|
extern gid_t old_gid;
|
||||||
|
|
||||||
|
|
||||||
|
+/* Memory allocation in flight. Each thread can have a limited number
|
||||||
|
+ of allocation in flight. No need to create dynamic data
|
||||||
|
+ structures. We use fixed indices. */
|
||||||
|
+enum in_flight
|
||||||
|
+ {
|
||||||
|
+ IDX_result_data = 0,
|
||||||
|
+ /* Keep the IDX_record_data entry last at all times. */
|
||||||
|
+ IDX_record_data = 1,
|
||||||
|
+ IDX_last
|
||||||
|
+ };
|
||||||
|
+extern __thread struct mem_in_flight
|
||||||
|
+{
|
||||||
|
+ struct
|
||||||
|
+ {
|
||||||
|
+ int dbidx;
|
||||||
|
+ nscd_ssize_t blocklen;
|
||||||
|
+ void *blockaddr;
|
||||||
|
+ } block[IDX_last];
|
||||||
|
+
|
||||||
|
+ struct mem_in_flight *next;
|
||||||
|
+} mem_in_flight attribute_tls_model_ie;
|
||||||
|
+/* Global list of the mem_in_flight variables of all the threads. */
|
||||||
|
+extern struct mem_in_flight *mem_in_flight_list;
|
||||||
|
+
|
||||||
|
+
|
||||||
|
/* Prototypes for global functions. */
|
||||||
|
|
||||||
|
/* nscd.c */
|
||||||
|
@@ -271,7 +296,8 @@ extern void readdservbyport (struct data
|
||||||
|
struct datahead *dh);
|
||||||
|
|
||||||
|
/* mem.c */
|
||||||
|
-extern void *mempool_alloc (struct database_dyn *db, size_t len);
|
||||||
|
+extern void *mempool_alloc (struct database_dyn *db, size_t len,
|
||||||
|
+ enum in_flight idx);
|
||||||
|
extern void gc (struct database_dyn *db);
|
||||||
|
|
||||||
|
|
||||||
--- glibc-20080412T0741/nscd/nscd.init 1 Dec 2006 20:12:45 -0000 1.10
|
--- glibc-20080412T0741/nscd/nscd.init 1 Dec 2006 20:12:45 -0000 1.10
|
||||||
+++ glibc-20080412T0741-fedora/nscd/nscd.init 12 Dec 2007 18:13:28 -0000 1.6.2.6
|
+++ glibc-20080412T0741-fedora/nscd/nscd.init 12 Dec 2007 18:13:28 -0000 1.6.2.6
|
||||||
@@ -9,6 +9,7 @@
|
@@ -9,6 +9,7 @@
|
||||||
@ -1411,6 +1834,70 @@
|
|||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}"
|
echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}"
|
||||||
|
--- glibc-20080412T0741/nscd/pwdcache.c 25 Nov 2007 21:27:50 -0000 1.48
|
||||||
|
+++ glibc-20080412T0741-fedora/nscd/pwdcache.c 30 Apr 2008 12:11:31 -0000 1.35.2.11
|
||||||
|
@@ -120,7 +120,8 @@ cache_addpw (struct database_dyn *db, in
|
||||||
|
written = TEMP_FAILURE_RETRY (send (fd, ¬found, total,
|
||||||
|
MSG_NOSIGNAL));
|
||||||
|
|
||||||
|
- dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len);
|
||||||
|
+ dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len,
|
||||||
|
+ IDX_result_data);
|
||||||
|
/* If we cannot permanently store the result, so be it. */
|
||||||
|
if (dataset != NULL)
|
||||||
|
{
|
||||||
|
@@ -199,7 +200,8 @@ cache_addpw (struct database_dyn *db, in
|
||||||
|
|
||||||
|
if (he == NULL)
|
||||||
|
{
|
||||||
|
- dataset = (struct dataset *) mempool_alloc (db, total + n);
|
||||||
|
+ dataset = (struct dataset *) mempool_alloc (db, total + n,
|
||||||
|
+ IDX_result_data);
|
||||||
|
if (dataset == NULL)
|
||||||
|
++db->head->addfailed;
|
||||||
|
}
|
||||||
|
@@ -270,7 +272,8 @@ cache_addpw (struct database_dyn *db, in
|
||||||
|
/* We have to create a new record. Just allocate
|
||||||
|
appropriate memory and copy it. */
|
||||||
|
struct dataset *newp
|
||||||
|
- = (struct dataset *) mempool_alloc (db, total + n);
|
||||||
|
+ = (struct dataset *) mempool_alloc (db, total + n,
|
||||||
|
+ IDX_result_data);
|
||||||
|
if (newp != NULL)
|
||||||
|
{
|
||||||
|
/* Adjust pointer into the memory block. */
|
||||||
|
--- glibc-20080412T0741/nscd/servicescache.c 25 Nov 2007 21:26:37 -0000 1.5
|
||||||
|
+++ glibc-20080412T0741-fedora/nscd/servicescache.c 30 Apr 2008 12:11:31 -0000 1.1.2.6
|
||||||
|
@@ -103,7 +103,8 @@ cache_addserv (struct database_dyn *db,
|
||||||
|
written = TEMP_FAILURE_RETRY (send (fd, ¬found, total,
|
||||||
|
MSG_NOSIGNAL));
|
||||||
|
|
||||||
|
- dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len);
|
||||||
|
+ dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len,
|
||||||
|
+ IDX_result_data);
|
||||||
|
/* If we cannot permanently store the result, so be it. */
|
||||||
|
if (dataset != NULL)
|
||||||
|
{
|
||||||
|
@@ -190,7 +191,8 @@ cache_addserv (struct database_dyn *db,
|
||||||
|
if (he == NULL)
|
||||||
|
{
|
||||||
|
dataset = (struct dataset *) mempool_alloc (db,
|
||||||
|
- total + req->key_len);
|
||||||
|
+ total + req->key_len,
|
||||||
|
+ IDX_result_data);
|
||||||
|
if (dataset == NULL)
|
||||||
|
++db->head->addfailed;
|
||||||
|
}
|
||||||
|
@@ -261,7 +263,8 @@ cache_addserv (struct database_dyn *db,
|
||||||
|
/* We have to create a new record. Just allocate
|
||||||
|
appropriate memory and copy it. */
|
||||||
|
struct dataset *newp
|
||||||
|
- = (struct dataset *) mempool_alloc (db, total + req->key_len);
|
||||||
|
+ = (struct dataset *) mempool_alloc (db, total + req->key_len,
|
||||||
|
+ IDX_result_data);
|
||||||
|
if (newp != NULL)
|
||||||
|
{
|
||||||
|
/* Adjust pointers into the memory block. */
|
||||||
--- glibc-20080412T0741/posix/Makefile 20 Nov 2007 00:41:16 -0000 1.203
|
--- glibc-20080412T0741/posix/Makefile 20 Nov 2007 00:41:16 -0000 1.203
|
||||||
+++ glibc-20080412T0741-fedora/posix/Makefile 12 Dec 2007 18:13:30 -0000 1.171.2.27
|
+++ glibc-20080412T0741-fedora/posix/Makefile 12 Dec 2007 18:13:30 -0000 1.171.2.27
|
||||||
@@ -301,11 +301,8 @@ $(inst_libexecdir)/getconf: $(inst_bindi
|
@@ -301,11 +301,8 @@ $(inst_libexecdir)/getconf: $(inst_bindi
|
||||||
@ -2299,6 +2786,15 @@
|
|||||||
@@ -1 +1 @@
|
@@ -1 +1 @@
|
||||||
-s_^\(RTLDLIST=\)\([^ ]*\)-ia64\(\.so\.[0-9.]*\)[ ]*$_\1"\2-ia64\3 \2\3"_
|
-s_^\(RTLDLIST=\)\([^ ]*\)-ia64\(\.so\.[0-9.]*\)[ ]*$_\1"\2-ia64\3 \2\3"_
|
||||||
+s_^\(RTLDLIST=\)\([^ ]*\)-ia64\(\.so\.[0-9.]*\)[ ]*$_\1"\2-ia64\3 /emul/ia32-linux\2\3"_
|
+s_^\(RTLDLIST=\)\([^ ]*\)-ia64\(\.so\.[0-9.]*\)[ ]*$_\1"\2-ia64\3 /emul/ia32-linux\2\3"_
|
||||||
|
--- glibc-20080412T0741/sysdeps/unix/sysv/linux/sparc/sparc64/semctl.c 6 Jul 2001 04:56:21 -0000 1.4
|
||||||
|
+++ glibc-20080412T0741-fedora/sysdeps/unix/sysv/linux/sparc/sparc64/semctl.c 30 Apr 2008 12:11:31 -0000 1.4.4.1
|
||||||
|
@@ -54,5 +54,5 @@ semctl (int semid, int semnum, int cmd,
|
||||||
|
va_end (ap);
|
||||||
|
|
||||||
|
return INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd,
|
||||||
|
- CHECK_SEMCTL (&arg, semid, cmd));
|
||||||
|
+ CHECK_SEMCTL (&arg, semid, cmd)->array);
|
||||||
|
}
|
||||||
--- glibc-20080412T0741/sysdeps/unix/sysv/linux/x86_64/clone.S 3 Dec 2006 23:12:36 -0000 1.7
|
--- glibc-20080412T0741/sysdeps/unix/sysv/linux/x86_64/clone.S 3 Dec 2006 23:12:36 -0000 1.7
|
||||||
+++ glibc-20080412T0741-fedora/sysdeps/unix/sysv/linux/x86_64/clone.S 14 Dec 2006 09:06:34 -0000 1.4.2.4
|
+++ glibc-20080412T0741-fedora/sysdeps/unix/sysv/linux/x86_64/clone.S 14 Dec 2006 09:06:34 -0000 1.4.2.4
|
||||||
@@ -89,9 +89,6 @@ L(pseudo_end):
|
@@ -89,9 +89,6 @@ L(pseudo_end):
|
||||||
@ -2319,3 +2815,105 @@
|
|||||||
|
|
||||||
cfi_startproc;
|
cfi_startproc;
|
||||||
PSEUDO_END (BP_SYM (__clone))
|
PSEUDO_END (BP_SYM (__clone))
|
||||||
|
--- libc/math/s_clog10l.c.jj 2005-12-14 11:20:38.000000000 +0100
|
||||||
|
+++ libc/math/s_clog10l.c 2008-05-05 10:11:11.000000000 +0200
|
||||||
|
@@ -34,7 +34,15 @@ __clog10l (__complex__ long double x)
|
||||||
|
if (rcls == FP_ZERO && icls == FP_ZERO)
|
||||||
|
{
|
||||||
|
/* Real and imaginary part are 0.0. */
|
||||||
|
+#ifdef __powerpc64__
|
||||||
|
+ long double t = 0.0;
|
||||||
|
+ asm ("" : "+f" (t));
|
||||||
|
+ if (signbit (__real__ x))
|
||||||
|
+ t = M_PIl;
|
||||||
|
+ __imag__ result = t;
|
||||||
|
+#else
|
||||||
|
__imag__ result = signbit (__real__ x) ? M_PIl : 0.0;
|
||||||
|
+#endif
|
||||||
|
__imag__ result = __copysignl (__imag__ result, __imag__ x);
|
||||||
|
/* Yes, the following line raises an exception. */
|
||||||
|
__real__ result = -1.0 / fabsl (__real__ x);
|
||||||
|
--- libc/math/s_catanhl.c.jj 2005-12-14 11:16:38.000000000 +0100
|
||||||
|
+++ libc/math/s_catanhl.c 2008-05-05 10:22:57.000000000 +0200
|
||||||
|
@@ -35,14 +35,29 @@ __catanhl (__complex__ long double x)
|
||||||
|
{
|
||||||
|
if (icls == FP_INFINITE)
|
||||||
|
{
|
||||||
|
+#ifdef __powerpc64__
|
||||||
|
+ long double t = M_PI_2l;
|
||||||
|
+ asm ("" : "+f" (t));
|
||||||
|
+ __real__ res = __copysignl (0.0, __real__ x);
|
||||||
|
+ __imag__ res = __copysignl (t, __imag__ x);
|
||||||
|
+#else
|
||||||
|
__real__ res = __copysignl (0.0, __real__ x);
|
||||||
|
__imag__ res = __copysignl (M_PI_2l, __imag__ x);
|
||||||
|
+#endif
|
||||||
|
}
|
||||||
|
else if (rcls == FP_INFINITE || rcls == FP_ZERO)
|
||||||
|
{
|
||||||
|
__real__ res = __copysignl (0.0, __real__ x);
|
||||||
|
if (icls >= FP_ZERO)
|
||||||
|
+#ifdef __powerpc64__
|
||||||
|
+ {
|
||||||
|
+ long double t = M_PI_2l;
|
||||||
|
+ asm ("" : "+f" (t));
|
||||||
|
+ __imag__ res = __copysignl (t, __imag__ x);
|
||||||
|
+ }
|
||||||
|
+#else
|
||||||
|
__imag__ res = __copysignl (M_PI_2l, __imag__ x);
|
||||||
|
+#endif
|
||||||
|
else
|
||||||
|
__imag__ res = __nanl ("");
|
||||||
|
}
|
||||||
|
--- libc/math/s_cacoshl.c.jj 2006-08-03 22:35:41.000000000 +0200
|
||||||
|
+++ libc/math/s_cacoshl.c 2008-05-05 10:08:57.000000000 +0200
|
||||||
|
@@ -48,8 +48,18 @@ __cacoshl (__complex__ long double x)
|
||||||
|
__real__ res = HUGE_VALL;
|
||||||
|
|
||||||
|
if (icls >= FP_ZERO)
|
||||||
|
+#ifdef __powerpc64__
|
||||||
|
+ {
|
||||||
|
+ long double t = 0.0;
|
||||||
|
+ asm ("" : "+f" (t));
|
||||||
|
+ if (signbit (__real__ x))
|
||||||
|
+ t = M_PIl;
|
||||||
|
+ __imag__ res = __copysignl (t, __imag__ x);
|
||||||
|
+ }
|
||||||
|
+#else
|
||||||
|
__imag__ res = __copysignl (signbit (__real__ x) ? M_PIl : 0.0,
|
||||||
|
__imag__ x);
|
||||||
|
+#endif
|
||||||
|
else
|
||||||
|
__imag__ res = __nanl ("");
|
||||||
|
}
|
||||||
|
--- libc/math/s_clogl.c.jj 2005-12-14 11:21:13.000000000 +0100
|
||||||
|
+++ libc/math/s_clogl.c 2008-05-05 09:56:42.000000000 +0200
|
||||||
|
@@ -34,7 +34,15 @@ __clogl (__complex__ long double x)
|
||||||
|
if (rcls == FP_ZERO && icls == FP_ZERO)
|
||||||
|
{
|
||||||
|
/* Real and imaginary part are 0.0. */
|
||||||
|
+#ifdef __powerpc64__
|
||||||
|
+ long double t = 0.0;
|
||||||
|
+ asm ("" : "+f" (t));
|
||||||
|
+ if (signbit (__real__ x))
|
||||||
|
+ t = M_PIl;
|
||||||
|
+ __imag__ result = t;
|
||||||
|
+#else
|
||||||
|
__imag__ result = signbit (__real__ x) ? M_PIl : 0.0;
|
||||||
|
+#endif
|
||||||
|
__imag__ result = __copysignl (__imag__ result, __imag__ x);
|
||||||
|
/* Yes, the following line raises an exception. */
|
||||||
|
__real__ result = -1.0 / fabsl (__real__ x);
|
||||||
|
--- libc/fedora/glibc_post_upgrade.c.jj 2008-04-10 21:21:05.000000000 +0200
|
||||||
|
+++ libc/fedora/glibc_post_upgrade.c 2008-05-05 10:39:24.000000000 +0200
|
||||||
|
@@ -170,8 +170,8 @@ main (void)
|
||||||
|
/* Check if telinit is available and either SysVInit fifo,
|
||||||
|
or upstart telinit. */
|
||||||
|
if (access ("/sbin/telinit", X_OK)
|
||||||
|
- || (access ("/dev/initctl", F_OK)
|
||||||
|
- && access ("/sbin/initctl", X_OK)))
|
||||||
|
+ || ((!!access ("/dev/initctl", F_OK))
|
||||||
|
+ ^ !access ("/sbin/initctl", X_OK)))
|
||||||
|
_exit (0);
|
||||||
|
/* Check if we are not inside of some chroot, because we'd just
|
||||||
|
timeout and leave /etc/initrunlvl. */
|
||||||
|
7089
glibc-lt-l10n.patch
Normal file
7089
glibc-lt-l10n.patch
Normal file
File diff suppressed because it is too large
Load Diff
171
glibc-nscd-inotify-fix.patch
Normal file
171
glibc-nscd-inotify-fix.patch
Normal file
@ -0,0 +1,171 @@
|
|||||||
|
2008-07-12 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* nscd/connections.c (main_loop_poll): Fix handling of read errors
|
||||||
|
from inotify.
|
||||||
|
(main_loop_epoll): Likewise.
|
||||||
|
|
||||||
|
--- libc/nscd/connections.c 3 Jul 2008 12:21:15 -0000 1.55.2.42
|
||||||
|
+++ libc/nscd/connections.c 16 Jul 2008 09:47:15 -0000
|
||||||
|
@@ -1806,42 +1806,64 @@ main_loop_poll (void)
|
||||||
|
|
||||||
|
size_t first = 1;
|
||||||
|
#ifdef HAVE_INOTIFY
|
||||||
|
- if (conns[1].fd == inotify_fd)
|
||||||
|
+ if (inotify_fd != -1 && conns[1].fd == inotify_fd)
|
||||||
|
{
|
||||||
|
if (conns[1].revents != 0)
|
||||||
|
{
|
||||||
|
- bool done[lastdb] = { false, };
|
||||||
|
+ bool to_clear[lastdb] = { false, };
|
||||||
|
union
|
||||||
|
{
|
||||||
|
struct inotify_event i;
|
||||||
|
char buf[100];
|
||||||
|
} inev;
|
||||||
|
|
||||||
|
- while (TEMP_FAILURE_RETRY (read (inotify_fd, &inev,
|
||||||
|
- sizeof (inev)))
|
||||||
|
- >= (ssize_t) sizeof (struct inotify_event))
|
||||||
|
+ while (1)
|
||||||
|
{
|
||||||
|
+ ssize_t nb = TEMP_FAILURE_RETRY (read (inotify_fd, &inev,
|
||||||
|
+ sizeof (inev)));
|
||||||
|
+ if (nb < (ssize_t) sizeof (struct inotify_event))
|
||||||
|
+ {
|
||||||
|
+ if (nb == -1)
|
||||||
|
+ {
|
||||||
|
+ /* Something went wrong when reading the inotify
|
||||||
|
+ data. Better disable inotify. */
|
||||||
|
+ conns[1].fd = -1;
|
||||||
|
+ firstfree = 1;
|
||||||
|
+ if (nused == 2)
|
||||||
|
+ nused = 1;
|
||||||
|
+ close (inotify_fd);
|
||||||
|
+ inotify_fd = -1;
|
||||||
|
+ dbg_log (_("disabled inotify after read error"));
|
||||||
|
+ }
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
/* Check which of the files changed. */
|
||||||
|
for (size_t dbcnt = 0; dbcnt < lastdb; ++dbcnt)
|
||||||
|
- if (!done[dbcnt]
|
||||||
|
- && (inev.i.wd == dbs[dbcnt].inotify_descr
|
||||||
|
- || (dbcnt == hstdb
|
||||||
|
- && inev.i.wd == resolv_conf_descr)))
|
||||||
|
+ if (inev.i.wd == dbs[dbcnt].inotify_descr)
|
||||||
|
{
|
||||||
|
- if (dbcnt == hstdb
|
||||||
|
- && inev.i.wd == resolv_conf_descr)
|
||||||
|
- res_init ();
|
||||||
|
-
|
||||||
|
- pthread_mutex_lock (&dbs[dbcnt].prune_lock);
|
||||||
|
- dbs[dbcnt].clear_cache = 1;
|
||||||
|
- pthread_mutex_unlock (&dbs[dbcnt].prune_lock);
|
||||||
|
- pthread_cond_signal (&dbs[dbcnt].prune_cond);
|
||||||
|
-
|
||||||
|
- done[dbcnt] = true;
|
||||||
|
- break;
|
||||||
|
+ to_clear[dbcnt] = true;
|
||||||
|
+ goto next;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ if (inev.i.wd == resolv_conf_descr)
|
||||||
|
+ {
|
||||||
|
+ res_init ();
|
||||||
|
+ to_clear[hstdb] = true;
|
||||||
|
+ }
|
||||||
|
+ next:;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ /* Actually perform the cache clearing. */
|
||||||
|
+ for (size_t dbcnt = 0; dbcnt < lastdb; ++dbcnt)
|
||||||
|
+ if (to_clear[dbcnt])
|
||||||
|
+ {
|
||||||
|
+ pthread_mutex_lock (&dbs[dbcnt].prune_lock);
|
||||||
|
+ dbs[dbcnt].clear_cache = 1;
|
||||||
|
+ pthread_mutex_unlock (&dbs[dbcnt].prune_lock);
|
||||||
|
+ pthread_cond_signal (&dbs[dbcnt].prune_cond);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
--n;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -1966,27 +1988,57 @@ main_loop_epoll (int efd)
|
||||||
|
#ifdef HAVE_INOTIFY
|
||||||
|
else if (revs[cnt].data.fd == inotify_fd)
|
||||||
|
{
|
||||||
|
+ bool to_clear[lastdb] = { false, };
|
||||||
|
union
|
||||||
|
{
|
||||||
|
struct inotify_event i;
|
||||||
|
char buf[100];
|
||||||
|
} inev;
|
||||||
|
|
||||||
|
- while (TEMP_FAILURE_RETRY (read (inotify_fd, &inev,
|
||||||
|
- sizeof (inev)))
|
||||||
|
- >= (ssize_t) sizeof (struct inotify_event))
|
||||||
|
+ while (1)
|
||||||
|
{
|
||||||
|
+ ssize_t nb = TEMP_FAILURE_RETRY (read (inotify_fd, &inev,
|
||||||
|
+ sizeof (inev)));
|
||||||
|
+ if (nb < (ssize_t) sizeof (struct inotify_event))
|
||||||
|
+ {
|
||||||
|
+ if (nb == -1)
|
||||||
|
+ {
|
||||||
|
+ /* Something went wrong when reading the inotify
|
||||||
|
+ data. Better disable inotify. */
|
||||||
|
+ (void) epoll_ctl (efd, EPOLL_CTL_DEL, inotify_fd,
|
||||||
|
+ NULL);
|
||||||
|
+ close (inotify_fd);
|
||||||
|
+ inotify_fd = -1;
|
||||||
|
+ dbg_log (_("disabled inotify after read error"));
|
||||||
|
+ }
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
/* Check which of the files changed. */
|
||||||
|
for (size_t dbcnt = 0; dbcnt < lastdb; ++dbcnt)
|
||||||
|
if (inev.i.wd == dbs[dbcnt].inotify_descr)
|
||||||
|
{
|
||||||
|
- pthread_mutex_trylock (&dbs[dbcnt].prune_lock);
|
||||||
|
- dbs[dbcnt].clear_cache = 1;
|
||||||
|
- pthread_mutex_unlock (&dbs[dbcnt].prune_lock);
|
||||||
|
- pthread_cond_signal (&dbs[dbcnt].prune_cond);
|
||||||
|
- break;
|
||||||
|
+ to_clear[dbcnt] = true;
|
||||||
|
+ goto next;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ if (inev.i.wd == resolv_conf_descr)
|
||||||
|
+ {
|
||||||
|
+ res_init ();
|
||||||
|
+ to_clear[hstdb] = true;
|
||||||
|
+ }
|
||||||
|
+ next:;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ /* Actually perform the cache clearing. */
|
||||||
|
+ for (size_t dbcnt = 0; dbcnt < lastdb; ++dbcnt)
|
||||||
|
+ if (to_clear[dbcnt])
|
||||||
|
+ {
|
||||||
|
+ pthread_mutex_lock (&dbs[dbcnt].prune_lock);
|
||||||
|
+ dbs[dbcnt].clear_cache = 1;
|
||||||
|
+ pthread_mutex_unlock (&dbs[dbcnt].prune_lock);
|
||||||
|
+ pthread_cond_signal (&dbs[dbcnt].prune_cond);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
else
|
||||||
|
@@ -2010,8 +2062,10 @@ main_loop_epoll (int efd)
|
||||||
|
/* Now look for descriptors for accepted connections which have
|
||||||
|
no reply in too long of a time. */
|
||||||
|
time_t laststart = now - ACCEPT_TIMEOUT;
|
||||||
|
+ assert (starttime[sock] == 0);
|
||||||
|
+ assert (inotify_fd == -1 || starttime[inotify_fd] == 0);
|
||||||
|
for (int cnt = highest; cnt > STDERR_FILENO; --cnt)
|
||||||
|
- if (cnt != sock && starttime[cnt] != 0 && starttime[cnt] < laststart)
|
||||||
|
+ if (starttime[cnt] != 0 && starttime[cnt] < laststart)
|
||||||
|
{
|
||||||
|
/* We are waiting for this one for too long. Close it. */
|
||||||
|
(void) epoll_ctl (efd, EPOLL_CTL_DEL, cnt, NULL);
|
1152
glibc-nscd.patch
Normal file
1152
glibc-nscd.patch
Normal file
File diff suppressed because it is too large
Load Diff
147
glibc-res-hconf-init.patch
Normal file
147
glibc-res-hconf-init.patch
Normal file
@ -0,0 +1,147 @@
|
|||||||
|
2008-06-13 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* sysdeps/posix/getaddrinfo.c: Move _res_hconf_init call to a
|
||||||
|
better place so it is not called when nscd is used.
|
||||||
|
|
||||||
|
2008-05-14 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* sysdeps/posix/getaddrinfo.c (getaddrinfo): Call _res_hconf_init
|
||||||
|
if necessary.
|
||||||
|
* posix/tst-rfc3484.c: Add dummy definition of _res_hconf_init.
|
||||||
|
* posix/tst-rfc3484-2.c: Likewise.
|
||||||
|
* posix/tst-rfc3484-3.c: Likewise.
|
||||||
|
|
||||||
|
--- libc/sysdeps/posix/getaddrinfo.c 10 May 2008 23:27:32 -0000 1.126
|
||||||
|
+++ libc/sysdeps/posix/getaddrinfo.c 14 May 2008 22:46:55 -0000 1.131
|
||||||
|
@@ -61,6 +61,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
|
||||||
|
#include <not-cancel.h>
|
||||||
|
#include <nscd/nscd-client.h>
|
||||||
|
#include <nscd/nscd_proto.h>
|
||||||
|
+#include <resolv/res_hconf.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBIDN
|
||||||
|
extern int __idna_to_ascii_lz (const char *input, char **output, int flags);
|
||||||
|
@@ -684,6 +684,9 @@ gaih_inet (const char *name, const struc
|
||||||
|
"dns [!UNAVAIL=return] files",
|
||||||
|
&nip);
|
||||||
|
|
||||||
|
+ /* Initialize configurations. */
|
||||||
|
+ if (__builtin_expect (!_res_hconf.initialized, 0))
|
||||||
|
+ _res_hconf_init ();
|
||||||
|
if (__res_maybe_init (&_res, 0) == -1)
|
||||||
|
no_more = 1;
|
||||||
|
|
||||||
|
--- libc/posix/tst-rfc3484-2.c 10 Jan 2008 20:00:37 -0000 1.11
|
||||||
|
+++ libc/posix/tst-rfc3484-2.c 15 May 2008 03:06:05 -0000 1.12
|
||||||
|
@@ -18,24 +18,35 @@ __check_pf (bool *p1, bool *p2, struct i
|
||||||
|
*in6ai = NULL;
|
||||||
|
*in6ailen = 0;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
void
|
||||||
|
attribute_hidden
|
||||||
|
__check_native (uint32_t a1_index, int *a1_native,
|
||||||
|
uint32_t a2_index, int *a2_native)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
+
|
||||||
|
int
|
||||||
|
+attribute_hidden
|
||||||
|
__idna_to_ascii_lz (const char *input, char **output, int flags)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
int
|
||||||
|
+attribute_hidden
|
||||||
|
__idna_to_unicode_lzlz (const char *input, char **output, int flags)
|
||||||
|
{
|
||||||
|
*output = NULL;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
+void
|
||||||
|
+attribute_hidden
|
||||||
|
+_res_hconf_init (void)
|
||||||
|
+{
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
#include "../sysdeps/posix/getaddrinfo.c"
|
||||||
|
|
||||||
|
service_user *__nss_hosts_database attribute_hidden;
|
||||||
|
--- libc/posix/tst-rfc3484-3.c 10 Jan 2008 20:00:37 -0000 1.2
|
||||||
|
+++ libc/posix/tst-rfc3484-3.c 15 May 2008 03:06:05 -0000 1.3
|
||||||
|
@@ -18,24 +18,35 @@ __check_pf (bool *p1, bool *p2, struct i
|
||||||
|
*in6ai = NULL;
|
||||||
|
*in6ailen = 0;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
void
|
||||||
|
attribute_hidden
|
||||||
|
__check_native (uint32_t a1_index, int *a1_native,
|
||||||
|
uint32_t a2_index, int *a2_native)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
+
|
||||||
|
int
|
||||||
|
+attribute_hidden
|
||||||
|
__idna_to_ascii_lz (const char *input, char **output, int flags)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
int
|
||||||
|
+attribute_hidden
|
||||||
|
__idna_to_unicode_lzlz (const char *input, char **output, int flags)
|
||||||
|
{
|
||||||
|
*output = NULL;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
+void
|
||||||
|
+attribute_hidden
|
||||||
|
+_res_hconf_init (void)
|
||||||
|
+{
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
#include "../sysdeps/posix/getaddrinfo.c"
|
||||||
|
|
||||||
|
service_user *__nss_hosts_database attribute_hidden;
|
||||||
|
--- libc/posix/tst-rfc3484.c 10 Jan 2008 20:00:37 -0000 1.11
|
||||||
|
+++ libc/posix/tst-rfc3484.c 15 May 2008 03:06:05 -0000 1.12
|
||||||
|
@@ -18,24 +18,35 @@ __check_pf (bool *p1, bool *p2, struct i
|
||||||
|
*in6ai = NULL;
|
||||||
|
*in6ailen = 0;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
void
|
||||||
|
attribute_hidden
|
||||||
|
__check_native (uint32_t a1_index, int *a1_native,
|
||||||
|
uint32_t a2_index, int *a2_native)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
+
|
||||||
|
int
|
||||||
|
+attribute_hidden
|
||||||
|
__idna_to_ascii_lz (const char *input, char **output, int flags)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
int
|
||||||
|
+attribute_hidden
|
||||||
|
__idna_to_unicode_lzlz (const char *input, char **output, int flags)
|
||||||
|
{
|
||||||
|
*output = NULL;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
+void
|
||||||
|
+attribute_hidden
|
||||||
|
+_res_hconf_init (void)
|
||||||
|
+{
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
#include "../sysdeps/posix/getaddrinfo.c"
|
||||||
|
|
||||||
|
service_user *__nss_hosts_database attribute_hidden;
|
41
glibc-rh446406.patch
Normal file
41
glibc-rh446406.patch
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
2008-06-05 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
* misc/regexp.h (compile): Use __REPB_PREFIX macro.
|
||||||
|
Avoid segfault if first GETC returns eof/'\0'/'\n'.
|
||||||
|
|
||||||
|
--- libc/misc/regexp.h 19 May 2004 16:52:44 -0000 1.12
|
||||||
|
+++ libc/misc/regexp.h 6 Jun 2008 19:23:39 -0000 1.13
|
||||||
|
@@ -129,8 +130,9 @@ compile (char *__restrict instring, char
|
||||||
|
__expr_ptr = (regex_t *) expbuf;
|
||||||
|
/* The remaining space in the buffer can be used for the compiled
|
||||||
|
pattern. */
|
||||||
|
- __expr_ptr->buffer = expbuf + sizeof (regex_t);
|
||||||
|
- __expr_ptr->allocated = endbuf - (char *) __expr_ptr->buffer;
|
||||||
|
+ __expr_ptr->__REPB_PREFIX (buffer) = expbuf + sizeof (regex_t);
|
||||||
|
+ __expr_ptr->__REPB_PREFIX (allocated)
|
||||||
|
+ = endbuf - (char *) __expr_ptr->__REPB_PREFIX (buffer);
|
||||||
|
|
||||||
|
while ((__ch = (GETC ())) != eof)
|
||||||
|
{
|
||||||
|
@@ -162,7 +164,10 @@ compile (char *__restrict instring, char
|
||||||
|
}
|
||||||
|
__input_buffer[__current_size++] = __ch;
|
||||||
|
}
|
||||||
|
- __input_buffer[__current_size++] = '\0';
|
||||||
|
+ if (__current_size)
|
||||||
|
+ __input_buffer[__current_size++] = '\0';
|
||||||
|
+ else
|
||||||
|
+ __input_buffer = "";
|
||||||
|
|
||||||
|
/* Now compile the pattern. */
|
||||||
|
__error = regcomp (__expr_ptr, __input_buffer, REG_NEWLINE);
|
||||||
|
@@ -198,7 +203,8 @@ compile (char *__restrict instring, char
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Everything is ok. */
|
||||||
|
- RETURN ((char *) (__expr_ptr->buffer + __expr_ptr->used));
|
||||||
|
+ RETURN ((char *) (__expr_ptr->__REPB_PREFIX (buffer)
|
||||||
|
+ + __expr_ptr->__REPB_PREFIX (used)));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
17
glibc-rh449358.patch
Normal file
17
glibc-rh449358.patch
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
2008-06-03 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
* nscd/nscd_getserv_r.c (__nscd_getservbyport_r): Pass cp
|
||||||
|
instead of portstr to nscd_getserv_r. Patch by
|
||||||
|
Roman Kagan <rkagan@mail.ru>.
|
||||||
|
|
||||||
|
--- libc/nscd/nscd_getserv_r.c 13 Oct 2007 23:04:28 -0000 1.5
|
||||||
|
+++ libc/nscd/nscd_getserv_r.c 3 Jun 2008 10:22:52 -0000 1.6
|
||||||
|
@@ -53,7 +53,7 @@ __nscd_getservbyport_r (int port, const
|
||||||
|
portstr[sizeof (portstr) - 1] = '\0';
|
||||||
|
char *cp = _itoa_word (port, portstr + sizeof (portstr) - 1, 10, 0);
|
||||||
|
|
||||||
|
- return nscd_getserv_r (portstr, portstr + sizeof (portstr) - cp, proto,
|
||||||
|
+ return nscd_getserv_r (cp, portstr + sizeof (portstr) - cp, proto,
|
||||||
|
GETSERVBYPORT, result_buf, buf, buflen, result);
|
||||||
|
}
|
||||||
|
|
82
glibc-rh450790.patch
Normal file
82
glibc-rh450790.patch
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
2008-06-12 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
* sysdeps/powerpc/powerpc64/fpu/s_llround.S (__llround): Avoid using
|
||||||
|
cr[34] registers.
|
||||||
|
* sysdeps/powerpc/powerpc64/fpu/s_llroundf.S (__llroundf): Likewise.
|
||||||
|
* sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S (__llround):
|
||||||
|
Likewise.
|
||||||
|
* sysdeps/powerpc/powerpc32/fpu/s_lround.S (__lround): Avoid using cr3
|
||||||
|
register.
|
||||||
|
|
||||||
|
--- libc/sysdeps/powerpc/powerpc32/fpu/s_lround.S 11 Apr 2008 19:30:46 -0000 1.8
|
||||||
|
+++ libc/sysdeps/powerpc/powerpc32/fpu/s_lround.S 13 Jun 2008 01:18:11 -0000 1.9
|
||||||
|
@@ -65,10 +65,10 @@ ENTRY (__lround)
|
||||||
|
fabs fp2, fp1 /* Get the absolute value of x. */
|
||||||
|
fsub fp12,fp10,fp10 /* Compute 0.0. */
|
||||||
|
fcmpu cr6, fp2, fp10 /* if |x| < 0.5 */
|
||||||
|
- fcmpu cr3, fp1, fp12 /* x is negative? x < 0.0 */
|
||||||
|
+ fcmpu cr7, fp1, fp12 /* x is negative? x < 0.0 */
|
||||||
|
blt- cr6,.Lretzero
|
||||||
|
fadd fp3,fp2,fp10 /* |x|+=0.5 bias to prepare to round. */
|
||||||
|
- bge cr3,.Lconvert /* x is positive so don't negate x. */
|
||||||
|
+ bge cr7,.Lconvert /* x is positive so don't negate x. */
|
||||||
|
fnabs fp3,fp3 /* -(|x|+=0.5) */
|
||||||
|
.Lconvert:
|
||||||
|
fctiwz fp4,fp3 /* Convert to Integer word lround toward 0. */
|
||||||
|
--- libc/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S 11 Apr 2008 19:31:08 -0000 1.2
|
||||||
|
+++ libc/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S 13 Jun 2008 01:18:11 -0000 1.3
|
||||||
|
@@ -75,12 +75,12 @@ ENTRY (__llround)
|
||||||
|
fabs fp2,fp1 /* Get the absolute value of x. */
|
||||||
|
fsub fp12,fp10,fp10 /* Compute 0.0 into fpr12. */
|
||||||
|
fcmpu cr6,fp2,fp10 /* if |x| < 0.5 */
|
||||||
|
- fcmpu cr4,fp2,fp9 /* if |x| >= 2^52 */
|
||||||
|
- fcmpu cr3,fp1,fp12 /* x is negative? x < 0.0 */
|
||||||
|
+ fcmpu cr7,fp2,fp9 /* if |x| >= 2^52 */
|
||||||
|
+ fcmpu cr1,fp1,fp12 /* x is negative? x < 0.0 */
|
||||||
|
blt- cr6,.Lretzero /* 0.5 > x < -0.5 so just return 0. */
|
||||||
|
- bge- cr4,.Lnobias /* 2^52 > x < -2^52 just convert with no bias. */
|
||||||
|
+ bge- cr7,.Lnobias /* 2^52 > x < -2^52 just convert with no bias. */
|
||||||
|
fadd fp3,fp2,fp10 /* |x|+=0.5 bias to prepare to round. */
|
||||||
|
- bge cr3,.Lconvert /* x is positive so don't negate x. */
|
||||||
|
+ bge cr1,.Lconvert /* x is positive so don't negate x. */
|
||||||
|
fnabs fp3,fp3 /* -(|x|+=0.5) */
|
||||||
|
.Lconvert:
|
||||||
|
fctidz fp4,fp3 /* Convert to Integer double word round toward 0. */
|
||||||
|
--- libc/sysdeps/powerpc/powerpc64/fpu/s_llround.S 11 Apr 2008 19:31:51 -0000 1.4
|
||||||
|
+++ libc/sysdeps/powerpc/powerpc64/fpu/s_llround.S 13 Jun 2008 01:18:11 -0000 1.5
|
||||||
|
@@ -52,12 +52,12 @@ ENTRY (__llround)
|
||||||
|
fabs fp2,fp1 /* Get the absolute value of x. */
|
||||||
|
fsub fp12,fp10,fp10 /* Compute 0.0 into fp12. */
|
||||||
|
fcmpu cr6,fp2,fp10 /* if |x| < 0.5 */
|
||||||
|
- fcmpu cr4,fp2,fp9 /* if |x| >= 2^52 */
|
||||||
|
- fcmpu cr3,fp1,fp12 /* x is negative? x < 0.0 */
|
||||||
|
+ fcmpu cr7,fp2,fp9 /* if |x| >= 2^52 */
|
||||||
|
+ fcmpu cr1,fp1,fp12 /* x is negative? x < 0.0 */
|
||||||
|
blt- cr6,.Lretzero /* 0.5 > x < -0.5 so just return 0. */
|
||||||
|
- bge- cr4,.Lnobias /* 2^52 > x < -2^52 just convert with no bias. */
|
||||||
|
+ bge- cr7,.Lnobias /* 2^52 > x < -2^52 just convert with no bias. */
|
||||||
|
fadd fp3,fp2,fp10 /* |x|+=0.5 bias to prepare to round. */
|
||||||
|
- bge cr3,.Lconvert /* x is positive so don't negate x. */
|
||||||
|
+ bge cr1,.Lconvert /* x is positive so don't negate x. */
|
||||||
|
fnabs fp3,fp3 /* -(|x|+=0.5) */
|
||||||
|
.Lconvert:
|
||||||
|
fctidz fp4,fp3 /* Convert to Integer double word round toward 0. */
|
||||||
|
--- libc/sysdeps/powerpc/powerpc64/fpu/s_llroundf.S 11 Apr 2008 19:31:51 -0000 1.4
|
||||||
|
+++ libc/sysdeps/powerpc/powerpc64/fpu/s_llroundf.S 13 Jun 2008 01:18:11 -0000 1.5
|
||||||
|
@@ -51,12 +51,12 @@ ENTRY (__llroundf)
|
||||||
|
fabs fp2,fp1 /* Get the absolute value of x. */
|
||||||
|
fsub fp12,fp10,fp10 /* Compute 0.0 into fp12. */
|
||||||
|
fcmpu cr6,fp2,fp10 /* if |x| < 0.5 */
|
||||||
|
- fcmpu cr4,fp2,fp9 /* if |x| >= 2^23 */
|
||||||
|
- fcmpu cr3,fp1,fp12 /* x is negative? x < 0.0 */
|
||||||
|
+ fcmpu cr7,fp2,fp9 /* if |x| >= 2^23 */
|
||||||
|
+ fcmpu cr1,fp1,fp12 /* x is negative? x < 0.0 */
|
||||||
|
blt- cr6,.Lretzero /* 0.5 > x < -0.5 so just return 0. */
|
||||||
|
- bge- cr4,.Lnobias /* 2^23 > x < -2^23 just convert with no bias. */
|
||||||
|
+ bge- cr7,.Lnobias /* 2^23 > x < -2^23 just convert with no bias. */
|
||||||
|
fadd fp3,fp2,fp10 /* |x|+=0.5 bias to prepare to round. */
|
||||||
|
- bge cr3,.Lconvert /* x is positive so don't negate x. */
|
||||||
|
+ bge cr1,.Lconvert /* x is positive so don't negate x. */
|
||||||
|
fnabs fp3,fp3 /* -(|x|+=0.5) */
|
||||||
|
.Lconvert:
|
||||||
|
fctidz fp4,fp3 /* Convert to Integer double word round toward 0. */
|
30
glibc-rh455360.patch
Normal file
30
glibc-rh455360.patch
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
2008-07-15 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* stdio-common/vfprintf.c (_IO_helper_overflow): In case _IO_sputn
|
||||||
|
doesn't manage to write anything, fail.
|
||||||
|
|
||||||
|
--- libc/stdio-common/vfprintf.c 8 Apr 2008 07:59:50 -0000 1.128.2.13
|
||||||
|
+++ libc/stdio-common/vfprintf.c 16 Jul 2008 09:47:15 -0000
|
||||||
|
@@ -2080,6 +2080,11 @@ _IO_helper_overflow (_IO_FILE *s, int c)
|
||||||
|
{
|
||||||
|
_IO_size_t written = _IO_sputn (target, s->_wide_data->_IO_write_base,
|
||||||
|
used);
|
||||||
|
+ if (written == 0 || written == WEOF)
|
||||||
|
+ return WEOF;
|
||||||
|
+ __wmemmove (s->_wide_data->_IO_write_base,
|
||||||
|
+ s->_wide_data->_IO_write_base + written,
|
||||||
|
+ used - written);
|
||||||
|
s->_wide_data->_IO_write_ptr -= written;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
@@ -2087,6 +2092,10 @@ _IO_helper_overflow (_IO_FILE *s, int c)
|
||||||
|
if (used)
|
||||||
|
{
|
||||||
|
_IO_size_t written = _IO_sputn (target, s->_IO_write_base, used);
|
||||||
|
+ if (written == 0 || written == EOF)
|
||||||
|
+ return EOF;
|
||||||
|
+ memmove (s->_IO_write_base, s->_IO_write_base + written,
|
||||||
|
+ used - written);
|
||||||
|
s->_IO_write_ptr -= written;
|
||||||
|
}
|
||||||
|
#endif
|
195
glibc-rwlock-pshared.patch
Normal file
195
glibc-rwlock-pshared.patch
Normal file
@ -0,0 +1,195 @@
|
|||||||
|
2008-05-10 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Access
|
||||||
|
__pshared correctly.
|
||||||
|
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
|
||||||
|
Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
|
||||||
|
Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
|
||||||
|
Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
|
||||||
|
Likewise.
|
||||||
|
Reported by Clemens Kolbitsch <clemens.kol@gmx.at>.
|
||||||
|
|
||||||
|
--- libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S 14 Aug 2007 02:24:49 -0000 1.15
|
||||||
|
+++ libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S 11 May 2008 05:40:33 -0000 1.16
|
||||||
|
@@ -122,7 +122,7 @@ __pthread_rwlock_rdlock:
|
||||||
|
#else
|
||||||
|
leal MUTEX(%ebx), %edx
|
||||||
|
#endif
|
||||||
|
- movl PSHARED(%ebx), %ecx
|
||||||
|
+ movzbl PSHARED(%ebx), %ecx
|
||||||
|
call __lll_lock_wait
|
||||||
|
jmp 2b
|
||||||
|
|
||||||
|
@@ -138,7 +138,7 @@ __pthread_rwlock_rdlock:
|
||||||
|
#else
|
||||||
|
leal MUTEX(%ebx), %eax
|
||||||
|
#endif
|
||||||
|
- movl PSHARED(%ebx), %ecx
|
||||||
|
+ movzbl PSHARED(%ebx), %ecx
|
||||||
|
call __lll_unlock_wake
|
||||||
|
jmp 7b
|
||||||
|
|
||||||
|
@@ -158,7 +158,7 @@ __pthread_rwlock_rdlock:
|
||||||
|
#else
|
||||||
|
leal MUTEX(%ebx), %eax
|
||||||
|
#endif
|
||||||
|
- movl PSHARED(%ebx), %ecx
|
||||||
|
+ movzbl PSHARED(%ebx), %ecx
|
||||||
|
call __lll_unlock_wake
|
||||||
|
jmp 11b
|
||||||
|
|
||||||
|
@@ -168,7 +168,7 @@ __pthread_rwlock_rdlock:
|
||||||
|
#else
|
||||||
|
leal MUTEX(%ebx), %edx
|
||||||
|
#endif
|
||||||
|
- movl PSHARED(%ebx), %ecx
|
||||||
|
+ movzbl PSHARED(%ebx), %ecx
|
||||||
|
call __lll_lock_wait
|
||||||
|
jmp 13b
|
||||||
|
.size __pthread_rwlock_rdlock,.-__pthread_rwlock_rdlock
|
||||||
|
--- libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S 14 Aug 2007 02:25:44 -0000 1.16
|
||||||
|
+++ libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S 11 May 2008 05:40:33 -0000 1.17
|
||||||
|
@@ -162,7 +162,7 @@ pthread_rwlock_timedrdlock:
|
||||||
|
#else
|
||||||
|
leal MUTEX(%ebp), %edx
|
||||||
|
#endif
|
||||||
|
- movl PSHARED(%ebp), %ecx
|
||||||
|
+ movzbl PSHARED(%ebp), %ecx
|
||||||
|
call __lll_lock_wait
|
||||||
|
jmp 2b
|
||||||
|
|
||||||
|
@@ -177,7 +177,7 @@ pthread_rwlock_timedrdlock:
|
||||||
|
#else
|
||||||
|
leal MUTEX(%ebp), %eax
|
||||||
|
#endif
|
||||||
|
- movl PSHARED(%ebp), %ecx
|
||||||
|
+ movzbl PSHARED(%ebp), %ecx
|
||||||
|
call __lll_unlock_wake
|
||||||
|
jmp 7b
|
||||||
|
|
||||||
|
@@ -197,7 +197,7 @@ pthread_rwlock_timedrdlock:
|
||||||
|
#else
|
||||||
|
leal MUTEX(%ebp), %eax
|
||||||
|
#endif
|
||||||
|
- movl PSHARED(%ebp), %ecx
|
||||||
|
+ movzbl PSHARED(%ebp), %ecx
|
||||||
|
call __lll_unlock_wake
|
||||||
|
jmp 11b
|
||||||
|
|
||||||
|
@@ -207,7 +207,7 @@ pthread_rwlock_timedrdlock:
|
||||||
|
#else
|
||||||
|
leal MUTEX(%ebp), %edx
|
||||||
|
#endif
|
||||||
|
- movl PSHARED(%ebp), %ecx
|
||||||
|
+ movzbl PSHARED(%ebp), %ecx
|
||||||
|
call __lll_lock_wait
|
||||||
|
jmp 13b
|
||||||
|
|
||||||
|
--- libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S 14 Aug 2007 02:24:58 -0000 1.17
|
||||||
|
+++ libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S 11 May 2008 05:40:33 -0000 1.18
|
||||||
|
@@ -160,7 +160,7 @@ pthread_rwlock_timedwrlock:
|
||||||
|
#else
|
||||||
|
leal MUTEX(%ebp), %edx
|
||||||
|
#endif
|
||||||
|
- movl PSHARED(%ebp), %ecx
|
||||||
|
+ movzbl PSHARED(%ebp), %ecx
|
||||||
|
call __lll_lock_wait
|
||||||
|
jmp 2b
|
||||||
|
|
||||||
|
@@ -175,7 +175,7 @@ pthread_rwlock_timedwrlock:
|
||||||
|
#else
|
||||||
|
leal MUTEX(%ebp), %eax
|
||||||
|
#endif
|
||||||
|
- movl PSHARED(%ebp), %ecx
|
||||||
|
+ movzbl PSHARED(%ebp), %ecx
|
||||||
|
call __lll_unlock_wake
|
||||||
|
jmp 7b
|
||||||
|
|
||||||
|
@@ -190,7 +190,7 @@ pthread_rwlock_timedwrlock:
|
||||||
|
#else
|
||||||
|
leal MUTEX(%ebp), %eax
|
||||||
|
#endif
|
||||||
|
- movl PSHARED(%ebp), %ecx
|
||||||
|
+ movzbl PSHARED(%ebp), %ecx
|
||||||
|
call __lll_unlock_wake
|
||||||
|
jmp 11b
|
||||||
|
|
||||||
|
@@ -200,7 +200,7 @@ pthread_rwlock_timedwrlock:
|
||||||
|
#else
|
||||||
|
leal MUTEX(%ebp), %edx
|
||||||
|
#endif
|
||||||
|
- movl PSHARED(%ebp), %ecx
|
||||||
|
+ movzbl PSHARED(%ebp), %ecx
|
||||||
|
call __lll_lock_wait
|
||||||
|
jmp 13b
|
||||||
|
|
||||||
|
--- libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S 14 Aug 2007 02:25:06 -0000 1.13
|
||||||
|
+++ libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S 11 May 2008 05:40:33 -0000 1.14
|
||||||
|
@@ -110,7 +110,7 @@ __pthread_rwlock_unlock:
|
||||||
|
#else
|
||||||
|
leal MUTEX(%edi), %edx
|
||||||
|
#endif
|
||||||
|
- movl PSHARED(%edi), %ecx
|
||||||
|
+ movzbl PSHARED(%edi), %ecx
|
||||||
|
call __lll_lock_wait
|
||||||
|
jmp 2b
|
||||||
|
|
||||||
|
@@ -120,7 +120,7 @@ __pthread_rwlock_unlock:
|
||||||
|
#else
|
||||||
|
leal MUTEX(%edi), %eax
|
||||||
|
#endif
|
||||||
|
- movl PSHARED(%edi), %ecx
|
||||||
|
+ movzbl PSHARED(%edi), %ecx
|
||||||
|
call __lll_unlock_wake
|
||||||
|
jmp 4b
|
||||||
|
|
||||||
|
@@ -130,7 +130,7 @@ __pthread_rwlock_unlock:
|
||||||
|
#else
|
||||||
|
leal MUTEX(%edi), %eax
|
||||||
|
#endif
|
||||||
|
- movl PSHARED(%edi), %ecx
|
||||||
|
+ movzbl PSHARED(%edi), %ecx
|
||||||
|
call __lll_unlock_wake
|
||||||
|
jmp 8b
|
||||||
|
|
||||||
|
--- libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S 14 Aug 2007 02:25:27 -0000 1.15
|
||||||
|
+++ libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S 11 May 2008 05:40:33 -0000 1.16
|
||||||
|
@@ -120,7 +120,7 @@ __pthread_rwlock_wrlock:
|
||||||
|
#else
|
||||||
|
leal MUTEX(%ebx), %edx
|
||||||
|
#endif
|
||||||
|
- movl PSHARED(%ebx), %ecx
|
||||||
|
+ movzbl PSHARED(%ebx), %ecx
|
||||||
|
call __lll_lock_wait
|
||||||
|
jmp 2b
|
||||||
|
|
||||||
|
@@ -135,7 +135,7 @@ __pthread_rwlock_wrlock:
|
||||||
|
#else
|
||||||
|
leal MUTEX(%ebx), %eax
|
||||||
|
#endif
|
||||||
|
- movl PSHARED(%ebx), %ecx
|
||||||
|
+ movzbl PSHARED(%ebx), %ecx
|
||||||
|
call __lll_unlock_wake
|
||||||
|
jmp 7b
|
||||||
|
|
||||||
|
@@ -149,7 +149,7 @@ __pthread_rwlock_wrlock:
|
||||||
|
#else
|
||||||
|
leal MUTEX(%ebx), %eax
|
||||||
|
#endif
|
||||||
|
- movl PSHARED(%ebx), %ecx
|
||||||
|
+ movzbl PSHARED(%ebx), %ecx
|
||||||
|
call __lll_unlock_wake
|
||||||
|
jmp 11b
|
||||||
|
|
||||||
|
@@ -159,7 +159,7 @@ __pthread_rwlock_wrlock:
|
||||||
|
#else
|
||||||
|
leal MUTEX(%ebx), %edx
|
||||||
|
#endif
|
||||||
|
- movl PSHARED(%ebx), %ecx
|
||||||
|
+ movzbl PSHARED(%ebx), %ecx
|
||||||
|
call __lll_lock_wait
|
||||||
|
jmp 13b
|
||||||
|
.size __pthread_rwlock_wrlock,.-__pthread_rwlock_wrlock
|
1003
glibc-sparc.patch
Normal file
1003
glibc-sparc.patch
Normal file
File diff suppressed because it is too large
Load Diff
12
glibc-sparcv9v-fix-async-unwind-tables.patch
Normal file
12
glibc-sparcv9v-fix-async-unwind-tables.patch
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
diff -up glibc-20080412T0741/elf/Makefile.BAD glibc-20080412T0741/elf/Makefile
|
||||||
|
--- glibc-20080412T0741/elf/Makefile.BAD 2008-05-26 20:09:30.000000000 -0500
|
||||||
|
+++ glibc-20080412T0741/elf/Makefile 2008-05-26 20:10:19.000000000 -0500
|
||||||
|
@@ -389,6 +389,8 @@ CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'
|
||||||
|
-D'SLIBDIR="$(slibdir)"' -DIS_IN_ldconfig=1
|
||||||
|
CFLAGS-dl-cache.c = $(SYSCONF-FLAGS)
|
||||||
|
CFLAGS-cache.c = $(SYSCONF-FLAGS)
|
||||||
|
+CFLAGS-soinit.c += -fno-asynchronous-unwind-tables
|
||||||
|
+CFLAGS-sofini.c += -fno-asynchronous-unwind-tables
|
||||||
|
|
||||||
|
CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),-DNOT_IN_libc=1 -DIS_IN_rtld=1)
|
||||||
|
|
75
glibc-sparcv9v-memset.patch
Normal file
75
glibc-sparcv9v-memset.patch
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
2008-10-09 Jakub Jelinek <jakub@redhat.com>,
|
||||||
|
David S. Miller <davem@davemloft.net>
|
||||||
|
|
||||||
|
* sysdeps/sparc/sparc64/sparcv9v/memcpy.S,
|
||||||
|
sysdeps/sparc/sparc64/sparcv9v/memset.S,
|
||||||
|
sysdeps/sparc/sparc64/sparcv9v2/memcpy.S: When not USE_BPR,
|
||||||
|
make sure any registers used with 64-bit 'branch-on-register'
|
||||||
|
instructions have their top 32-bits clear.
|
||||||
|
|
||||||
|
diff --git a/sysdeps/sparc/sparc64/sparcv9v/memcpy.S b/sysdeps/sparc/sparc64/sparcv9v/memcpy.S
|
||||||
|
index 05c837f..ad2b0f7 100644
|
||||||
|
--- a/sysdeps/sparc/sparc64/sparcv9v/memcpy.S
|
||||||
|
+++ b/sysdeps/sparc/sparc64/sparcv9v/memcpy.S
|
||||||
|
@@ -1,5 +1,5 @@
|
||||||
|
/* Copy SIZE bytes from SRC to DEST. For SUN4V Niagara.
|
||||||
|
- Copyright (C) 2006 Free Software Foundation, Inc.
|
||||||
|
+ Copyright (C) 2006, 2008 Free Software Foundation, Inc.
|
||||||
|
This file is part of the GNU C Library.
|
||||||
|
Contributed by David S. Miller (davem@davemloft.net)
|
||||||
|
|
||||||
|
@@ -61,6 +61,9 @@ END(bcopy)
|
||||||
|
|
||||||
|
.align 32
|
||||||
|
ENTRY(memcpy)
|
||||||
|
+#ifndef USE_BPR
|
||||||
|
+ srl %o2, 0, %o2
|
||||||
|
+#endif
|
||||||
|
100: /* %o0=dst, %o1=src, %o2=len */
|
||||||
|
mov %o0, %g5
|
||||||
|
cmp %o2, 0
|
||||||
|
diff --git a/sysdeps/sparc/sparc64/sparcv9v/memset.S b/sysdeps/sparc/sparc64/sparcv9v/memset.S
|
||||||
|
index ac0a50c..64817b8 100644
|
||||||
|
--- a/sysdeps/sparc/sparc64/sparcv9v/memset.S
|
||||||
|
+++ b/sysdeps/sparc/sparc64/sparcv9v/memset.S
|
||||||
|
@@ -1,5 +1,5 @@
|
||||||
|
/* Set a block of memory to some byte value. For SUN4V Niagara.
|
||||||
|
- Copyright (C) 2006 Free Software Foundation, Inc.
|
||||||
|
+ Copyright (C) 2006, 2008 Free Software Foundation, Inc.
|
||||||
|
This file is part of the GNU C Library.
|
||||||
|
Contributed by David S. Miller (davem@davemloft.net)
|
||||||
|
|
||||||
|
@@ -49,7 +49,11 @@ END(memset)
|
||||||
|
|
||||||
|
ENTRY(__bzero)
|
||||||
|
clr %o2
|
||||||
|
-1: brz,pn %o1, 90f
|
||||||
|
+1:
|
||||||
|
+#ifndef USE_BRP
|
||||||
|
+ srl %o1, 0, %o1
|
||||||
|
+#endif
|
||||||
|
+ brz,pn %o1, 90f
|
||||||
|
mov %o0, %o3
|
||||||
|
|
||||||
|
wr %g0, ASI_P, %asi
|
||||||
|
diff --git a/sysdeps/sparc/sparc64/sparcv9v2/memcpy.S b/sysdeps/sparc/sparc64/sparcv9v2/memcpy.S
|
||||||
|
index d94dd47..b261f46 100644
|
||||||
|
--- a/sysdeps/sparc/sparc64/sparcv9v2/memcpy.S
|
||||||
|
+++ b/sysdeps/sparc/sparc64/sparcv9v2/memcpy.S
|
||||||
|
@@ -1,5 +1,5 @@
|
||||||
|
/* Copy SIZE bytes from SRC to DEST. For SUN4V Niagara-2.
|
||||||
|
- Copyright (C) 2007 Free Software Foundation, Inc.
|
||||||
|
+ Copyright (C) 2007, 2008 Free Software Foundation, Inc.
|
||||||
|
This file is part of the GNU C Library.
|
||||||
|
Contributed by David S. Miller (davem@davemloft.net)
|
||||||
|
|
||||||
|
@@ -163,6 +163,9 @@ END(bcopy)
|
||||||
|
|
||||||
|
.align 32
|
||||||
|
ENTRY(memcpy)
|
||||||
|
+#ifndef USE_BPR
|
||||||
|
+ srl %o2, 0, %o2
|
||||||
|
+#endif
|
||||||
|
100: /* %o0=dst, %o1=src, %o2=len */
|
||||||
|
mov %o0, %g5
|
||||||
|
cmp %o2, 0
|
123
glibc-tls-getaddr.patch
Normal file
123
glibc-tls-getaddr.patch
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
2008-05-11 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* elf/dl-tls.c (__tls_get_addr): Optimize by moving slow path in
|
||||||
|
its own function. This reduces the frame setup costs and more.
|
||||||
|
|
||||||
|
--- libc/elf/dl-tls.c 8 Mar 2008 06:11:58 -0000 1.6
|
||||||
|
+++ libc/elf/dl-tls.c 12 May 2008 05:35:52 -0000 1.7
|
||||||
|
@@ -691,6 +691,61 @@ _dl_update_slotinfo (unsigned long int r
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
+static void *
|
||||||
|
+__attribute_noinline__
|
||||||
|
+tls_get_addr_tail (dtv_t *dtv, struct link_map *the_map, size_t module)
|
||||||
|
+{
|
||||||
|
+ /* The allocation was deferred. Do it now. */
|
||||||
|
+ if (the_map == NULL)
|
||||||
|
+ {
|
||||||
|
+ /* Find the link map for this module. */
|
||||||
|
+ size_t idx = module;
|
||||||
|
+ struct dtv_slotinfo_list *listp = GL(dl_tls_dtv_slotinfo_list);
|
||||||
|
+
|
||||||
|
+ while (idx >= listp->len)
|
||||||
|
+ {
|
||||||
|
+ idx -= listp->len;
|
||||||
|
+ listp = listp->next;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ the_map = listp->slotinfo[idx].map;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ again:
|
||||||
|
+ /* Make sure that, if a dlopen running in parallel forces the
|
||||||
|
+ variable into static storage, we'll wait until the address in the
|
||||||
|
+ static TLS block is set up, and use that. If we're undecided
|
||||||
|
+ yet, make sure we make the decision holding the lock as well. */
|
||||||
|
+ if (__builtin_expect (the_map->l_tls_offset
|
||||||
|
+ != FORCED_DYNAMIC_TLS_OFFSET, 0))
|
||||||
|
+ {
|
||||||
|
+ __rtld_lock_lock_recursive (GL(dl_load_lock));
|
||||||
|
+ if (__builtin_expect (the_map->l_tls_offset == NO_TLS_OFFSET, 1))
|
||||||
|
+ {
|
||||||
|
+ the_map->l_tls_offset = FORCED_DYNAMIC_TLS_OFFSET;
|
||||||
|
+ __rtld_lock_unlock_recursive (GL(dl_load_lock));
|
||||||
|
+ }
|
||||||
|
+ else
|
||||||
|
+ {
|
||||||
|
+ __rtld_lock_unlock_recursive (GL(dl_load_lock));
|
||||||
|
+ if (__builtin_expect (the_map->l_tls_offset
|
||||||
|
+ != FORCED_DYNAMIC_TLS_OFFSET, 1))
|
||||||
|
+ {
|
||||||
|
+ void *p = dtv[module].pointer.val;
|
||||||
|
+ if (__builtin_expect (p == TLS_DTV_UNALLOCATED, 0))
|
||||||
|
+ goto again;
|
||||||
|
+
|
||||||
|
+ return p;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ void *p = dtv[module].pointer.val = allocate_and_init (the_map);
|
||||||
|
+ dtv[module].pointer.is_static = false;
|
||||||
|
+
|
||||||
|
+ return p;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+
|
||||||
|
/* The generic dynamic and local dynamic model cannot be used in
|
||||||
|
statically linked applications. */
|
||||||
|
void *
|
||||||
|
@@ -703,52 +758,10 @@ __tls_get_addr (GET_ADDR_ARGS)
|
||||||
|
if (__builtin_expect (dtv[0].counter != GL(dl_tls_generation), 0))
|
||||||
|
the_map = _dl_update_slotinfo (GET_ADDR_MODULE);
|
||||||
|
|
||||||
|
- retry:
|
||||||
|
p = dtv[GET_ADDR_MODULE].pointer.val;
|
||||||
|
|
||||||
|
if (__builtin_expect (p == TLS_DTV_UNALLOCATED, 0))
|
||||||
|
- {
|
||||||
|
- /* The allocation was deferred. Do it now. */
|
||||||
|
- if (the_map == NULL)
|
||||||
|
- {
|
||||||
|
- /* Find the link map for this module. */
|
||||||
|
- size_t idx = GET_ADDR_MODULE;
|
||||||
|
- struct dtv_slotinfo_list *listp = GL(dl_tls_dtv_slotinfo_list);
|
||||||
|
-
|
||||||
|
- while (idx >= listp->len)
|
||||||
|
- {
|
||||||
|
- idx -= listp->len;
|
||||||
|
- listp = listp->next;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- the_map = listp->slotinfo[idx].map;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- /* Make sure that, if a dlopen running in parallel forces the
|
||||||
|
- variable into static storage, we'll wait until the address in
|
||||||
|
- the static TLS block is set up, and use that. If we're
|
||||||
|
- undecided yet, make sure we make the decision holding the
|
||||||
|
- lock as well. */
|
||||||
|
- if (__builtin_expect (the_map->l_tls_offset
|
||||||
|
- != FORCED_DYNAMIC_TLS_OFFSET, 0))
|
||||||
|
- {
|
||||||
|
- __rtld_lock_lock_recursive (GL(dl_load_lock));
|
||||||
|
- if (__builtin_expect (the_map->l_tls_offset == NO_TLS_OFFSET, 1))
|
||||||
|
- {
|
||||||
|
- the_map->l_tls_offset = FORCED_DYNAMIC_TLS_OFFSET;
|
||||||
|
- __rtld_lock_unlock_recursive (GL(dl_load_lock));
|
||||||
|
- }
|
||||||
|
- else
|
||||||
|
- {
|
||||||
|
- __rtld_lock_unlock_recursive (GL(dl_load_lock));
|
||||||
|
- if (__builtin_expect (the_map->l_tls_offset
|
||||||
|
- != FORCED_DYNAMIC_TLS_OFFSET, 1))
|
||||||
|
- goto retry;
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
- p = dtv[GET_ADDR_MODULE].pointer.val = allocate_and_init (the_map);
|
||||||
|
- dtv[GET_ADDR_MODULE].pointer.is_static = false;
|
||||||
|
- }
|
||||||
|
+ p = tls_get_addr_tail (dtv, the_map, GET_ADDR_MODULE);
|
||||||
|
|
||||||
|
return (char *) p + GET_ADDR_OFFSET;
|
||||||
|
}
|
104
glibc.spec
104
glibc.spec
@ -23,7 +23,7 @@
|
|||||||
Summary: The GNU libc libraries
|
Summary: The GNU libc libraries
|
||||||
Name: glibc
|
Name: glibc
|
||||||
Version: 2.8
|
Version: 2.8
|
||||||
Release: 1
|
Release: 10
|
||||||
# GPLv2+ is used in a bunch of programs, LGPLv2+ is used for libraries.
|
# GPLv2+ is used in a bunch of programs, LGPLv2+ is used for libraries.
|
||||||
# Things that are linked directly into dynamically linked programs
|
# Things that are linked directly into dynamically linked programs
|
||||||
# and shared libraries (e.g. crt files, lib*_nonshared.a) have an additional
|
# and shared libraries (e.g. crt files, lib*_nonshared.a) have an additional
|
||||||
@ -41,6 +41,27 @@ Source2: %(echo %{glibcsrcdir} | sed s/glibc-/glibc-libidn-/).tar.bz2
|
|||||||
Source3: %{glibcname}-fedora-%{glibcdate}.tar.bz2
|
Source3: %{glibcname}-fedora-%{glibcdate}.tar.bz2
|
||||||
Patch0: %{glibcname}-fedora.patch
|
Patch0: %{glibcname}-fedora.patch
|
||||||
Patch1: %{name}-ia64-lib64.patch
|
Patch1: %{name}-ia64-lib64.patch
|
||||||
|
Patch2: glibc-sparcv9v-fix-async-unwind-tables.patch
|
||||||
|
Patch3: glibc-bz3406.patch
|
||||||
|
Patch4: glibc-bz6461.patch
|
||||||
|
Patch5: glibc-bz6472.patch
|
||||||
|
Patch6: glibc-bz6612.patch
|
||||||
|
Patch7: glibc-bz6657.patch
|
||||||
|
Patch8: glibc-bz6723.patch
|
||||||
|
Patch9: glibc-c99-scanf.patch
|
||||||
|
Patch10: glibc-lt-l10n.patch
|
||||||
|
Patch11: glibc-nscd.patch
|
||||||
|
Patch12: glibc-res-hconf-init.patch
|
||||||
|
Patch13: glibc-rh446406.patch
|
||||||
|
Patch14: glibc-rh449358.patch
|
||||||
|
Patch15: glibc-rh450790.patch
|
||||||
|
Patch16: glibc-rwlock-pshared.patch
|
||||||
|
Patch17: glibc-sparc.patch
|
||||||
|
Patch18: glibc-tls-getaddr.patch
|
||||||
|
Patch19: glibc-bz6719.patch
|
||||||
|
Patch20: glibc-nscd-inotify-fix.patch
|
||||||
|
Patch21: glibc-rh455360.patch
|
||||||
|
Patch22: glibc-sparcv9v-memset.patch
|
||||||
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||||
Obsoletes: glibc-profile < 2.4
|
Obsoletes: glibc-profile < 2.4
|
||||||
Provides: ldconfig
|
Provides: ldconfig
|
||||||
@ -220,6 +241,27 @@ package or when debugging this package.
|
|||||||
%patch1 -p1
|
%patch1 -p1
|
||||||
%endif
|
%endif
|
||||||
%endif
|
%endif
|
||||||
|
%patch2 -p1
|
||||||
|
%patch3 -p1
|
||||||
|
%patch4 -p1
|
||||||
|
%patch5 -p1
|
||||||
|
%patch6 -p1
|
||||||
|
%patch7 -p1
|
||||||
|
%patch8 -p1
|
||||||
|
%patch9 -p1
|
||||||
|
%patch10 -p1
|
||||||
|
%patch11 -p1
|
||||||
|
%patch12 -p1
|
||||||
|
%patch13 -p1
|
||||||
|
%patch14 -p1
|
||||||
|
%patch15 -p1
|
||||||
|
%patch16 -p1
|
||||||
|
%patch17 -p1
|
||||||
|
%patch18 -p1
|
||||||
|
%patch19 -p1
|
||||||
|
%patch20 -p1
|
||||||
|
%patch21 -p1
|
||||||
|
%patch22 -p1
|
||||||
|
|
||||||
# A lot of programs still misuse memcpy when they have to use
|
# A lot of programs still misuse memcpy when they have to use
|
||||||
# memmove. The memcpy implementation below is not tolerant at
|
# memmove. The memcpy implementation below is not tolerant at
|
||||||
@ -270,14 +312,14 @@ GCC="gcc -m32"
|
|||||||
GXX="g++ -m32"
|
GXX="g++ -m32"
|
||||||
%endif
|
%endif
|
||||||
%ifarch sparc64
|
%ifarch sparc64
|
||||||
BuildFlags="-mcpu=ultrasparc -mvis -fcall-used-g6"
|
BuildFlags="-mvis -fcall-used-g6"
|
||||||
GCC="gcc -m64"
|
GCC="gcc -m64 -mcpu=ultrasparc"
|
||||||
GXX="g++ -m64"
|
GXX="g++ -m64 -mcpu=ultrasparc"
|
||||||
%endif
|
%endif
|
||||||
%ifarch sparc64v
|
%ifarch sparc64v
|
||||||
BuildFlags="-mcpu=niagara -mvis -fcall-used-g6"
|
BuildFlags="-mvis -fcall-used-g6"
|
||||||
GCC="gcc -m64"
|
GCC="gcc -m64 -mcpu=niagara"
|
||||||
GXX="g++ -m64"
|
GXX="g++ -m64 -mcpu=niagara"
|
||||||
%endif
|
%endif
|
||||||
%ifarch ppc64
|
%ifarch ppc64
|
||||||
BuildFlags="-mno-minimal-toc"
|
BuildFlags="-mno-minimal-toc"
|
||||||
@ -692,7 +734,7 @@ cd ..
|
|||||||
%if %{buildxen}
|
%if %{buildxen}
|
||||||
echo ====================TESTING -mno-tls-direct-seg-refs=============
|
echo ====================TESTING -mno-tls-direct-seg-refs=============
|
||||||
cd build-%{nptl_target_cpu}-linuxnptl-nosegneg
|
cd build-%{nptl_target_cpu}-linuxnptl-nosegneg
|
||||||
( make -j$numprocs -k check PARALLELMFLAGS=-s 2>&1
|
( make %{?_smp_mflags} -k check PARALLELMFLAGS=-s 2>&1
|
||||||
sleep 10s
|
sleep 10s
|
||||||
teepid="`ps -eo ppid,pid,command | awk '($1 == '${parent}' && $3 ~ /^tee/) { print $2 }'`"
|
teepid="`ps -eo ppid,pid,command | awk '($1 == '${parent}' && $3 ~ /^tee/) { print $2 }'`"
|
||||||
[ -n "$teepid" ] && kill $teepid
|
[ -n "$teepid" ] && kill $teepid
|
||||||
@ -705,7 +747,7 @@ cd build-%{nptl_target_cpu}-linuxnptl-power6
|
|||||||
( if [ -d ../power6emul ]; then
|
( if [ -d ../power6emul ]; then
|
||||||
export LD_PRELOAD=`cd ../power6emul; pwd`/\$LIB/power6emul.so
|
export LD_PRELOAD=`cd ../power6emul; pwd`/\$LIB/power6emul.so
|
||||||
fi
|
fi
|
||||||
make -j$numprocs -k check PARALLELMFLAGS=-s 2>&1
|
make %{?_smp_mflags} -k check PARALLELMFLAGS=-s 2>&1
|
||||||
sleep 10s
|
sleep 10s
|
||||||
teepid="`ps -eo ppid,pid,command | awk '($1 == '${parent}' && $3 ~ /^tee/) { print $2 }'`"
|
teepid="`ps -eo ppid,pid,command | awk '($1 == '${parent}' && $3 ~ /^tee/) { print $2 }'`"
|
||||||
[ -n "$teepid" ] && kill $teepid
|
[ -n "$teepid" ] && kill $teepid
|
||||||
@ -980,6 +1022,50 @@ rm -f *.filelist*
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Oct 09 2008 Dennis Gilmore <dennis@ausil.us> 2.8-10
|
||||||
|
- updated memset patch from davem and jakub
|
||||||
|
|
||||||
|
* Tue Oct 07 2008 Dennis Gilmore <dennis@ausil.us> 2.8-9
|
||||||
|
- apply patch from Jakub for sparcv9v memset issue
|
||||||
|
|
||||||
|
* Wed Jul 16 2008 Jakub Jelinek <jakub@redhat.com> 2.8-8
|
||||||
|
- another nscd fix
|
||||||
|
- fix unbuffered vfprintf (#455360)
|
||||||
|
|
||||||
|
* Tue Jul 8 2008 Jakub Jelinek <jakub@redhat.com> 2.8-7
|
||||||
|
- assorted nscd fixes (#450704, #445656, #449358)
|
||||||
|
- misc fixes (BZ#3406, BZ#6461, BZ#6472, BZ#6612, BZ#6657, BZ#6723, BZ#6719)
|
||||||
|
- fix *scanf in -std=c99 mode
|
||||||
|
- add lt translations
|
||||||
|
- some SPARC fixes
|
||||||
|
- fix regexp.h (#446406)
|
||||||
|
- fix powerpc {,l}lround{,f} assembly from clobbering %cr[34]
|
||||||
|
registers (#450790)
|
||||||
|
|
||||||
|
* Mon May 26 2008 Tom "spot" Callaway <tcallawa@redhat.com> 2.8-6
|
||||||
|
- disable async-unwind-tables for soinit.c and sofini.c
|
||||||
|
- re-enable fasynchronous-unwind-tables
|
||||||
|
|
||||||
|
* Sun May 18 2008 Tom "spot" Callaway <tcallawa@redhat.com> 2.8-5
|
||||||
|
- fasynchronous-unwind-tables causes failures on sparc arches, dont use it
|
||||||
|
|
||||||
|
* Fri May 16 2008 Tom "spot" Callaway <tcallawa@redhat.com> 2.8-4
|
||||||
|
- sparc64 gets unhappy unless the -mcpu= flag is in the GCC invocation,
|
||||||
|
not just in BuildFlags. This is probably a compiler issue (-m64
|
||||||
|
should infer -mcpu=ultrasparc), but to get things building, we'll
|
||||||
|
work around it like this for now.
|
||||||
|
|
||||||
|
* Mon May 5 2008 Jakub Jelinek <jakub@redhat.com> 2.8-3
|
||||||
|
- don't run telinit u in %post if both /dev/initctl and
|
||||||
|
/sbin/initctl exist (#444978)
|
||||||
|
- workaround GCC ppc64 miscompilation of c{log{,10},acosh,atan}l
|
||||||
|
(#444996)
|
||||||
|
|
||||||
|
* Wed Apr 30 2008 Jakub Jelinek <jakub@redhat.com> 2.8-2
|
||||||
|
- fix nscd races during GC (BZ#5381)
|
||||||
|
- rebuilt with fixed GCC to fix regex miscompilation on power6
|
||||||
|
- SPARC fixes
|
||||||
|
|
||||||
* Sat Apr 12 2008 Jakub Jelinek <jakub@redhat.com> 2.8-1
|
* Sat Apr 12 2008 Jakub Jelinek <jakub@redhat.com> 2.8-1
|
||||||
- 2.8 release
|
- 2.8 release
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user