From 977b78df305a06797773799a7295f2a5f3f013cf Mon Sep 17 00:00:00 2001 From: root Date: Sat, 31 Mar 2012 00:01:07 +0000 Subject: Sat Mar 31 00:01:07 UTC 2012 --- testing/glibc/PKGBUILD | 20 +- .../glibc-2.15-confstr-local-buffer-extent.patch | 297 +++++++++++++++++++++ testing/glibc/glibc-__i686.patch | 44 ++- 3 files changed, 339 insertions(+), 22 deletions(-) create mode 100644 testing/glibc/glibc-2.15-confstr-local-buffer-extent.patch (limited to 'testing/glibc') diff --git a/testing/glibc/PKGBUILD b/testing/glibc/PKGBUILD index 58cfee44d..fc8d037f5 100644 --- a/testing/glibc/PKGBUILD +++ b/testing/glibc/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 154260 2012-03-25 02:50:05Z allan $ +# $Id: PKGBUILD 154485 2012-03-29 05:49:49Z allan $ # Maintainer: Allan McRae # toolchain build order: linux-api-headers->glibc->binutils->gcc->binutils->glibc @@ -6,7 +6,7 @@ pkgname=glibc pkgver=2.15 -pkgrel=9 +pkgrel=10 _glibcdate=20111227 pkgdesc="GNU C Library" arch=('i686' 'x86_64') @@ -49,14 +49,14 @@ source=(ftp://ftp.archlinux.org/other/glibc/${pkgname}-${pkgver}_${_glibcdate}.t glibc-2.15-non-signalling-comparisons.patch glibc-2.15-rintf-rounding.patch glibc-2.15-nearbyintf-rounding.patch - glibc-2.15-confstr-strdup.patch + glibc-2.15-confstr-local-buffer-extent.patch nscd locale.gen.txt locale-gen) md5sums=('6ffdf5832192b92f98bdd125317c0dfc' '7ef69c530a15106de93e4de2df2d393e' 'b6c619e5cf91829a15ce34dccef676d5' - '40cd342e21f71f5e49e32622b25acc52' + 'addfddd648a4bf832eb126aba944ebae' 'e60e33591c9ec1447e4cddadcbb9cf3a' '6970bcfeb3bf88913436d5112d16f588' 'c5de2a946215d647c8af5432ec4b0da0' @@ -82,7 +82,7 @@ md5sums=('6ffdf5832192b92f98bdd125317c0dfc' 'c483504cf404ed0b44480af627813a97' '1419d61fd1dbc6cdc48bb59da86fa66f' '7ff501435078b1a2622124fbeaafc921' - '41f94da2f8db856b091a2d670d68eee3' + '8d1023a51e0932681b46440d5f8551ee' 'b587ee3a70c9b3713099295609afde49' '07ac979b6ab5eeb778d55f041529d623' '476e9113489f93b348b21e144b6a8fcf') @@ -108,8 +108,7 @@ build() { patch -p1 -i ${srcdir}/glibc-2.15-do-not-install-timezone-files-2.patch # undefine __i686 - # http://sourceware.org/ml/libc-alpha/2009-07/msg00072.html - # fix in http://sourceware.org/git/?p=glibc.git;a=commit;h=d4a54ac6 requires additional backporting... + # http://sourceware.org/glibc/wiki/Release/2.15#Build_Failures patch -p1 -i ${srcdir}/glibc-__i686.patch # http://www.exploit-db.com/exploits/15274/ @@ -214,8 +213,10 @@ build() { # http://sourceware.org/git/?p=glibc.git;a=commit;h=6cbeae47 patch -p1 -i ${srcdir}/glibc-2.15-nearbyintf-rounding.patch - # fix varaible scope issue exposed with gcc-4.7 and -O2 - patch -p1 -i ${srcdir}/glibc-2.15-confstr-strdup.patch + # fix varaible scope issue in confstr + # http://sourceware.org/git/?p=glibc.git;a=commit;h=ac4c54f0 + # http://sourceware.org/git/?p=glibc.git;a=commit;h=d6a403f9 + patch -p1 -i ${srcdir}/glibc-2.15-confstr-local-buffer-extent.patch install -dm755 ${pkgdir}/etc touch ${pkgdir}/etc/ld.so.conf @@ -226,6 +227,7 @@ build() { if [[ ${CARCH} = "i686" ]]; then # Hack to fix NPTL issues with Xen, only required on 32bit platforms + # TODO: make separate glibc-xen package for i686 export CFLAGS="${CFLAGS} -mno-tls-direct-seg-refs" fi diff --git a/testing/glibc/glibc-2.15-confstr-local-buffer-extent.patch b/testing/glibc/glibc-2.15-confstr-local-buffer-extent.patch new file mode 100644 index 000000000..483b28532 --- /dev/null +++ b/testing/glibc/glibc-2.15-confstr-local-buffer-extent.patch @@ -0,0 +1,297 @@ +diff --git a/posix/confstr.c b/posix/confstr.c +index 3c9566d..cad6561 100644 +--- a/posix/confstr.c ++++ b/posix/confstr.c +@@ -35,6 +34,10 @@ confstr (name, buf, len) + const char *string = ""; + size_t string_len = 1; + ++ /* Note that this buffer must be large enough for the longest strings ++ used below. */ ++ char restenvs[4 * sizeof "POSIX_V7_LPBIG_OFFBIG"]; ++ + switch (name) + { + case _CS_PATH: +@@ -53,59 +56,55 @@ confstr (name, buf, len) + wint_t types are no greater than the width of type long. + + Currently this means all environment which the system allows. */ +- { +- char restenvs[4 * sizeof "POSIX_V7_LPBIG_OFFBIG"]; +- +- string_len = 0; ++ string_len = 0; + #ifndef _POSIX_V7_ILP32_OFF32 +- if (__sysconf (_SC_V7_ILP32_OFF32) > 0) ++ if (__sysconf (_SC_V7_ILP32_OFF32) > 0) + #endif + #if !defined _POSIX_V7_ILP32_OFF32 || _POSIX_V7_ILP32_OFF32 > 0 +- { +- memcpy (restenvs + string_len, "POSIX_V7_ILP32_OFF32", +- sizeof "POSIX_V7_ILP32_OFF32" - 1); +- string_len += sizeof "POSIX_V7_ILP32_OFF32" - 1; +- } ++ { ++ memcpy (restenvs + string_len, "POSIX_V7_ILP32_OFF32", ++ sizeof "POSIX_V7_ILP32_OFF32" - 1); ++ string_len += sizeof "POSIX_V7_ILP32_OFF32" - 1; ++ } + #endif + #ifndef _POSIX_V7_ILP32_OFFBIG +- if (__sysconf (_SC_V7_ILP32_OFFBIG) > 0) ++ if (__sysconf (_SC_V7_ILP32_OFFBIG) > 0) + #endif + #if !defined _POSIX_V7_ILP32_OFFBIG || _POSIX_V7_ILP32_OFFBIG > 0 +- { +- if (string_len) +- restenvs[string_len++] = '\n'; +- memcpy (restenvs + string_len, "POSIX_V7_ILP32_OFFBIG", +- sizeof "POSIX_V7_ILP32_OFFBIG" - 1); +- string_len += sizeof "POSIX_V7_ILP32_OFFBIG" - 1; +- } ++ { ++ if (string_len) ++ restenvs[string_len++] = '\n'; ++ memcpy (restenvs + string_len, "POSIX_V7_ILP32_OFFBIG", ++ sizeof "POSIX_V7_ILP32_OFFBIG" - 1); ++ string_len += sizeof "POSIX_V7_ILP32_OFFBIG" - 1; ++ } + #endif + #ifndef _POSIX_V7_LP64_OFF64 +- if (__sysconf (_SC_V7_LP64_OFF64) > 0) ++ if (__sysconf (_SC_V7_LP64_OFF64) > 0) + #endif + #if !defined _POSIX_V7_LP64_OFF64 || _POSIX_V7_LP64_OFF64 > 0 +- { +- if (string_len) +- restenvs[string_len++] = '\n'; +- memcpy (restenvs + string_len, "POSIX_V7_LP64_OFF64", +- sizeof "POSIX_V7_LP64_OFF64" - 1); +- string_len += sizeof "POSIX_V7_LP64_OFF64" - 1; +- } ++ { ++ if (string_len) ++ restenvs[string_len++] = '\n'; ++ memcpy (restenvs + string_len, "POSIX_V7_LP64_OFF64", ++ sizeof "POSIX_V7_LP64_OFF64" - 1); ++ string_len += sizeof "POSIX_V7_LP64_OFF64" - 1; ++ } + #endif + #ifndef _POSIX_V7_LPBIG_OFFBIG +- if (__sysconf (_SC_V7_LPBIG_OFFBIG) > 0) ++ if (__sysconf (_SC_V7_LPBIG_OFFBIG) > 0) + #endif + #if !defined _POSIX_V7_LPBIG_OFFBIG || _POSIX_V7_LPBIG_OFFBIG > 0 +- { +- if (string_len) +- restenvs[string_len++] = '\n'; +- memcpy (restenvs + string_len, "POSIX_V7_LPBIG_OFFBIG", +- sizeof "POSIX_V7_LPBIG_OFFBIG" - 1); +- string_len += sizeof "POSIX_V7_LPBIG_OFFBIG" - 1; +- } +-#endif +- restenvs[string_len++] = '\0'; +- string = restenvs; +- } ++ { ++ if (string_len) ++ restenvs[string_len++] = '\n'; ++ memcpy (restenvs + string_len, "POSIX_V7_LPBIG_OFFBIG", ++ sizeof "POSIX_V7_LPBIG_OFFBIG" - 1); ++ string_len += sizeof "POSIX_V7_LPBIG_OFFBIG" - 1; ++ } ++#endif ++ restenvs[string_len++] = '\0'; ++ string = restenvs; + break; + + case _CS_V6_WIDTH_RESTRICTED_ENVS: +@@ -116,59 +115,55 @@ confstr (name, buf, len) + wint_t types are no greater than the width of type long. + + Currently this means all environment which the system allows. */ +- { +- char restenvs[4 * sizeof "POSIX_V6_LPBIG_OFFBIG"]; +- +- string_len = 0; ++ string_len = 0; + #ifndef _POSIX_V6_ILP32_OFF32 +- if (__sysconf (_SC_V6_ILP32_OFF32) > 0) ++ if (__sysconf (_SC_V6_ILP32_OFF32) > 0) + #endif + #if !defined _POSIX_V6_ILP32_OFF32 || _POSIX_V6_ILP32_OFF32 > 0 +- { +- memcpy (restenvs + string_len, "POSIX_V6_ILP32_OFF32", +- sizeof "POSIX_V6_ILP32_OFF32" - 1); +- string_len += sizeof "POSIX_V6_ILP32_OFF32" - 1; +- } ++ { ++ memcpy (restenvs + string_len, "POSIX_V6_ILP32_OFF32", ++ sizeof "POSIX_V6_ILP32_OFF32" - 1); ++ string_len += sizeof "POSIX_V6_ILP32_OFF32" - 1; ++ } + #endif + #ifndef _POSIX_V6_ILP32_OFFBIG +- if (__sysconf (_SC_V6_ILP32_OFFBIG) > 0) ++ if (__sysconf (_SC_V6_ILP32_OFFBIG) > 0) + #endif + #if !defined _POSIX_V6_ILP32_OFFBIG || _POSIX_V6_ILP32_OFFBIG > 0 +- { +- if (string_len) +- restenvs[string_len++] = '\n'; +- memcpy (restenvs + string_len, "POSIX_V6_ILP32_OFFBIG", +- sizeof "POSIX_V6_ILP32_OFFBIG" - 1); +- string_len += sizeof "POSIX_V6_ILP32_OFFBIG" - 1; +- } ++ { ++ if (string_len) ++ restenvs[string_len++] = '\n'; ++ memcpy (restenvs + string_len, "POSIX_V6_ILP32_OFFBIG", ++ sizeof "POSIX_V6_ILP32_OFFBIG" - 1); ++ string_len += sizeof "POSIX_V6_ILP32_OFFBIG" - 1; ++ } + #endif + #ifndef _POSIX_V6_LP64_OFF64 +- if (__sysconf (_SC_V6_LP64_OFF64) > 0) ++ if (__sysconf (_SC_V6_LP64_OFF64) > 0) + #endif + #if !defined _POSIX_V6_LP64_OFF64 || _POSIX_V6_LP64_OFF64 > 0 +- { +- if (string_len) +- restenvs[string_len++] = '\n'; +- memcpy (restenvs + string_len, "POSIX_V6_LP64_OFF64", +- sizeof "POSIX_V6_LP64_OFF64" - 1); +- string_len += sizeof "POSIX_V6_LP64_OFF64" - 1; +- } ++ { ++ if (string_len) ++ restenvs[string_len++] = '\n'; ++ memcpy (restenvs + string_len, "POSIX_V6_LP64_OFF64", ++ sizeof "POSIX_V6_LP64_OFF64" - 1); ++ string_len += sizeof "POSIX_V6_LP64_OFF64" - 1; ++ } + #endif + #ifndef _POSIX_V6_LPBIG_OFFBIG +- if (__sysconf (_SC_V6_LPBIG_OFFBIG) > 0) ++ if (__sysconf (_SC_V6_LPBIG_OFFBIG) > 0) + #endif + #if !defined _POSIX_V6_LPBIG_OFFBIG || _POSIX_V6_LPBIG_OFFBIG > 0 +- { +- if (string_len) +- restenvs[string_len++] = '\n'; +- memcpy (restenvs + string_len, "POSIX_V6_LPBIG_OFFBIG", +- sizeof "POSIX_V6_LPBIG_OFFBIG" - 1); +- string_len += sizeof "POSIX_V6_LPBIG_OFFBIG" - 1; +- } +-#endif +- restenvs[string_len++] = '\0'; +- string = restenvs; +- } ++ { ++ if (string_len) ++ restenvs[string_len++] = '\n'; ++ memcpy (restenvs + string_len, "POSIX_V6_LPBIG_OFFBIG", ++ sizeof "POSIX_V6_LPBIG_OFFBIG" - 1); ++ string_len += sizeof "POSIX_V6_LPBIG_OFFBIG" - 1; ++ } ++#endif ++ restenvs[string_len++] = '\0'; ++ string = restenvs; + break; + + case _CS_V5_WIDTH_RESTRICTED_ENVS: +@@ -179,59 +174,55 @@ confstr (name, buf, len) + wint_t types are no greater than the width of type long. + + Currently this means all environment which the system allows. */ +- { +- char restenvs[4 * sizeof "XBS5_LPBIG_OFFBIG"]; +- +- string_len = 0; ++ string_len = 0; + #ifndef _XBS5_ILP32_OFF32 +- if (__sysconf (_SC_XBS5_ILP32_OFF32) > 0) ++ if (__sysconf (_SC_XBS5_ILP32_OFF32) > 0) + #endif + #if !defined _XBS5_ILP32_OFF32 || _XBS5_ILP32_OFF32 > 0 +- { +- memcpy (restenvs + string_len, "XBS5_ILP32_OFF32", +- sizeof "XBS5_ILP32_OFF32" - 1); +- string_len += sizeof "XBS5_ILP32_OFF32" - 1; +- } ++ { ++ memcpy (restenvs + string_len, "XBS5_ILP32_OFF32", ++ sizeof "XBS5_ILP32_OFF32" - 1); ++ string_len += sizeof "XBS5_ILP32_OFF32" - 1; ++ } + #endif + #ifndef _XBS5_ILP32_OFFBIG +- if (__sysconf (_SC_XBS5_ILP32_OFFBIG) > 0) ++ if (__sysconf (_SC_XBS5_ILP32_OFFBIG) > 0) + #endif + #if !defined _XBS5_ILP32_OFFBIG || _XBS5_ILP32_OFFBIG > 0 +- { +- if (string_len) +- restenvs[string_len++] = '\n'; +- memcpy (restenvs + string_len, "XBS5_ILP32_OFFBIG", +- sizeof "XBS5_ILP32_OFFBIG" - 1); +- string_len += sizeof "XBS5_ILP32_OFFBIG" - 1; +- } ++ { ++ if (string_len) ++ restenvs[string_len++] = '\n'; ++ memcpy (restenvs + string_len, "XBS5_ILP32_OFFBIG", ++ sizeof "XBS5_ILP32_OFFBIG" - 1); ++ string_len += sizeof "XBS5_ILP32_OFFBIG" - 1; ++ } + #endif + #ifndef _XBS5_LP64_OFF64 +- if (__sysconf (_SC_XBS5_LP64_OFF64) > 0) ++ if (__sysconf (_SC_XBS5_LP64_OFF64) > 0) + #endif + #if !defined _XBS5_LP64_OFF64 || _XBS5_LP64_OFF64 > 0 +- { +- if (string_len) +- restenvs[string_len++] = '\n'; +- memcpy (restenvs + string_len, "XBS5_LP64_OFF64", +- sizeof "XBS5_LP64_OFF64" - 1); +- string_len += sizeof "XBS5_LP64_OFF64" - 1; +- } ++ { ++ if (string_len) ++ restenvs[string_len++] = '\n'; ++ memcpy (restenvs + string_len, "XBS5_LP64_OFF64", ++ sizeof "XBS5_LP64_OFF64" - 1); ++ string_len += sizeof "XBS5_LP64_OFF64" - 1; ++ } + #endif + #ifndef _XBS5_LPBIG_OFFBIG +- if (__sysconf (_SC_XBS5_LPBIG_OFFBIG) > 0) ++ if (__sysconf (_SC_XBS5_LPBIG_OFFBIG) > 0) + #endif + #if !defined _XBS5_LPBIG_OFFBIG || _XBS5_LPBIG_OFFBIG > 0 +- { +- if (string_len) +- restenvs[string_len++] = '\n'; +- memcpy (restenvs + string_len, "XBS5_LPBIG_OFFBIG", +- sizeof "XBS5_LPBIG_OFFBIG" - 1); +- string_len += sizeof "XBS5_LPBIG_OFFBIG" - 1; +- } +-#endif +- restenvs[string_len++] = '\0'; +- string = restenvs; +- } ++ { ++ if (string_len) ++ restenvs[string_len++] = '\n'; ++ memcpy (restenvs + string_len, "XBS5_LPBIG_OFFBIG", ++ sizeof "XBS5_LPBIG_OFFBIG" - 1); ++ string_len += sizeof "XBS5_LPBIG_OFFBIG" - 1; ++ } ++#endif ++ restenvs[string_len++] = '\0'; ++ string = restenvs; + break; + + case _CS_XBS5_ILP32_OFF32_CFLAGS: diff --git a/testing/glibc/glibc-__i686.patch b/testing/glibc/glibc-__i686.patch index 28d5dd424..16f84c536 100644 --- a/testing/glibc/glibc-__i686.patch +++ b/testing/glibc/glibc-__i686.patch @@ -1,13 +1,31 @@ -diff -Naur glibc-old//sysdeps/i386/Makefile glibc//sysdeps/i386/Makefile ---- glibc-old//sysdeps/i386/Makefile 2010-03-18 11:52:30.000000000 +1000 -+++ glibc//sysdeps/i386/Makefile 2010-04-16 15:05:50.000000000 +1000 -@@ -1,6 +1,7 @@ - # The mpn functions need a #define for asm syntax flavor. --# Every i386 port in use uses gas syntax (I think). --asm-CPPFLAGS += -DGAS_SYNTAX -+# Every i386 port in use uses gas syntax (I think). Don't replace -+# __i686 in __i686.get_pc_thunk.bx. -+asm-CPPFLAGS += -DGAS_SYNTAX -U __i686 - - # The i386 `long double' is a distinct type we support. - long-double-fcts = yes +diff --git a/nptl/sysdeps/pthread/pt-initfini.c b/nptl/sysdeps/pthread/pt-initfini.c +index 9c00dc0..f5d4df8 100644 +--- a/nptl/sysdeps/pthread/pt-initfini.c ++++ b/nptl/sysdeps/pthread/pt-initfini.c +@@ -45,6 +45,11 @@ + /* Embed an #include to pull in the alignment and .end directives. */ + asm ("\n#include \"defs.h\""); + ++asm ("\n#if defined __i686 && defined __ASSEMBLER__"); ++asm ("\n#undef __i686"); ++asm ("\n#define __i686 __i686"); ++asm ("\n#endif"); ++ + /* The initial common code ends here. */ + asm ("\n/*@HEADER_ENDS*/"); + +diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h b/sysdeps/unix/sysv/linux/i386/sysdep.h +index 64ef400..726b1df 100644 +--- a/sysdeps/unix/sysv/linux/i386/sysdep.h ++++ b/sysdeps/unix/sysv/linux/i386/sysdep.h +@@ -29,6 +29,10 @@ + #include + #include + ++#if defined __i686 && defined __ASSEMBLER__ ++#undef __i686 ++#define __i686 __i686 ++#endif + + /* For Linux we can use the system call table in the header file + /usr/include/asm/unistd.h -- cgit v1.2.3-54-g00ecf