Add two patches agains glibc-2_9 to (try to) build for SuperH.
/trunk/patches/glibc/2_9/510-sh-no-asm-user-header.patch | 70 70 0 0 ++++++++++++++++++++++
/trunk/patches/glibc/2_9/520-sh-no-asm-elf-header.patch | 27 27 0 0 ++++++++
2 files changed, 97 insertions(+)
1 Original patch from: gentoo/src/patchsets/glibc/2.9/5021_all_2.9-fnmatch.patch
3 -= BEGIN original header =-
4 http://sourceware.org/ml/libc-hacker/2002-11/msg00071.html
6 When fnmatch detects an invalid multibyte character it should fall back to
7 single byte matching, so that "*" has a chance to match such a string.
11 2005-04-12 Andreas Schwab <schwab@suse.de>
13 * posix/fnmatch.c (fnmatch): If conversion to wide character
14 fails fall back to single byte matching.
16 -= END original header =-
18 diff -durN glibc-2_9.orig/posix/fnmatch.c glibc-2_9/posix/fnmatch.c
19 --- glibc-2_9.orig/posix/fnmatch.c 2007-07-28 22:35:00.000000000 +0200
20 +++ glibc-2_9/posix/fnmatch.c 2009-02-02 22:01:25.000000000 +0100
23 if (__builtin_expect (MB_CUR_MAX, 1) != 1)
25 + const char *orig_pattern = pattern;
30 wstring = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
31 n = mbsrtowcs (wstring, &p, n + 1, &ps);
32 if (__builtin_expect (n == (size_t) -1, 0))
34 - XXX Do we have to set `errno' to something which mbsrtows hasn't
37 + /* Something wrong. Fall back to single byte matching. */
38 + goto try_singlebyte;
41 memset (&ps, '\0', sizeof (ps));
44 n = mbsrtowcs (NULL, &string, 0, &ps);
45 if (__builtin_expect (n == (size_t) -1, 0))
47 - XXX Do we have to set `errno' to something which mbsrtows hasn't
50 + /* Something wrong. Fall back to single byte matching. */
51 + goto try_singlebyte;
52 wstring = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
53 assert (mbsinit (&ps));
54 (void) mbsrtowcs (wstring, &string, n + 1, &ps);
57 return internal_fnwmatch (wpattern, wstring, wstring + n,
58 flags & FNM_PERIOD, flags, NULL);
61 + pattern = orig_pattern;
63 # endif /* mbstate_t and mbsrtowcs or _LIBC. */