From 56eb2a9f87b0638bb504c1fc071324b7b88e0e3a Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sat, 13 Sep 2014 13:31:36 +0200 Subject: add patches for glibc 2.20 --- toolchain/glibc/patches/2.19/glibc-cross.patch | 86 ++++++++++++++++++++++ toolchain/glibc/patches/2.19/i686_define_bug.patch | 23 ++++++ toolchain/glibc/patches/2.19/sparc-darwin.patch | 12 +++ toolchain/glibc/patches/2.20/glibc-cross.patch | 86 ++++++++++++++++++++++ toolchain/glibc/patches/2.20/i686_define_bug.patch | 23 ++++++ toolchain/glibc/patches/2.20/sparc-darwin.patch | 12 +++ .../glibc/patches/2.20/sparc-semtrywait.patch | 11 +++ toolchain/glibc/patches/glibc-cross.patch | 86 ---------------------- toolchain/glibc/patches/i686_define_bug.patch | 23 ------ toolchain/glibc/patches/sparc-darwin.patch | 12 --- 10 files changed, 253 insertions(+), 121 deletions(-) create mode 100644 toolchain/glibc/patches/2.19/glibc-cross.patch create mode 100644 toolchain/glibc/patches/2.19/i686_define_bug.patch create mode 100644 toolchain/glibc/patches/2.19/sparc-darwin.patch create mode 100644 toolchain/glibc/patches/2.20/glibc-cross.patch create mode 100644 toolchain/glibc/patches/2.20/i686_define_bug.patch create mode 100644 toolchain/glibc/patches/2.20/sparc-darwin.patch create mode 100644 toolchain/glibc/patches/2.20/sparc-semtrywait.patch delete mode 100644 toolchain/glibc/patches/glibc-cross.patch delete mode 100644 toolchain/glibc/patches/i686_define_bug.patch delete mode 100644 toolchain/glibc/patches/sparc-darwin.patch (limited to 'toolchain/glibc') diff --git a/toolchain/glibc/patches/2.19/glibc-cross.patch b/toolchain/glibc/patches/2.19/glibc-cross.patch new file mode 100644 index 000000000..a1903179d --- /dev/null +++ b/toolchain/glibc/patches/2.19/glibc-cross.patch @@ -0,0 +1,86 @@ +diff -Nur glibc-2.19.orig/sunrpc/rpc/types.h glibc-2.19/sunrpc/rpc/types.h +--- glibc-2.19.orig/sunrpc/rpc/types.h 2014-02-07 10:04:38.000000000 +0100 ++++ glibc-2.19/sunrpc/rpc/types.h 2014-03-03 13:42:42.000000000 +0100 +@@ -74,19 +74,24 @@ + # define __daddr_t_defined + #endif + +-#ifndef __u_char_defined +-typedef __u_char u_char; +-typedef __u_short u_short; +-typedef __u_int u_int; +-typedef __u_long u_long; +-typedef __quad_t quad_t; +-typedef __u_quad_t u_quad_t; +-typedef __fsid_t fsid_t; +-# define __u_char_defined ++typedef unsigned char u_char; ++typedef unsigned short u_short; ++typedef unsigned int u_int; ++typedef unsigned long u_long; ++#if __WORDSIZE == 64 ++#ifndef __APPLE__ ++typedef long int quad_t; ++typedef unsigned long int u_quad_t; ++#endif ++#elif defined __GLIBC_HAVE_LONG_LONG ++typedef long long int quad_t; ++typedef unsigned long long int u_quad_t; + #endif +-#ifndef __daddr_t_defined +-typedef __daddr_t daddr_t; +-typedef __caddr_t caddr_t; ++ ++# define __u_char_defined ++#if !defined(__daddr_t_defined) && defined(linux) ++typedef long int daddr_t; ++typedef char *caddr_t; + # define __daddr_t_defined + #endif + +diff -Nur glibc-2.19.orig/sunrpc/rpc_main.c glibc-2.19/sunrpc/rpc_main.c +--- glibc-2.19.orig/sunrpc/rpc_main.c 2014-02-07 10:04:38.000000000 +0100 ++++ glibc-2.19/sunrpc/rpc_main.c 2014-03-04 07:12:00.000000000 +0100 +@@ -38,7 +38,11 @@ + #include + #include + #include ++#ifdef __APPLE__ ++#define gettext(X) (X) ++#else + #include ++#endif + #include + #include + #include +@@ -958,10 +962,12 @@ + abort (); + temp = rindex (cmd->infile, '.'); + cp = stpcpy (mkfilename, "Makefile."); +- if (temp != NULL) +- *((char *) stpncpy (cp, cmd->infile, temp - cmd->infile)) = '\0'; +- else ++ if (temp != NULL) { ++ strncpy (cp, cmd->infile, temp - cmd->infile); ++ cp[temp - cmd->infile - 1] = '\0'; ++ } else { + stpcpy (cp, cmd->infile); ++ } + + } + else +diff -Nur glibc-2.19.orig/sunrpc/rpc_scan.c glibc-2.19/sunrpc/rpc_scan.c +--- glibc-2.19.orig/sunrpc/rpc_scan.c 2014-02-07 10:04:38.000000000 +0100 ++++ glibc-2.19/sunrpc/rpc_scan.c 2014-03-04 07:11:29.000000000 +0100 +@@ -37,7 +37,11 @@ + #include + #include + #include ++#ifdef __APPLE__ ++#define gettext(X) (X) ++#else + #include ++#endif + #include "rpc_scan.h" + #include "rpc_parse.h" + #include "rpc_util.h" diff --git a/toolchain/glibc/patches/2.19/i686_define_bug.patch b/toolchain/glibc/patches/2.19/i686_define_bug.patch new file mode 100644 index 000000000..cef7440b8 --- /dev/null +++ b/toolchain/glibc/patches/2.19/i686_define_bug.patch @@ -0,0 +1,23 @@ + Fix for compiling glibc with -march=i686 specified. + The patch below found at: http://permalink.gmane.org/gmane.linux.lfs.devel/9758, + a nice discussion (with a comment of the glibc maintainer) can be found here: + http://old.nabble.com/-RFC-PATCH--glibc-doesn%27t-build-with-%22gcc--march%3Di686%22-td17442608.html + + To me, this simply shows once more how fucked up things can be. E.g. the (related) bug report here: + http://bugs.gentoo.org/show_bug.cgi?id=201815. There are lots of duplicates to it, many people are + affected, one can find really elaborate reports. And the responsible gentoo developers are too + elite to even point to the actual patch fixing the issue. +diff -Nur glibc-2.16.0.orig/sysdeps/unix/sysv/linux/i386/sysdep.h glibc-2.16.0/sysdeps/unix/sysv/linux/i386/sysdep.h +--- glibc-2.16.0.orig/sysdeps/unix/sysv/linux/i386/sysdep.h 2012-06-30 21:12:34.000000000 +0200 ++++ glibc-2.16.0/sysdeps/unix/sysv/linux/i386/sysdep.h 2012-08-01 17:56:05.000000000 +0200 +@@ -28,6 +28,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 diff --git a/toolchain/glibc/patches/2.19/sparc-darwin.patch b/toolchain/glibc/patches/2.19/sparc-darwin.patch new file mode 100644 index 000000000..8560a42cf --- /dev/null +++ b/toolchain/glibc/patches/2.19/sparc-darwin.patch @@ -0,0 +1,12 @@ +diff -Nur glibc-2.19.orig/configure glibc-2.19/configure +--- glibc-2.19.orig/configure 2014-02-07 10:04:38.000000000 +0100 ++++ glibc-2.19/configure 2014-04-16 23:11:01.000000000 +0200 +@@ -6228,7 +6228,7 @@ + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } + then +- if $READELF -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then ++ if $READELF -S conftest.so | grep '\.\(rela\|rel\)\.dyn' > /dev/null; then + libc_cv_z_combreloc=yes + else + libc_cv_z_combreloc=no diff --git a/toolchain/glibc/patches/2.20/glibc-cross.patch b/toolchain/glibc/patches/2.20/glibc-cross.patch new file mode 100644 index 000000000..a1903179d --- /dev/null +++ b/toolchain/glibc/patches/2.20/glibc-cross.patch @@ -0,0 +1,86 @@ +diff -Nur glibc-2.19.orig/sunrpc/rpc/types.h glibc-2.19/sunrpc/rpc/types.h +--- glibc-2.19.orig/sunrpc/rpc/types.h 2014-02-07 10:04:38.000000000 +0100 ++++ glibc-2.19/sunrpc/rpc/types.h 2014-03-03 13:42:42.000000000 +0100 +@@ -74,19 +74,24 @@ + # define __daddr_t_defined + #endif + +-#ifndef __u_char_defined +-typedef __u_char u_char; +-typedef __u_short u_short; +-typedef __u_int u_int; +-typedef __u_long u_long; +-typedef __quad_t quad_t; +-typedef __u_quad_t u_quad_t; +-typedef __fsid_t fsid_t; +-# define __u_char_defined ++typedef unsigned char u_char; ++typedef unsigned short u_short; ++typedef unsigned int u_int; ++typedef unsigned long u_long; ++#if __WORDSIZE == 64 ++#ifndef __APPLE__ ++typedef long int quad_t; ++typedef unsigned long int u_quad_t; ++#endif ++#elif defined __GLIBC_HAVE_LONG_LONG ++typedef long long int quad_t; ++typedef unsigned long long int u_quad_t; + #endif +-#ifndef __daddr_t_defined +-typedef __daddr_t daddr_t; +-typedef __caddr_t caddr_t; ++ ++# define __u_char_defined ++#if !defined(__daddr_t_defined) && defined(linux) ++typedef long int daddr_t; ++typedef char *caddr_t; + # define __daddr_t_defined + #endif + +diff -Nur glibc-2.19.orig/sunrpc/rpc_main.c glibc-2.19/sunrpc/rpc_main.c +--- glibc-2.19.orig/sunrpc/rpc_main.c 2014-02-07 10:04:38.000000000 +0100 ++++ glibc-2.19/sunrpc/rpc_main.c 2014-03-04 07:12:00.000000000 +0100 +@@ -38,7 +38,11 @@ + #include + #include + #include ++#ifdef __APPLE__ ++#define gettext(X) (X) ++#else + #include ++#endif + #include + #include + #include +@@ -958,10 +962,12 @@ + abort (); + temp = rindex (cmd->infile, '.'); + cp = stpcpy (mkfilename, "Makefile."); +- if (temp != NULL) +- *((char *) stpncpy (cp, cmd->infile, temp - cmd->infile)) = '\0'; +- else ++ if (temp != NULL) { ++ strncpy (cp, cmd->infile, temp - cmd->infile); ++ cp[temp - cmd->infile - 1] = '\0'; ++ } else { + stpcpy (cp, cmd->infile); ++ } + + } + else +diff -Nur glibc-2.19.orig/sunrpc/rpc_scan.c glibc-2.19/sunrpc/rpc_scan.c +--- glibc-2.19.orig/sunrpc/rpc_scan.c 2014-02-07 10:04:38.000000000 +0100 ++++ glibc-2.19/sunrpc/rpc_scan.c 2014-03-04 07:11:29.000000000 +0100 +@@ -37,7 +37,11 @@ + #include + #include + #include ++#ifdef __APPLE__ ++#define gettext(X) (X) ++#else + #include ++#endif + #include "rpc_scan.h" + #include "rpc_parse.h" + #include "rpc_util.h" diff --git a/toolchain/glibc/patches/2.20/i686_define_bug.patch b/toolchain/glibc/patches/2.20/i686_define_bug.patch new file mode 100644 index 000000000..cef7440b8 --- /dev/null +++ b/toolchain/glibc/patches/2.20/i686_define_bug.patch @@ -0,0 +1,23 @@ + Fix for compiling glibc with -march=i686 specified. + The patch below found at: http://permalink.gmane.org/gmane.linux.lfs.devel/9758, + a nice discussion (with a comment of the glibc maintainer) can be found here: + http://old.nabble.com/-RFC-PATCH--glibc-doesn%27t-build-with-%22gcc--march%3Di686%22-td17442608.html + + To me, this simply shows once more how fucked up things can be. E.g. the (related) bug report here: + http://bugs.gentoo.org/show_bug.cgi?id=201815. There are lots of duplicates to it, many people are + affected, one can find really elaborate reports. And the responsible gentoo developers are too + elite to even point to the actual patch fixing the issue. +diff -Nur glibc-2.16.0.orig/sysdeps/unix/sysv/linux/i386/sysdep.h glibc-2.16.0/sysdeps/unix/sysv/linux/i386/sysdep.h +--- glibc-2.16.0.orig/sysdeps/unix/sysv/linux/i386/sysdep.h 2012-06-30 21:12:34.000000000 +0200 ++++ glibc-2.16.0/sysdeps/unix/sysv/linux/i386/sysdep.h 2012-08-01 17:56:05.000000000 +0200 +@@ -28,6 +28,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 diff --git a/toolchain/glibc/patches/2.20/sparc-darwin.patch b/toolchain/glibc/patches/2.20/sparc-darwin.patch new file mode 100644 index 000000000..8560a42cf --- /dev/null +++ b/toolchain/glibc/patches/2.20/sparc-darwin.patch @@ -0,0 +1,12 @@ +diff -Nur glibc-2.19.orig/configure glibc-2.19/configure +--- glibc-2.19.orig/configure 2014-02-07 10:04:38.000000000 +0100 ++++ glibc-2.19/configure 2014-04-16 23:11:01.000000000 +0200 +@@ -6228,7 +6228,7 @@ + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } + then +- if $READELF -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then ++ if $READELF -S conftest.so | grep '\.\(rela\|rel\)\.dyn' > /dev/null; then + libc_cv_z_combreloc=yes + else + libc_cv_z_combreloc=no diff --git a/toolchain/glibc/patches/2.20/sparc-semtrywait.patch b/toolchain/glibc/patches/2.20/sparc-semtrywait.patch new file mode 100644 index 000000000..43af77527 --- /dev/null +++ b/toolchain/glibc/patches/2.20/sparc-semtrywait.patch @@ -0,0 +1,11 @@ +diff -Nur glibc-2.20.orig/sysdeps/sparc/sparc32/sem_trywait.c glibc-2.20/sysdeps/sparc/sparc32/sem_trywait.c +--- glibc-2.20.orig/sysdeps/sparc/sparc32/sem_trywait.c 2014-09-07 10:09:09.000000000 +0200 ++++ glibc-2.20/sysdeps/sparc/sparc32/sem_trywait.c 2014-09-13 10:21:44.000000000 +0200 +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + + #include + diff --git a/toolchain/glibc/patches/glibc-cross.patch b/toolchain/glibc/patches/glibc-cross.patch deleted file mode 100644 index a1903179d..000000000 --- a/toolchain/glibc/patches/glibc-cross.patch +++ /dev/null @@ -1,86 +0,0 @@ -diff -Nur glibc-2.19.orig/sunrpc/rpc/types.h glibc-2.19/sunrpc/rpc/types.h ---- glibc-2.19.orig/sunrpc/rpc/types.h 2014-02-07 10:04:38.000000000 +0100 -+++ glibc-2.19/sunrpc/rpc/types.h 2014-03-03 13:42:42.000000000 +0100 -@@ -74,19 +74,24 @@ - # define __daddr_t_defined - #endif - --#ifndef __u_char_defined --typedef __u_char u_char; --typedef __u_short u_short; --typedef __u_int u_int; --typedef __u_long u_long; --typedef __quad_t quad_t; --typedef __u_quad_t u_quad_t; --typedef __fsid_t fsid_t; --# define __u_char_defined -+typedef unsigned char u_char; -+typedef unsigned short u_short; -+typedef unsigned int u_int; -+typedef unsigned long u_long; -+#if __WORDSIZE == 64 -+#ifndef __APPLE__ -+typedef long int quad_t; -+typedef unsigned long int u_quad_t; -+#endif -+#elif defined __GLIBC_HAVE_LONG_LONG -+typedef long long int quad_t; -+typedef unsigned long long int u_quad_t; - #endif --#ifndef __daddr_t_defined --typedef __daddr_t daddr_t; --typedef __caddr_t caddr_t; -+ -+# define __u_char_defined -+#if !defined(__daddr_t_defined) && defined(linux) -+typedef long int daddr_t; -+typedef char *caddr_t; - # define __daddr_t_defined - #endif - -diff -Nur glibc-2.19.orig/sunrpc/rpc_main.c glibc-2.19/sunrpc/rpc_main.c ---- glibc-2.19.orig/sunrpc/rpc_main.c 2014-02-07 10:04:38.000000000 +0100 -+++ glibc-2.19/sunrpc/rpc_main.c 2014-03-04 07:12:00.000000000 +0100 -@@ -38,7 +38,11 @@ - #include - #include - #include -+#ifdef __APPLE__ -+#define gettext(X) (X) -+#else - #include -+#endif - #include - #include - #include -@@ -958,10 +962,12 @@ - abort (); - temp = rindex (cmd->infile, '.'); - cp = stpcpy (mkfilename, "Makefile."); -- if (temp != NULL) -- *((char *) stpncpy (cp, cmd->infile, temp - cmd->infile)) = '\0'; -- else -+ if (temp != NULL) { -+ strncpy (cp, cmd->infile, temp - cmd->infile); -+ cp[temp - cmd->infile - 1] = '\0'; -+ } else { - stpcpy (cp, cmd->infile); -+ } - - } - else -diff -Nur glibc-2.19.orig/sunrpc/rpc_scan.c glibc-2.19/sunrpc/rpc_scan.c ---- glibc-2.19.orig/sunrpc/rpc_scan.c 2014-02-07 10:04:38.000000000 +0100 -+++ glibc-2.19/sunrpc/rpc_scan.c 2014-03-04 07:11:29.000000000 +0100 -@@ -37,7 +37,11 @@ - #include - #include - #include -+#ifdef __APPLE__ -+#define gettext(X) (X) -+#else - #include -+#endif - #include "rpc_scan.h" - #include "rpc_parse.h" - #include "rpc_util.h" diff --git a/toolchain/glibc/patches/i686_define_bug.patch b/toolchain/glibc/patches/i686_define_bug.patch deleted file mode 100644 index cef7440b8..000000000 --- a/toolchain/glibc/patches/i686_define_bug.patch +++ /dev/null @@ -1,23 +0,0 @@ - Fix for compiling glibc with -march=i686 specified. - The patch below found at: http://permalink.gmane.org/gmane.linux.lfs.devel/9758, - a nice discussion (with a comment of the glibc maintainer) can be found here: - http://old.nabble.com/-RFC-PATCH--glibc-doesn%27t-build-with-%22gcc--march%3Di686%22-td17442608.html - - To me, this simply shows once more how fucked up things can be. E.g. the (related) bug report here: - http://bugs.gentoo.org/show_bug.cgi?id=201815. There are lots of duplicates to it, many people are - affected, one can find really elaborate reports. And the responsible gentoo developers are too - elite to even point to the actual patch fixing the issue. -diff -Nur glibc-2.16.0.orig/sysdeps/unix/sysv/linux/i386/sysdep.h glibc-2.16.0/sysdeps/unix/sysv/linux/i386/sysdep.h ---- glibc-2.16.0.orig/sysdeps/unix/sysv/linux/i386/sysdep.h 2012-06-30 21:12:34.000000000 +0200 -+++ glibc-2.16.0/sysdeps/unix/sysv/linux/i386/sysdep.h 2012-08-01 17:56:05.000000000 +0200 -@@ -28,6 +28,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 diff --git a/toolchain/glibc/patches/sparc-darwin.patch b/toolchain/glibc/patches/sparc-darwin.patch deleted file mode 100644 index 8560a42cf..000000000 --- a/toolchain/glibc/patches/sparc-darwin.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Nur glibc-2.19.orig/configure glibc-2.19/configure ---- glibc-2.19.orig/configure 2014-02-07 10:04:38.000000000 +0100 -+++ glibc-2.19/configure 2014-04-16 23:11:01.000000000 +0200 -@@ -6228,7 +6228,7 @@ - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; } - then -- if $READELF -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then -+ if $READELF -S conftest.so | grep '\.\(rela\|rel\)\.dyn' > /dev/null; then - libc_cv_z_combreloc=yes - else - libc_cv_z_combreloc=no -- cgit v1.2.3