changeset 6331:cdcce63a1609

Merge branch 'gcc-4.8' into gcc-4.9
author Masamichi Hosoda <trueroad@users.noreply.github.com>
date Mon, 02 Feb 2015 22:45:18 +0900
parents b67157f44828 (current diff) fb79d13ed8a5 (diff)
children c649e789d138
files gub/specs/cross/gcc.py
diffstat 9 files changed, 152 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/gub/specs/cross/binutils.py	Tue Jan 20 20:44:38 2015 +0900
+++ b/gub/specs/cross/binutils.py	Mon Feb 02 22:45:18 2015 +0900
@@ -43,11 +43,6 @@
     self.system ('rm -f %(install_prefix)s%(cross_dir)s/lib/libiberty.a')
     self.system ('rm -f %(install_prefix)s%(cross_dir)s/lib64/libiberty.a')
 
-class Binutils__linux__ppc (Binutils):
-    patches = Binutils.patches + [
-        ''
-        ]
-
 class Binutils__mingw (Binutils):
     dependencies = Binutils.dependencies + [
             'tools::libtool',
--- a/gub/specs/cross/gcc.py	Tue Jan 20 20:44:38 2015 +0900
+++ b/gub/specs/cross/gcc.py	Mon Feb 02 22:45:18 2015 +0900
@@ -92,6 +92,13 @@
 
 Gcc__linux = Gcc__from__source
 
+class Gcc__linux__ppc (Gcc__linux):
+    configure_flags = (Gcc__linux.configure_flags
+                + misc.join_lines ('''
+--disable-libatomic
+--disable-libgomp
+'''))
+
 class Gcc__mingw (Gcc):
     dependencies = (Gcc.dependencies
                 + ['mingw-w64-runtime']
--- a/gub/specs/glibc-core.py	Tue Jan 20 20:44:38 2015 +0900
+++ b/gub/specs/glibc-core.py	Mon Feb 02 22:45:18 2015 +0900
@@ -39,6 +39,11 @@
 ''')
 
 class Glibc_core__linux__ppc (Glibc_core):
+    patches = Glibc_core.patches + [
+        'glibc-2.3-linux-ppc-sysdeps-generic-strtol_l.patch',
+        'glibc-2.3-powerpc-unwind-find-fde.patch',
+        'glibc-2.3-powerpc-linuxthreads-librt_multiple_threads.patch',
+        ]
         # ugh, but the gnulib=-lgcc hack does something else on ppc...
         # it (huh?) drops *-lgcc* (instead of -lgcc_eh) from libc.so
         # linkage, which then fails.
--- a/gub/specs/glibc.py	Tue Jan 20 20:44:38 2015 +0900
+++ b/gub/specs/glibc.py	Mon Feb 02 22:45:18 2015 +0900
@@ -56,6 +56,7 @@
         'glibc-2.3-misc-sys-cdefs-inline.patch',
         'glibc-2.3-elf-Makefile.patch',
         'glibc-2.3-linuxthreads-crti-crtn.patch',
+        'glibc-2.3-powerpc-sysdeps-Makefile.patch',
         ]
     dependencies = ['cross/gcc', 'glibc-core', 'tools::bison', 'tools::gzip', 'tools::perl', 'linux-headers']
     configure_flags = (target.AutoBuild.configure_flags + misc.join_lines ('''
@@ -115,6 +116,11 @@
     def LD_PRELOAD (self):
         return ''
 
+class Glibc__linux__ppc (Glibc):
+    patches = Glibc.patches + [
+        'glibc-2.3-linux-ppc-sysdeps-generic-strtol_l.patch',
+        ]
+
 class Glibc__linux__mipsel (Glibc):
     patches = Glibc.patches + [
         'glibc-2.3-mips-syscall.patch',
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/glibc-2.3-linux-ppc-sysdeps-generic-strtol_l.patch	Mon Feb 02 22:45:18 2015 +0900
@@ -0,0 +1,52 @@
+http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=2d1e6277e92bd907578cd01d017b1d6aa34485be
+
+--- a/sysdeps/generic/strtol_l.c	2004-06-16 04:54:57.000000000 +0900
++++ b/sysdeps/generic/strtol_l.c	2015-01-28 20:05:02.461060800 +0900
+@@ -168,10 +168,15 @@
+ /* Define tables of maximum values and remainders in order to detect
+    overflow.  Do this at compile-time in order to avoid the runtime
+    overhead of the division.  */
++extern const unsigned long __strtol_ul_max_tab[] attribute_hidden;
++extern const unsigned char __strtol_ul_rem_tab[] attribute_hidden;
++#if defined(QUAD) && __WORDSIZE == 32
++extern const unsigned long long __strtol_ull_max_tab[] attribute_hidden;
++extern const unsigned char __strtol_ull_rem_tab[] attribute_hidden;
++#endif
+ 
+ #define DEF(TYPE, NAME)							   \
+-  const TYPE NAME[] attribute_hidden					   \
+-	__attribute__((section(".gnu.linkonce.r." #NAME))) =		   \
++  const TYPE NAME[] attribute_hidden =					   \
+   {									   \
+     F(2), F(3), F(4), F(5), F(6), F(7), F(8), F(9), F(10), 		   \
+     F(11), F(12), F(13), F(14), F(15), F(16), F(17), F(18), F(19), F(20),  \
+@@ -179,20 +184,22 @@
+     F(31), F(32), F(33), F(34), F(35), F(36)				   \
+   }
+ 
+-#define F(X)	ULONG_MAX / X
++#if !UNSIGNED && !defined (USE_WIDE_CHAR) && !defined (QUAD)
++# define F(X)	ULONG_MAX / X
+   DEF (unsigned long, __strtol_ul_max_tab);
+-#undef F
+-#if defined(QUAD) && __WORDSIZE == 32
++# undef F
++# define F(X)	ULONG_MAX % X
++  DEF (unsigned char, __strtol_ul_rem_tab);
++# undef F
++#endif
++#if !UNSIGNED && !defined (USE_WIDE_CHAR) && defined (QUAD) \
++    && __WORDSIZE == 32
+ # define F(X)	ULONG_LONG_MAX / X
+   DEF (unsigned long long, __strtol_ull_max_tab);
+ # undef F
+ # define F(X)	ULONG_LONG_MAX % X
+   DEF (unsigned char, __strtol_ull_rem_tab);
+ # undef F
+-#else
+-# define F(X)	ULONG_MAX % X
+-  DEF (unsigned char, __strtol_ul_rem_tab);
+-# undef F
+ #endif
+ #undef DEF
+ 
--- a/patches/glibc-2.3-misc-sys-cdefs-inline.patch	Tue Jan 20 20:44:38 2015 +0900
+++ b/patches/glibc-2.3-misc-sys-cdefs-inline.patch	Mon Feb 02 22:45:18 2015 +0900
@@ -781,3 +781,36 @@
  
  /* Get some notion of the current stack.  Need not be exactly the top
     of the stack, just something somewhere in the current frame.  */
+--- a/sysdeps/powerpc/fpu/bits/mathinline.h	2004-09-30 15:16:28.000000000 +0900
++++ b/sysdeps/powerpc/fpu/bits/mathinline.h	2015-01-20 22:27:55.277405000 +0900
+@@ -22,10 +22,10 @@
+ # error "Never use <bits/mathinline.h> directly; include <math.h> instead."
+ #endif
+ 
+-#ifdef __cplusplus
++#ifndef __extern_inline
+ # define __MATH_INLINE __inline
+ #else
+-# define __MATH_INLINE extern __inline
++# define __MATH_INLINE __extern_inline
+ #endif  /* __cplusplus */
+ 
+ #if defined __GNUC__ && !defined _SOFT_FLOAT
+--- a/linuxthreads/sysdeps/powerpc/powerpc32/pt-machine.h	2003-08-01 04:15:43.000000000 +0900
++++ b/linuxthreads/sysdeps/powerpc/powerpc32/pt-machine.h	2015-01-20 22:37:34.182419800 +0900
+@@ -25,12 +25,12 @@
+ #ifndef _PT_MACHINE_H
+ #define _PT_MACHINE_H   1
+ 
++#include<misc/sys/cdefs.h>
++
+ #ifndef PT_EI
+-# define PT_EI extern inline __attribute__ ((always_inline))
++# define PT_EI __extern_inline
+ #endif
+ 
+-extern long int testandset (int *spinlock);
+-extern int __compare_and_swap (long int *p, long int oldval, long int newval);
+ 
+ /* For multiprocessor systems, we want to ensure all memory accesses
+    are completed before we reset a lock.  On other systems, we still
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/glibc-2.3-powerpc-linuxthreads-librt_multiple_threads.patch	Mon Feb 02 22:45:18 2015 +0900
@@ -0,0 +1,15 @@
+--- a/linuxthreads/Makefile	2014-11-12 18:47:29.238567100 +0900
++++ b/linuxthreads/Makefile	2015-02-01 22:28:42.566756900 +0900
+@@ -186,6 +186,8 @@
+ $(objpfx)libpthread.so: +preinit += $(addprefix $(objpfx),$(crti-objs))
+ $(objpfx)libpthread.so: +postinit += $(addprefix $(objpfx),$(crtn-objs))
+ 
++$(objpfx)libpthread_pic.a: $(objpfx)dummy_symbol.os
++
+ znodelete-yes = -DHAVE_Z_NODELETE
+ CFLAGS-mutex.c += -D__NO_WEAK_PTHREAD_ALIASES
+ CFLAGS-specific.c += -D__NO_WEAK_PTHREAD_ALIASES
+--- /dev/null	2015-02-01 22:32:29.000000000 +0900
++++ b/linuxthreads/dummy_symbol.c	2015-02-01 22:30:53.158812200 +0900
+@@ -0,0 +1 @@
++int __librt_multiple_threads;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/glibc-2.3-powerpc-sysdeps-Makefile.patch	Mon Feb 02 22:45:18 2015 +0900
@@ -0,0 +1,14 @@
+PowerPC: Remove unnecessary -mnew-mnemonics.
+
+http://sourceware.org/git/?p=glibc.git;a=commit;h=b3563932f85d60bb0d38b0a5f3b8f4abc133f890
+
+--- a/sysdeps/powerpc/Makefile	2004-02-14 12:24:52.000000000 +0900
++++ b/sysdeps/powerpc/Makefile	2015-01-20 21:18:22.894478200 +0900
+@@ -1,7 +1,3 @@
+-# We always want to use the new mnemonic syntax even if we are on a RS6000
+-# machine.
+-+cflags += -mnew-mnemonics
+-
+ ifeq ($(subdir),gmon)
+ sysdep_routines += ppc-mcount
+ endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/glibc-2.3-powerpc-unwind-find-fde.patch	Mon Feb 02 22:45:18 2015 +0900
@@ -0,0 +1,20 @@
+--- a/sysdeps/unix/sysv/linux/configure.in	2004-07-06 13:11:40.000000000 +0900
++++ b/sysdeps/unix/sysv/linux/configure.in	2015-01-31 16:09:20.614292300 +0900
+@@ -80,7 +80,6 @@
+     libc_cv_gcc_unwind_find_fde=yes
+     ;;
+   powerpc/powerpc32)
+-    libc_cv_gcc_unwind_find_fde=yes
+     arch_minimum_kernel=2.0.10
+     ;;
+   powerpc/powerpc64)
+--- a/sysdeps/unix/sysv/linux/configure	2004-07-06 13:13:42.000000000 +0900
++++ b/sysdeps/unix/sysv/linux/configure	2015-01-31 16:08:47.004884100 +0900
+@@ -120,7 +120,6 @@
+     libc_cv_gcc_unwind_find_fde=yes
+     ;;
+   powerpc/powerpc32)
+-    libc_cv_gcc_unwind_find_fde=yes
+     arch_minimum_kernel=2.0.10
+     ;;
+   powerpc/powerpc64)