From dc1507b8a254ec7fd71169ece5b8f70d13b73113 Mon Sep 17 00:00:00 2001 From: CentOS Buildsys Date: Nov 18 2013 20:19:11 +0000 Subject: import compat-gcc-44-4.4.7-4.1.el7.src.rpm --- diff --git a/.compat-gcc-44.metadata b/.compat-gcc-44.metadata new file mode 100644 index 0000000..4b13d56 --- /dev/null +++ b/.compat-gcc-44.metadata @@ -0,0 +1 @@ +205be82275401121fe8608d9bfbe31737dceb2ad SOURCES/gcc-4.4.7-20120601.tar.bz2 diff --git a/README.md b/README.md deleted file mode 100644 index 0e7897f..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 - -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/dummylib.sh b/SOURCES/dummylib.sh new file mode 100755 index 0000000..f05745f --- /dev/null +++ b/SOURCES/dummylib.sh @@ -0,0 +1,49 @@ +#!/bin/sh +if [ $# -lt 3 ]; then echo Usage: dummylib.sh orig_lib_path dummy_lib_path mapfile; exit 1; fi +TMPDIR=`mktemp -d dummylib.sh.XXXXXX` || exit 1 +F=`file -L $1` +C= +S=8 +case "$F" in + *ELF\ 64-bit*shared\ object*x86-64*) C=-m64;; + *ELF\ 32-bit*shared\ object*80?86*) C=-m32; S=4;; + *ELF\ 64-bit*shared\ object*PowerPC*) C=-m64;; + *ELF\ 32-bit*shared\ object*PowerPC*) C=-m32; S=4;; + *ELF\ 64-bit*shared\ object*cisco*) C=-m64;; + *ELF\ 32-bit*shared\ object*cisco*) C=-m32; S=4;; + *ELF\ 64-bit*shared\ object*IA-64*) C=;; + *ELF\ 64-bit*shared\ object*Alpha*) C=;; + *ELF\ 64-bit*shared\ object*390*) C=-m64;; + *ELF\ 32-bit*shared\ object*390*) C=-m31; S=4;; + *ELF\ 64-bit*shared\ object*SPARC*) C=-m64;; + *ELF\ 32-bit*shared\ object*SPARC*) C=-m32; S=4;; + *ELF\ 64-bit*shared\ object*Alpha*) C=;; +esac +readelf -Ws $1 | awk ' +/\.dynsym.* contains/ { start=1 } +/^$/ { start=0 } +/ UND / { next } +/@/ { if (start) { + fn=$8 + intfn="HACK" hack+0 + hack++ + if ($4 ~ /FUNC/) { print ".text"; size=16; print ".type " intfn ",@function" } + else if ($4 ~ /TLS/) { print ".section .tdata,\"awT\", @progbits"; size=$3; print ".type " intfn ",@object" } + else if ($5 ~ /UNIQUE/ && $4 ~ /OBJECT/) { print ".data"; size=$3; print ".type " intfn ",@gnu_unique_object" } + else if ($4 ~ /OBJECT/) { print ".data"; size=$3; print ".type " intfn ",@object" } + else if ($4 ~ /NOTYPE/) { print ".data"; size=$3 } + else exit(1); + print ".globl " intfn + if ($5 ~ /WEAK/) { print ".weak " intfn } + else if ($5 ~ /UNIQUE/ && $4 ~ /OBJECT/) {} + else if ($5 !~ /GLOBAL/) exit(1); + print intfn ": .skip " size + print ".size " intfn "," size + print ".symver " intfn "," fn +} } +' > $TMPDIR/lib.s || exit +soname=`readelf -Wd $1 | grep SONAME | sed 's/^.*\[//;s/\].*$//'` +gcc $C -shared -Wl,-soname,$soname,-version-script,$3 \ + -o $2 $TMPDIR/lib.s -nostdlib +strip $2 +rm -rf $TMPDIR diff --git a/SOURCES/gcc44-build-id.patch b/SOURCES/gcc44-build-id.patch new file mode 100644 index 0000000..f76f939 --- /dev/null +++ b/SOURCES/gcc44-build-id.patch @@ -0,0 +1,52 @@ +2007-07-22 Roland McGrath + + * config/rs6000/sysv4.h (LINK_EH_SPEC): Add --build-id for + non-relocatable link. + * config/linux.h (LINK_EH_SPEC): Likewise. + * config/alpha/elf.h (LINK_EH_SPEC): Likewise. + * config/ia64/linux.h (LINK_EH_SPEC): Likewise. + +--- gcc/config/rs6000/sysv4.h.~1~ ++++ gcc/config/rs6000/sysv4.h +@@ -906,7 +906,7 @@ extern int fixuplabelno; + %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "}}}" + + #if defined(HAVE_LD_EH_FRAME_HDR) +-# define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " ++# define LINK_EH_SPEC "%{!static:--eh-frame-hdr} %{!r:--build-id} " + #endif + + #define CPP_OS_LINUX_SPEC "-D__unix__ -D__gnu_linux__ -D__linux__ \ +--- gcc/config/linux.h.~1~ ++++ gcc/config/linux.h +@@ -85,7 +85,7 @@ Boston, MA 02110-1301, USA. */ + } while (0) + + #if defined(HAVE_LD_EH_FRAME_HDR) +-#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " ++#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} %{!r:--build-id} " + #endif + + /* Define this so we can compile MS code for use with WINE. */ +--- gcc/config/alpha/elf.h.~1~ ++++ gcc/config/alpha/elf.h +@@ -421,7 +421,7 @@ extern int alpha_this_gpdisp_sequence_nu + I imagine that other systems will catch up. In the meantime, it + doesn't harm to make sure that the data exists to be used later. */ + #if defined(HAVE_LD_EH_FRAME_HDR) +-#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " ++#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} %{!r:--build-id} " + #endif + + /* A C statement (sans semicolon) to output to the stdio stream STREAM +--- gcc/config/ia64/linux.h.~1~ ++++ gcc/config/ia64/linux.h +@@ -56,7 +56,7 @@ do { \ + Signalize that because we have fde-glibc, we don't need all C shared libs + linked against -lgcc_s. */ + #undef LINK_EH_SPEC +-#define LINK_EH_SPEC "" ++#define LINK_EH_SPEC "%{!r:--build-id} " + + #define MD_UNWIND_SUPPORT "config/ia64/linux-unwind.h" + diff --git a/SOURCES/gcc44-c++-builtin-redecl.patch b/SOURCES/gcc44-c++-builtin-redecl.patch new file mode 100644 index 0000000..1f36f1f --- /dev/null +++ b/SOURCES/gcc44-c++-builtin-redecl.patch @@ -0,0 +1,102 @@ +2007-10-02 Jakub Jelinek + + * decl.c (duplicate_decls): When redeclaring a builtin function, + keep the merged decl builtin whenever types match, even if new + decl defines a function. + + * gcc.dg/builtins-65.c: New test. + * g++.dg/ext/builtin10.C: New test. + +--- gcc/cp/decl.c.jj 2007-10-01 22:11:09.000000000 +0200 ++++ gcc/cp/decl.c 2007-10-02 11:39:46.000000000 +0200 +@@ -2001,23 +2001,21 @@ duplicate_decls (tree newdecl, tree oldd + DECL_ARGUMENTS (olddecl) = DECL_ARGUMENTS (newdecl); + DECL_RESULT (olddecl) = DECL_RESULT (newdecl); + } ++ /* If redeclaring a builtin function, it stays built in. */ ++ if (types_match && DECL_BUILT_IN (olddecl)) ++ { ++ DECL_BUILT_IN_CLASS (newdecl) = DECL_BUILT_IN_CLASS (olddecl); ++ DECL_FUNCTION_CODE (newdecl) = DECL_FUNCTION_CODE (olddecl); ++ /* If we're keeping the built-in definition, keep the rtl, ++ regardless of declaration matches. */ ++ COPY_DECL_RTL (olddecl, newdecl); ++ } + if (new_defines_function) + /* If defining a function declared with other language + linkage, use the previously declared language linkage. */ + SET_DECL_LANGUAGE (newdecl, DECL_LANGUAGE (olddecl)); + else if (types_match) + { +- /* If redeclaring a builtin function, and not a definition, +- it stays built in. */ +- if (DECL_BUILT_IN (olddecl)) +- { +- DECL_BUILT_IN_CLASS (newdecl) = DECL_BUILT_IN_CLASS (olddecl); +- DECL_FUNCTION_CODE (newdecl) = DECL_FUNCTION_CODE (olddecl); +- /* If we're keeping the built-in definition, keep the rtl, +- regardless of declaration matches. */ +- COPY_DECL_RTL (olddecl, newdecl); +- } +- + DECL_RESULT (newdecl) = DECL_RESULT (olddecl); + /* Don't clear out the arguments if we're just redeclaring a + function. */ +--- gcc/testsuite/gcc.dg/builtins-65.c.jj 2007-10-02 11:23:51.000000000 +0200 ++++ gcc/testsuite/gcc.dg/builtins-65.c 2007-10-02 11:24:12.000000000 +0200 +@@ -0,0 +1,25 @@ ++/* { dg-do compile } */ ++/* { dg-options "-O2" } */ ++ ++typedef __SIZE_TYPE__ size_t; ++extern void __chk_fail (void); ++extern int snprintf (char *, size_t, const char *, ...); ++extern inline __attribute__((gnu_inline, always_inline)) int snprintf (char *a, size_t b, const char *fmt, ...) ++{ ++ if (__builtin_object_size (a, 0) != -1UL && __builtin_object_size (a, 0) < b) ++ __chk_fail (); ++ return __builtin_snprintf (a, b, fmt, __builtin_va_arg_pack ()); ++} ++extern int snprintf (char *, size_t, const char *, ...) __asm ("mysnprintf"); ++ ++char buf[10]; ++ ++int ++main (void) ++{ ++ snprintf (buf, 10, "%d%d\n", 10, 10); ++ return 0; ++} ++ ++/* { dg-final { scan-assembler "mysnprintf" } } */ ++/* { dg-final { scan-assembler-not "__chk_fail" } } */ +--- gcc/testsuite/g++.dg/ext/builtin10.C.jj 2007-10-02 11:19:45.000000000 +0200 ++++ gcc/testsuite/g++.dg/ext/builtin10.C 2007-10-02 11:23:26.000000000 +0200 +@@ -0,0 +1,27 @@ ++// { dg-do compile } ++// { dg-options "-O2" } ++ ++typedef __SIZE_TYPE__ size_t; ++extern "C" { ++extern void __chk_fail (void); ++extern int snprintf (char *, size_t, const char *, ...); ++extern inline __attribute__((gnu_inline, always_inline)) int snprintf (char *a, size_t b, const char *fmt, ...) ++{ ++ if (__builtin_object_size (a, 0) != -1UL && __builtin_object_size (a, 0) < b) ++ __chk_fail (); ++ return __builtin_snprintf (a, b, fmt, __builtin_va_arg_pack ()); ++} ++extern int snprintf (char *, size_t, const char *, ...) __asm ("mysnprintf"); ++} ++ ++char buf[10]; ++ ++int ++main (void) ++{ ++ snprintf (buf, 10, "%d%d\n", 10, 10); ++ return 0; ++} ++ ++// { dg-final { scan-assembler "mysnprintf" } } ++// { dg-final { scan-assembler-not "__chk_fail" } } diff --git a/SOURCES/gcc44-cloog-dl.patch b/SOURCES/gcc44-cloog-dl.patch new file mode 100644 index 0000000..cb8cbc7 --- /dev/null +++ b/SOURCES/gcc44-cloog-dl.patch @@ -0,0 +1,171 @@ +2009-01-27 Jakub Jelinek + + * Makefile.in (BACKENDLIBS): Link against -ldl instead of -lcloog -lppl. + (graphite.o): Force -O, remove -fkeep-inline-functions. + * graphite.c: Include . Reference libcloog and libppl symbols + through pointers in cloog_pointers variable. + (init_cloog_pointers): New function. + (gcc_type_for_iv_of_clast_loop): Rename stmt_for argument to stmt_fora. + (graphite_transform_loops): Call init_cloog_pointers. + +--- gcc/Makefile.in.jj 2009-01-26 20:50:38.000000000 +0100 ++++ gcc/Makefile.in 2009-01-27 14:18:10.000000000 +0100 +@@ -915,7 +915,7 @@ BUILD_LIBDEPS= $(BUILD_LIBIBERTY) + # How to link with both our special library facilities + # and the system's installed libraries. + LIBS = @LIBS@ $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBIBERTY) $(LIBDECNUMBER) +-BACKENDLIBS = $(CLOOGLIBS) $(PPLLIBS) $(GMPLIBS) ++BACKENDLIBS = $(GMPLIBS) $(if $(CLOOGLIBS),-ldl) + # Any system libraries needed just for GNAT. + SYSLIBS = @GNAT_LIBEXC@ + +@@ -3076,6 +3076,9 @@ $(out_object_file): $(out_file) $(CONFIG + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ + $(out_file) $(OUTPUT_OPTION) + ++graphite.o : \ ++ ALL_CFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CFLAGS)) ++ + # Build auxiliary files that support ecoff format. + mips-tfile: mips-tfile.o version.o $(LIBDEPS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tfile.o version.o $(LIBS) +--- gcc/graphite.c.jj 2009-01-24 19:59:02.000000000 +0100 ++++ gcc/graphite.c 2009-01-27 14:52:08.000000000 +0100 +@@ -59,6 +59,110 @@ along with GCC; see the file COPYING3. + #include "cloog/cloog.h" + #include "graphite.h" + ++#include ++#define DYNSYMS \ ++ DYNSYM (cloog_block_alloc); \ ++ DYNSYM (cloog_block_list_free); \ ++ DYNSYM (cloog_block_list_malloc); \ ++ DYNSYM (cloog_clast_create); \ ++ DYNSYM (cloog_clast_free); \ ++ DYNSYM (cloog_domain_free); \ ++ DYNSYM (cloog_domain_matrix2domain); \ ++ DYNSYM (cloog_initialize); \ ++ DYNSYM (cloog_loop_malloc); \ ++ DYNSYM (cloog_matrix_alloc); \ ++ DYNSYM (cloog_matrix_copy); \ ++ DYNSYM (cloog_matrix_free); \ ++ DYNSYM (cloog_matrix_print); \ ++ DYNSYM (cloog_names_malloc); \ ++ DYNSYM (cloog_names_scalarize); \ ++ DYNSYM (cloog_options_free); \ ++ DYNSYM (cloog_options_malloc); \ ++ DYNSYM (cloog_program_dump_cloog); \ ++ DYNSYM (cloog_program_extract_scalars); \ ++ DYNSYM (cloog_program_free); \ ++ DYNSYM (cloog_program_generate); \ ++ DYNSYM (cloog_program_malloc); \ ++ DYNSYM (cloog_program_print); \ ++ DYNSYM (cloog_program_scatter); \ ++ DYNSYM (cloog_statement_alloc); \ ++ DYNSYM (ppl_finalize); \ ++ DYNSYM (pprint); \ ++ DYNSYM (stmt_block); \ ++ DYNSYM (stmt_for); \ ++ DYNSYM (stmt_guard); \ ++ DYNSYM (stmt_root); \ ++ DYNSYM (stmt_user); ++static struct ++{ ++ bool inited; ++ void *h; ++#define DYNSYM(x) __typeof (x) *p_##x ++ DYNSYMS ++#undef DYNSYM ++} cloog_pointers; ++ ++#define cloog_block_alloc (*cloog_pointers.p_cloog_block_alloc) ++#define cloog_block_list_free (*cloog_pointers.p_cloog_block_list_free) ++#define cloog_block_list_malloc (*cloog_pointers.p_cloog_block_list_malloc) ++#define cloog_clast_create (*cloog_pointers.p_cloog_clast_create) ++#define cloog_clast_free (*cloog_pointers.p_cloog_clast_free) ++#define cloog_domain_free (*cloog_pointers.p_cloog_domain_free) ++#define cloog_domain_matrix2domain (*cloog_pointers.p_cloog_domain_matrix2domain) ++#define cloog_initialize (*cloog_pointers.p_cloog_initialize) ++#define cloog_loop_malloc (*cloog_pointers.p_cloog_loop_malloc) ++#define cloog_matrix_alloc (*cloog_pointers.p_cloog_matrix_alloc) ++#define cloog_matrix_copy (*cloog_pointers.p_cloog_matrix_copy) ++#define cloog_matrix_free (*cloog_pointers.p_cloog_matrix_free) ++#define cloog_matrix_print (*cloog_pointers.p_cloog_matrix_print) ++#define cloog_names_malloc (*cloog_pointers.p_cloog_names_malloc) ++#define cloog_names_scalarize (*cloog_pointers.p_cloog_names_scalarize) ++#define cloog_options_free (*cloog_pointers.p_cloog_options_free) ++#define cloog_options_malloc (*cloog_pointers.p_cloog_options_malloc) ++#define cloog_program_dump_cloog (*cloog_pointers.p_cloog_program_dump_cloog) ++#define cloog_program_extract_scalars (*cloog_pointers.p_cloog_program_extract_scalars) ++#define cloog_program_free (*cloog_pointers.p_cloog_program_free) ++#define cloog_program_generate (*cloog_pointers.p_cloog_program_generate) ++#define cloog_program_malloc (*cloog_pointers.p_cloog_program_malloc) ++#define cloog_program_print (*cloog_pointers.p_cloog_program_print) ++#define cloog_program_scatter (*cloog_pointers.p_cloog_program_scatter) ++#define cloog_statement_alloc (*cloog_pointers.p_cloog_statement_alloc) ++#define ppl_finalize (*cloog_pointers.p_ppl_finalize) ++#define pprint (*cloog_pointers.p_pprint) ++#define stmt_block (*cloog_pointers.p_stmt_block) ++#define stmt_for (*cloog_pointers.p_stmt_for) ++#define stmt_guard (*cloog_pointers.p_stmt_guard) ++#define stmt_root (*cloog_pointers.p_stmt_root) ++#define stmt_user (*cloog_pointers.p_stmt_user) ++ ++#define cloog_finalize (*cloog_pointers.p_ppl_finalize) ++ ++static bool ++init_cloog_pointers (void) ++{ ++ void *h; ++ ++ if (cloog_pointers.inited) ++ return cloog_pointers.h != NULL; ++ h = dlopen ("libcloog.so.0", RTLD_LAZY); ++ cloog_pointers.h = h; ++ if (h == NULL) ++ return false; ++#define DYNSYM(x) \ ++ do \ ++ { \ ++ union { __typeof (cloog_pointers.p_##x) p; void *q; } u; \ ++ u.q = dlsym (h, #x); \ ++ if (u.q == NULL) \ ++ return false; \ ++ cloog_pointers.p_##x = u.p; \ ++ } \ ++ while (0) ++ DYNSYMS ++#undef DYNSYM ++ return true; ++} ++ + static VEC (scop_p, heap) *current_scops; + + /* Converts a GMP constant V to a tree and returns it. */ +@@ -4019,10 +4151,10 @@ clast_get_body_of_loop (struct clast_stm + STMT. */ + + static tree +-gcc_type_for_iv_of_clast_loop (struct clast_for *stmt_for) ++gcc_type_for_iv_of_clast_loop (struct clast_for *stmt_fora) + { +- struct clast_user_stmt *stmt = clast_get_body_of_loop ((struct clast_stmt *) stmt_for); +- const char *cloog_iv = stmt_for->iterator; ++ struct clast_user_stmt *stmt = clast_get_body_of_loop ((struct clast_stmt *) stmt_fora); ++ const char *cloog_iv = stmt_fora->iterator; + CloogStatement *cs = stmt->statement; + graphite_bb_p gbb = (graphite_bb_p) cloog_statement_usr (cs); + +@@ -6061,6 +6193,12 @@ graphite_transform_loops (void) + if (number_of_loops () <= 1) + return; + ++ if (!init_cloog_pointers ()) ++ { ++ sorry ("Graphite loop optimizations cannot be used"); ++ return; ++ } ++ + current_scops = VEC_alloc (scop_p, heap, 3); + recompute_all_dominators (); + diff --git a/SOURCES/gcc44-hack.patch b/SOURCES/gcc44-hack.patch new file mode 100644 index 0000000..8719d17 --- /dev/null +++ b/SOURCES/gcc44-hack.patch @@ -0,0 +1,66 @@ +--- libada/Makefile.in.jj 2009-01-14 12:07:35.000000000 +0100 ++++ libada/Makefile.in 2009-01-15 14:25:33.000000000 +0100 +@@ -69,18 +69,40 @@ version := $(shell cat $(srcdir)/../gcc/ + libsubdir := $(libdir)/gcc/$(target_noncanonical)/$(version)$(MULTISUBDIR) + ADA_RTS_DIR=$(GCC_DIR)/ada/rts$(subst /,_,$(MULTISUBDIR)) + ++DEFAULTMULTIFLAGS := ++ifeq ($(MULTISUBDIR),) ++targ:=$(subst -, ,$(target)) ++arch:=$(word 1,$(targ)) ++ifeq ($(words $(targ)),2) ++osys:=$(word 2,$(targ)) ++else ++osys:=$(word 3,$(targ)) ++endif ++ifeq ($(strip $(filter-out i%86 x86_64 powerpc% ppc% s390% sparc% linux%, $(arch) $(osys))),) ++ifeq ($(shell $(CC) $(CFLAGS) -print-multi-os-directory),../lib64) ++DEFAULTMULTIFLAGS := -m64 ++else ++ifeq ($(strip $(filter-out s390%, $(arch))),) ++DEFAULTMULTIFLAGS := -m31 ++else ++DEFAULTMULTIFLAGS := -m32 ++endif ++endif ++endif ++endif ++ + # exeext should not be used because it's the *host* exeext. We're building + # a *target* library, aren't we?!? Likewise for CC. Still, provide bogus + # definitions just in case something slips through the safety net provided + # by recursive make invocations in gcc/ada/Makefile.in + LIBADA_FLAGS_TO_PASS = \ + "MAKEOVERRIDES=" \ +- "LDFLAGS=$(LDFLAGS)" \ ++ "LDFLAGS=$(strip $(LDFLAGS) $(DEFAULTMULTIFLAGS))" \ + "LN_S=$(LN_S)" \ + "SHELL=$(SHELL)" \ +- "GNATLIBFLAGS=$(GNATLIBFLAGS) $(MULTIFLAGS)" \ +- "GNATLIBCFLAGS=$(GNATLIBCFLAGS) $(MULTIFLAGS)" \ +- "GNATLIBCFLAGS_FOR_C=$(GNATLIBCFLAGS_FOR_C) $(MULTIFLAGS)" \ ++ "GNATLIBFLAGS=$(strip $(GNATLIBFLAGS) $(MULTIFLAGS) $(DEFAULTMULTIFLAGS))" \ ++ "GNATLIBCFLAGS=$(strip $(GNATLIBCFLAGS) $(MULTIFLAGS) $(DEFAULTMULTIFLAGS))" \ ++ "GNATLIBCFLAGS_FOR_C=$(strip $(GNATLIBCFLAGS_FOR_C) $(MULTIFLAGS) $(DEFAULTMULTIFLAGS))" \ + "TARGET_LIBGCC2_CFLAGS=$(TARGET_LIBGCC2_CFLAGS)" \ + "THREAD_KIND=$(THREAD_KIND)" \ + "TRACE=$(TRACE)" \ +@@ -91,7 +113,7 @@ LIBADA_FLAGS_TO_PASS = \ + "exeext=.exeext.should.not.be.used " \ + 'CC=the.host.compiler.should.not.be.needed' \ + "GCC_FOR_TARGET=$(CC)" \ +- "CFLAGS=$(CFLAGS) $(WARN_CFLAGS)" ++ "CFLAGS=$(strip $(CFLAGS) $(DEFAULTMULTIFLAGS) $(WARN_CFLAGS))" + + # Rules to build gnatlib. + .PHONY: gnatlib gnatlib-plain gnatlib-sjlj gnatlib-zcx gnatlib-shared oscons +--- gcc/ada/make.adb 2008-11-07 23:00:32.000000000 +0100 ++++ gcc/ada/make.adb 2009-01-16 17:55:02.000000000 +0100 +@@ -8039,6 +8039,7 @@ package body Make is + or else Argv (2 .. Argv'Last) = "pg" + or else (Argv (2) = 'm' and then Argv'Last > 2) + or else (Argv (2) = 'f' and then Argv'Last > 2) ++ or else (Argv'Last >= 8 and then Argv (2 .. 8) = "-param=") + then + Add_Switch (Argv, Compiler, And_Save => And_Save); + Add_Switch (Argv, Linker, And_Save => And_Save); diff --git a/SOURCES/gcc44-i386-libgomp.patch b/SOURCES/gcc44-i386-libgomp.patch new file mode 100644 index 0000000..5d1eea8 --- /dev/null +++ b/SOURCES/gcc44-i386-libgomp.patch @@ -0,0 +1,61 @@ +Build i386.rpm libgomp and libsupc++.a(guard.o) as i486+, pre-i486 +hardware isn't supported because NPTL doesn't support it anyway. + +--- libgomp/configure.tgt.jj 2008-01-10 20:53:48.000000000 +0100 ++++ libgomp/configure.tgt 2008-03-27 12:44:51.000000000 +0100 +@@ -44,14 +44,14 @@ if test $enable_linux_futex = yes; then + ;; + + # Note that bare i386 is not included here. We need cmpxchg. +- i[456]86-*-linux*) ++ i[3456]86-*-linux*) + config_path="linux/x86 linux posix" + case " ${CC} ${CFLAGS} " in + *" -m64 "*) + ;; + *) + if test -z "$with_arch"; then +- XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}" ++ XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic" + fi + esac + ;; +@@ -63,7 +63,7 @@ if test $enable_linux_futex = yes; then + config_path="linux/x86 linux posix" + case " ${CC} ${CFLAGS} " in + *" -m32 "*) +- XCFLAGS="${XCFLAGS} -march=i486 -mtune=i686" ++ XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic" + ;; + esac + ;; +--- libstdc++-v3/libsupc++/guard.cc.jj 2008-03-01 00:58:24.000000000 +0100 ++++ libstdc++-v3/libsupc++/guard.cc 2008-03-27 14:08:44.000000000 +0100 +@@ -35,6 +35,27 @@ + #include + #include + #include ++#if defined __i386__ && !defined _GLIBCXX_ATOMIC_BUILTINS_4 ++# define _GLIBCXX_ATOMIC_BUILTINS_4 1 ++# define __sync_val_compare_and_swap(a, b, c) \ ++ ({ \ ++ typedef char sltast[sizeof (*a) == sizeof (int) ? 1 : -1]; \ ++ int sltas; \ ++ __asm __volatile ("lock; cmpxchgl %3, (%1)" \ ++ : "=a" (sltas) \ ++ : "r" (a), "0" (b), "r" (c) : "memory"); \ ++ sltas; \ ++ }) ++# define __sync_lock_test_and_set(a, b) \ ++ ({ \ ++ typedef char sltast[sizeof (*a) == sizeof (int) ? 1 : -1]; \ ++ int sltas; \ ++ __asm __volatile ("xchgl (%1), %0" \ ++ : "=r" (sltas) \ ++ : "r" (a), "0" (b) : "memory"); \ ++ sltas; \ ++ }) ++#endif + #if defined(__GTHREADS) && defined(__GTHREAD_HAS_COND) \ + && defined(_GLIBCXX_ATOMIC_BUILTINS_4) && defined(_GLIBCXX_HAVE_LINUX_FUTEX) + # include diff --git a/SOURCES/gcc44-ia64-libunwind.patch b/SOURCES/gcc44-ia64-libunwind.patch new file mode 100644 index 0000000..8e10979 --- /dev/null +++ b/SOURCES/gcc44-ia64-libunwind.patch @@ -0,0 +1,538 @@ +2004-11-27 Jakub Jelinek + + * config.gcc (ia64*-*-linux*): If native and libelf is installed, + use ia64/t-glibc-no-libunwind instead of the other t-*unwind* + fragments. + * config/ia64/t-glibc-no-libunwind: New file. + * config/ia64/change-symver.c: New file. + * config/ia64/unwind-ia64.c: If USE_SYMVER_GLOBAL and SHARED, + define _Unwind_* to __symverglobal_Unwind_*. + (alias): Undefine. + (symverglobal): Define. Use it on _Unwind_*. + * config/ia64/mkmap-symver-multi.awk: New file. + * config/ia64/libgcc-ia64-no-libunwind.ver: New file. + +--- gcc/config.gcc.jj 2004-10-04 08:55:44.000000000 -0400 ++++ gcc/config.gcc 2004-11-13 05:23:50.000000000 -0500 +@@ -1185,9 +1185,16 @@ ia64*-*-freebsd*) + ;; + ia64*-*-linux*) + tm_file="${tm_file} dbxelf.h elfos.h svr4.h linux.h ia64/sysv4.h ia64/linux.h" +- tmake_file="${tmake_file} ia64/t-ia64 t-libunwind ia64/t-glibc" +- if test x$with_system_libunwind != xyes ; then +- tmake_file="${tmake_file} t-libunwind-elf ia64/t-glibc-libunwind" ++ tmake_file="${tmake_file} ia64/t-ia64" ++ if test x${target} = x${host} && test x${target} = x${build} \ ++ && grep gelf_getverdef /usr/include/gelf.h > /dev/null 2>&1 \ ++ && test -f /usr/lib/libelf.so; then ++ tmake_file="${tmake_file} ia64/t-glibc-no-libunwind" ++ else ++ tmake_file="${tmake_file} t-libunwind ia64/t-glibc" ++ if test x$with_system_libunwind != xyes ; then ++ tmake_file="${tmake_file} t-libunwind-elf ia64/t-glibc-libunwind" ++ fi + fi + target_cpu_default="MASK_GNU_AS|MASK_GNU_LD" + extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o" +--- gcc/config/ia64/t-glibc-no-libunwind.jj 2004-02-18 10:27:36.000000000 -0500 ++++ gcc/config/ia64/t-glibc-no-libunwind 2004-11-15 09:56:33.000000000 -0500 +@@ -0,0 +1,30 @@ ++# Don't use system libunwind library on IA-64 GLIBC based system, ++# but make _Unwind_* symbols unversioned, so that created programs ++# are usable even when libgcc_s uses libunwind. ++LIB2ADDEH += $(srcdir)/config/ia64/fde-glibc.c ++SHLIB_MAPFILES += $(srcdir)/config/ia64/libgcc-ia64-no-libunwind.ver ++SHLIB_MKMAP = $(srcdir)/config/ia64/mkmap-symver-multi.awk ++ ++SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \ ++ -Wl,--soname=$(SHLIB_SONAME) \ ++ -Wl,--version-script=$(SHLIB_MAP) \ ++ -o $(SHLIB_DIR)/$(SHLIB_SONAME).tmp @multilib_flags@ $(SHLIB_OBJS) -lc && \ ++ rm -f $(SHLIB_DIR)/$(SHLIB_SOLINK) && \ ++ if [ -f $(SHLIB_DIR)/$(SHLIB_SONAME) ]; then \ ++ mv -f $(SHLIB_DIR)/$(SHLIB_SONAME) \ ++ $(SHLIB_DIR)/$(SHLIB_SONAME).backup; \ ++ else true; fi && \ ++ gcc -O2 -o $(SHLIB_DIR)/$(SHLIB_SONAME).tweak \ ++ $$(gcc_srcdir)/config/ia64/change-symver.c -lelf && \ ++ $(SHLIB_DIR)/$(SHLIB_SONAME).tweak $(SHLIB_DIR)/$(SHLIB_SONAME).tmp \ ++ GCC_3.4.2 _GLOBAL_ \ ++ _Unwind_GetGR _Unwind_RaiseException _Unwind_GetRegionStart _Unwind_SetIP \ ++ _Unwind_GetIP _Unwind_GetLanguageSpecificData _Unwind_Resume \ ++ _Unwind_DeleteException _Unwind_SetGR _Unwind_ForcedUnwind \ ++ _Unwind_Backtrace _Unwind_FindEnclosingFunction _Unwind_GetCFA \ ++ _Unwind_Resume_or_Rethrow _Unwind_GetBSP && \ ++ rm -f $(SHLIB_DIR)/$(SHLIB_SONAME).tweak && \ ++ mv $(SHLIB_DIR)/$(SHLIB_SONAME).tmp $(SHLIB_DIR)/$(SHLIB_SONAME) && \ ++ $(LN_S) $(SHLIB_SONAME) $(SHLIB_DIR)/$(SHLIB_SOLINK) ++ ++TARGET_LIBGCC2_CFLAGS += -DUSE_SYMVER_GLOBAL +--- gcc/config/ia64/change-symver.c.jj 2004-02-18 10:27:36.000000000 -0500 ++++ gcc/config/ia64/change-symver.c 2004-11-13 05:23:50.000000000 -0500 +@@ -0,0 +1,211 @@ ++#define _GNU_SOURCE 1 ++#define _FILE_OFFSET_BITS 64 ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++int ++compute_veridx (const char *name, Elf *elf, Elf_Data *verd, GElf_Shdr *verd_shdr) ++{ ++ if (strcmp (name, "_GLOBAL_") == 0) ++ return 1; ++ ++ int cnt; ++ size_t offset = 0; ++ for (cnt = verd_shdr->sh_info; --cnt >= 0; ) ++ { ++ GElf_Verdef defmem; ++ GElf_Verdef *def; ++ GElf_Verdaux auxmem; ++ GElf_Verdaux *aux; ++ unsigned int auxoffset; ++ ++ /* Get the data at the next offset. */ ++ def = gelf_getverdef (verd, offset, &defmem); ++ if (def == NULL) ++ break; ++ ++ auxoffset = offset + def->vd_aux; ++ aux = gelf_getverdaux (verd, auxoffset, &auxmem); ++ if (aux == NULL) ++ break; ++ ++ if (strcmp (name, elf_strptr (elf, verd_shdr->sh_link, ++ aux->vda_name)) == 0) ++ return def->vd_ndx; ++ ++ /* Find the next offset. */ ++ offset += def->vd_next; ++ } ++ ++ return -1; ++} ++ ++int ++main (int argc, char **argv) ++{ ++ if (argc < 4) ++ error (1, 0, "Usage: change_symver library from_symver to_symver symbol...\nExample: change_symver libfoo.so FOO_1.0 *global* bar baz"); ++ ++ const char *fname = argv[1]; ++ ++ /* Open the file. */ ++ int fd; ++ fd = open (fname, O_RDWR); ++ if (fd == -1) ++ error (1, errno, fname); ++ ++ elf_version (EV_CURRENT); ++ ++ /* Now get the ELF descriptor. */ ++ Elf *elf = elf_begin (fd, ELF_C_READ_MMAP, NULL); ++ if (elf == NULL || elf_kind (elf) != ELF_K_ELF) ++ error (1, 0, "Couldn't open %s: %s", fname, elf_errmsg (-1)); ++ ++ size_t shstrndx; ++ /* Get the section header string table index. */ ++ if (elf_getshstrndx (elf, &shstrndx) < 0) ++ error (1, 0, "cannot get shstrndx from %s", fname); ++ ++ GElf_Ehdr ehdr_mem; ++ GElf_Ehdr *ehdr; ++ ++ /* We need the ELF header in a few places. */ ++ ehdr = gelf_getehdr (elf, &ehdr_mem); ++ if (ehdr == NULL) ++ error (1, 0, "couldn't get ELF headers %s: %s", fname, elf_errmsg (-1)); ++ ++ Elf_Scn *scn = NULL; ++ GElf_Shdr shdr_mem, verd_shdr, ver_shdr, dynsym_shdr; ++ Elf_Data *ver = NULL, *verd = NULL, *dynsym = NULL; ++ ++ while ((scn = elf_nextscn (elf, scn)) != NULL) ++ { ++ GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); ++ ++ if (shdr == NULL) ++ error (1, 0, "couldn't get shdr from %s", fname); ++ ++ if ((shdr->sh_flags & SHF_ALLOC) != 0) ++ { ++ const char *name = elf_strptr (elf, shstrndx, shdr->sh_name); ++ Elf_Data **p; ++ ++ if (strcmp (name, ".gnu.version") == 0) ++ { ++ p = &ver; ++ ver_shdr = *shdr; ++ } ++ else if (strcmp (name, ".gnu.version_d") == 0) ++ { ++ p = &verd; ++ verd_shdr = *shdr; ++ } ++ else if (strcmp (name, ".dynsym") == 0) ++ { ++ p = &dynsym; ++ dynsym_shdr = *shdr; ++ } ++ else ++ continue; ++ ++ if (*p != NULL) ++ error (1, 0, "Two %s sections in %s", name, fname); ++ *p = elf_getdata (scn, NULL); ++ if (*p == NULL || elf_getdata (scn, *p) != NULL) ++ error (1, 0, "No data or non-contiguous data in %s section in %s", ++ name, fname); ++ } ++ } ++ ++ if (ver == NULL || verd == NULL || dynsym == NULL) ++ error (1, 0, "Couldn't find one of the needed sections in %s", fname); ++ ++ int from_idx = compute_veridx (argv[2], elf, verd, &verd_shdr); ++ if (from_idx == -1) ++ error (1, 0, "Could not find symbol version %s in %s", argv[2], fname); ++ ++ int to_idx = compute_veridx (argv[3], elf, verd, &verd_shdr); ++ if (to_idx == -1) ++ error (1, 0, "Could not find symbol version %s in %s", argv[3], fname); ++ ++ if (dynsym_shdr.sh_entsize != gelf_fsize (elf, ELF_T_SYM, 1, ehdr->e_version) ++ || dynsym_shdr.sh_size % dynsym_shdr.sh_entsize ++ || ver_shdr.sh_entsize != 2 ++ || (ver_shdr.sh_size & 1) ++ || dynsym_shdr.sh_size / dynsym_shdr.sh_entsize != ver_shdr.sh_size / 2) ++ error (1, 0, "Unexpected sh_size or sh_entsize in %s", fname); ++ ++ size_t nentries = ver_shdr.sh_size / 2; ++ size_t cnt; ++ GElf_Versym array[nentries]; ++ for (cnt = 0; cnt < nentries; ++cnt) ++ { ++ GElf_Versym vsymmem; ++ GElf_Versym *vsym; ++ ++ vsym = gelf_getversym (ver, cnt, &vsymmem); ++ if (vsym == NULL) ++ error (1, 0, "gelt_getversym failed in %s: %s", fname, elf_errmsg (-1)); ++ ++ array[cnt] = *vsym; ++ if (*vsym != from_idx) ++ continue; ++ ++ GElf_Sym sym_mem; ++ GElf_Sym *sym; ++ sym = gelf_getsym (dynsym, cnt, &sym_mem); ++ if (sym == NULL) ++ error (1, 0, "gelt_getsym failed in %s: %s", fname, elf_errmsg (-1)); ++ ++ const char *name = elf_strptr (elf, dynsym_shdr.sh_link, sym->st_name); ++ ++ int argn; ++ for (argn = 4; argn < argc; ++argn) ++ if (fnmatch (argv[argn], name, 0) == 0) ++ { ++ array[cnt] = to_idx; ++ break; ++ } ++ } ++ ++ if (sizeof (array[0]) != 2) ++ abort (); ++ ++#if __BYTE_ORDER == __LITTLE_ENDIAN ++ if (ehdr->e_ident[EI_DATA] == ELFDATA2LSB) ++ ; ++ else if (ehdr->e_ident[EI_DATA] == ELFDATA2MSB) ++#elif __BYTE_ORDER == __BIG_ENDIAN ++ if (ehdr->e_ident[EI_DATA] == ELFDATA2MSB) ++ ; ++ else if (ehdr->e_ident[EI_DATA] == ELFDATA2LSB) ++#else ++# error Unsupported endianity ++#endif ++ { ++ for (cnt = 0; cnt < nentries; ++cnt) ++ array[cnt] = ((array[cnt] & 0xff) << 8) | ((array[cnt] & 0xff00) >> 8); ++ } ++ else ++ error (1, 0, "Unknown EI_DATA %d in %s", ehdr->e_ident[EI_DATA], fname); ++ ++ if (elf_end (elf) != 0) ++ error (1, 0, "couldn't close %s: %s", fname, elf_errmsg (-1)); ++ ++ if (lseek (fd, ver_shdr.sh_offset, SEEK_SET) != (off_t) ver_shdr.sh_offset) ++ error (1, 0, "failed to seek to %zd in %s", (size_t) ver_shdr.sh_offset, ++ fname); ++ ++ if (write (fd, array, 2 * nentries) != (ssize_t) (2 * nentries)) ++ error (1, 0, "failed to write .gnu.version section into %s", fname); ++ ++ close (fd); ++ return 0; ++} +--- gcc/config/ia64/unwind-ia64.c.jj 2004-10-04 08:55:57.000000000 -0400 ++++ gcc/config/ia64/unwind-ia64.c 2004-11-15 09:07:45.000000000 -0500 +@@ -51,6 +51,51 @@ + #define UNW_FLAG_UHANDLER(x) ((x) & 0x0000000200000000L) + #define UNW_LENGTH(x) ((x) & 0x00000000ffffffffL) + ++#if defined (USE_SYMVER_GLOBAL) && defined (SHARED) ++extern _Unwind_Reason_Code __symverglobal_Unwind_Backtrace ++ (_Unwind_Trace_Fn, void *); ++extern void __symverglobal_Unwind_DeleteException ++ (struct _Unwind_Exception *); ++extern void * __symverglobal_Unwind_FindEnclosingFunction (void *); ++extern _Unwind_Reason_Code __symverglobal_Unwind_ForcedUnwind ++ (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *); ++extern _Unwind_Word __symverglobal_Unwind_GetCFA ++ (struct _Unwind_Context *); ++extern _Unwind_Word __symverglobal_Unwind_GetBSP ++ (struct _Unwind_Context *); ++extern _Unwind_Word __symverglobal_Unwind_GetGR ++ (struct _Unwind_Context *, int ); ++extern _Unwind_Ptr __symverglobal_Unwind_GetIP (struct _Unwind_Context *); ++extern void *__symverglobal_Unwind_GetLanguageSpecificData ++ (struct _Unwind_Context *); ++extern _Unwind_Ptr __symverglobal_Unwind_GetRegionStart ++ (struct _Unwind_Context *); ++extern _Unwind_Reason_Code __symverglobal_Unwind_RaiseException ++ (struct _Unwind_Exception *); ++extern void __symverglobal_Unwind_Resume (struct _Unwind_Exception *); ++extern _Unwind_Reason_Code __symverglobal_Unwind_Resume_or_Rethrow ++ (struct _Unwind_Exception *); ++extern void __symverglobal_Unwind_SetGR ++ (struct _Unwind_Context *, int, _Unwind_Word); ++extern void __symverglobal_Unwind_SetIP ++ (struct _Unwind_Context *, _Unwind_Ptr); ++#define _Unwind_Backtrace __symverglobal_Unwind_Backtrace ++#define _Unwind_DeleteException __symverglobal_Unwind_DeleteException ++#define _Unwind_FindEnclosingFunction __symverglobal_Unwind_FindEnclosingFunction ++#define _Unwind_ForcedUnwind __symverglobal_Unwind_ForcedUnwind ++#define _Unwind_GetBSP __symverglobal_Unwind_GetBSP ++#define _Unwind_GetCFA __symverglobal_Unwind_GetCFA ++#define _Unwind_GetGR __symverglobal_Unwind_GetGR ++#define _Unwind_GetIP __symverglobal_Unwind_GetIP ++#define _Unwind_GetLanguageSpecificData __symverglobal_Unwind_GetLanguageSpecificData ++#define _Unwind_GetRegionStart __symverglobal_Unwind_GetRegionStart ++#define _Unwind_RaiseException __symverglobal_Unwind_RaiseException ++#define _Unwind_Resume __symverglobal_Unwind_Resume ++#define _Unwind_Resume_or_Rethrow __symverglobal_Unwind_Resume_or_Rethrow ++#define _Unwind_SetGR __symverglobal_Unwind_SetGR ++#define _Unwind_SetIP __symverglobal_Unwind_SetIP ++#endif ++ + enum unw_application_register + { + UNW_AR_BSP, +@@ -2402,4 +2447,44 @@ alias (_Unwind_SetGR); + alias (_Unwind_SetIP); + #endif + ++#if defined (USE_SYMVER_GLOBAL) && defined (SHARED) ++#undef alias ++#define symverglobal(name, version) \ ++__typeof (__symverglobal##name) __symverlocal##name \ ++ __attribute__ ((alias ("__symverglobal" #name))); \ ++__asm__ (".symver __symverglobal" #name"," #name "@@GCC_3.4.2");\ ++__asm__ (".symver __symverlocal" #name"," #name "@" #version) ++ ++#undef _Unwind_Backtrace ++#undef _Unwind_DeleteException ++#undef _Unwind_FindEnclosingFunction ++#undef _Unwind_ForcedUnwind ++#undef _Unwind_GetBSP ++#undef _Unwind_GetCFA ++#undef _Unwind_GetGR ++#undef _Unwind_GetIP ++#undef _Unwind_GetLanguageSpecificData ++#undef _Unwind_GetRegionStart ++#undef _Unwind_RaiseException ++#undef _Unwind_Resume ++#undef _Unwind_Resume_or_Rethrow ++#undef _Unwind_SetGR ++#undef _Unwind_SetIP ++symverglobal (_Unwind_Backtrace, GCC_3.3); ++symverglobal (_Unwind_DeleteException, GCC_3.0); ++symverglobal (_Unwind_FindEnclosingFunction, GCC_3.3); ++symverglobal (_Unwind_ForcedUnwind, GCC_3.0); ++symverglobal (_Unwind_GetBSP, GCC_3.3.2); ++symverglobal (_Unwind_GetCFA, GCC_3.3); ++symverglobal (_Unwind_GetGR, GCC_3.0); ++symverglobal (_Unwind_GetIP, GCC_3.0); ++symverglobal (_Unwind_GetLanguageSpecificData, GCC_3.0); ++symverglobal (_Unwind_GetRegionStart, GCC_3.0); ++symverglobal (_Unwind_RaiseException, GCC_3.0); ++symverglobal (_Unwind_Resume, GCC_3.0); ++symverglobal (_Unwind_Resume_or_Rethrow, GCC_3.3); ++symverglobal (_Unwind_SetGR, GCC_3.0); ++symverglobal (_Unwind_SetIP, GCC_3.0); ++#endif ++ + #endif +--- gcc/config/ia64/mkmap-symver-multi.awk.jj 2004-02-18 10:27:36.000000000 -0500 ++++ gcc/config/ia64/mkmap-symver-multi.awk 2004-11-15 09:46:50.000000000 -0500 +@@ -0,0 +1,133 @@ ++# Generate an ELF symbol version map a-la Solaris and GNU ld. ++# Contributed by Richard Henderson ++# ++# This file is part of GCC. ++# ++# GCC is free software; you can redistribute it and/or modify it under ++# the terms of the GNU General Public License as published by the Free ++# Software Foundation; either version 2, or (at your option) any later ++# version. ++# ++# GCC is distributed in the hope that it will be useful, but WITHOUT ++# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ++# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public ++# License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with GCC; see the file COPYING. If not, write to the Free ++# Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA ++# 02110-1301, USA. ++ ++BEGIN { ++ state = "nm"; ++ sawsymbol = 0; ++} ++ ++# Remove comment and blank lines. ++/^ *#/ || /^ *$/ { ++ next; ++} ++ ++# We begin with nm input. Collect the set of symbols that are present ++# so that we can not emit them into the final version script -- Solaris ++# complains at us if we do. ++ ++state == "nm" && /^%%/ { ++ state = "ver"; ++ next; ++} ++ ++state == "nm" && ($1 == "U" || $2 == "U") { ++ next; ++} ++ ++state == "nm" && NF == 3 { ++ if ($3 ~ /^[^@]*@GCC_[0-9.]*$/) { ++ def[$3] = 1 ++ tl=$3 ++ sub(/^.*@/,"",tl) ++ ver[$3] = tl ++ } else { ++ sub(/@@?GCC_[0-9.]*$/,"",$3) ++ def[$3] = 1; ++ } ++ sawsymbol = 1; ++ next; ++} ++ ++state == "nm" { ++ next; ++} ++ ++# Now we process a simplified variant of the Solaris symbol version ++# script. We have one symbol per line, no semicolons, simple markers ++# for beginning and ending each section, and %inherit markers for ++# describing version inheritence. A symbol may appear in more than ++# one symbol version, and the last seen takes effect. ++ ++NF == 3 && $1 == "%inherit" { ++ inherit[$2] = $3; ++ next; ++} ++ ++NF == 2 && $2 == "{" { ++ libs[$1] = 1; ++ thislib = $1; ++ next; ++} ++ ++$1 == "}" { ++ thislib = ""; ++ next; ++} ++ ++{ ++ ver[$1] = thislib; ++ next; ++} ++ ++END { ++ if (!sawsymbol) ++ { ++ print "No symbols seen -- broken or mis-installed nm?" | "cat 1>&2"; ++ exit 1; ++ } ++ for (l in libs) ++ output(l); ++} ++ ++function output(lib) { ++ if (done[lib]) ++ return; ++ done[lib] = 1; ++ if (inherit[lib]) ++ output(inherit[lib]); ++ ++ empty=1 ++ for (sym in ver) ++ if ((ver[sym] == lib) && (sym in def)) ++ { ++ if (empty) ++ { ++ printf("%s {\n", lib); ++ printf(" global:\n"); ++ empty = 0; ++ } ++ symp = sym; ++ sub(/@GCC_[0-9.]*$/,"",symp); ++ printf("\t%s;\n", symp); ++ if (dotsyms) ++ printf("\t.%s;\n", symp); ++ } ++ ++ if (empty) ++ { ++ for (l in libs) ++ if (inherit[l] == lib) ++ inherit[l] = inherit[lib]; ++ } ++ else if (inherit[lib]) ++ printf("} %s;\n", inherit[lib]); ++ else ++ printf ("\n local:\n\t*;\n};\n"); ++} +--- gcc/config/ia64/libgcc-ia64-no-libunwind.ver.jj 2004-02-18 10:27:36.000000000 -0500 ++++ gcc/config/ia64/libgcc-ia64-no-libunwind.ver 2004-11-15 09:19:56.000000000 -0500 +@@ -0,0 +1,17 @@ ++GCC_3.4.2 { ++ _Unwind_GetGR ++ _Unwind_RaiseException ++ _Unwind_GetRegionStart ++ _Unwind_SetIP ++ _Unwind_GetIP ++ _Unwind_GetLanguageSpecificData ++ _Unwind_Resume ++ _Unwind_DeleteException ++ _Unwind_SetGR ++ _Unwind_ForcedUnwind ++ _Unwind_Backtrace ++ _Unwind_FindEnclosingFunction ++ _Unwind_GetCFA ++ _Unwind_Resume_or_Rethrow ++ _Unwind_GetBSP ++} diff --git a/SOURCES/gcc44-java-nomulti.patch b/SOURCES/gcc44-java-nomulti.patch new file mode 100644 index 0000000..17334aa --- /dev/null +++ b/SOURCES/gcc44-java-nomulti.patch @@ -0,0 +1,44 @@ +--- libjava/configure.ac.jj 2007-12-07 17:55:50.000000000 +0100 ++++ libjava/configure.ac 2007-12-07 18:36:56.000000000 +0100 +@@ -82,6 +82,13 @@ AC_ARG_ENABLE(java-maintainer-mode, + [allow rebuilding of .class and .h files])) + AM_CONDITIONAL(JAVA_MAINTAINER_MODE, test "$enable_java_maintainer_mode" = yes) + ++AC_ARG_ENABLE(libjava-multilib, ++ AS_HELP_STRING([--enable-libjava-multilib], [build libjava as multilib])) ++if test "$enable_libjava_multilib" = no; then ++ multilib=no ++ ac_configure_args="$ac_configure_args --disable-multilib" ++fi ++ + # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX. + GCC_NO_EXECUTABLES + +--- libjava/configure.jj 2007-12-07 17:55:50.000000000 +0100 ++++ libjava/configure 2007-12-07 18:39:58.000000000 +0100 +@@ -1021,6 +1021,8 @@ Optional Features: + default=yes + --enable-java-maintainer-mode + allow rebuilding of .class and .h files ++ --enable-libjava-multilib ++ build libjava as multilib + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --enable-maintainer-mode enable make rules and dependencies not useful +@@ -1973,6 +1975,16 @@ else + fi + + ++# Check whether --enable-libjava-multilib was given. ++if test "${enable_libjava_multilib+set}" = set; then ++ enableval=$enable_libjava_multilib; ++fi ++ ++if test "$enable_libjava_multilib" = no; then ++ multilib=no ++ ac_configure_args="$ac_configure_args --disable-multilib" ++fi ++ + # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX. + + diff --git a/SOURCES/gcc44-libgomp-omp_h-multilib.patch b/SOURCES/gcc44-libgomp-omp_h-multilib.patch new file mode 100644 index 0000000..d0e98d1 --- /dev/null +++ b/SOURCES/gcc44-libgomp-omp_h-multilib.patch @@ -0,0 +1,17 @@ +2008-06-09 Jakub Jelinek + + * omp.h.in (omp_nest_lock_t): Fix up for Linux multilibs. + +--- libgomp/omp.h.in.jj 2008-06-09 13:34:05.000000000 +0200 ++++ libgomp/omp.h.in 2008-06-09 13:34:48.000000000 +0200 +@@ -42,8 +42,8 @@ typedef struct + + typedef struct + { +- unsigned char _x[@OMP_NEST_LOCK_SIZE@] +- __attribute__((__aligned__(@OMP_NEST_LOCK_ALIGN@))); ++ unsigned char _x[8 + sizeof (void *)] ++ __attribute__((__aligned__(sizeof (void *)))); + } omp_nest_lock_t; + #endif + diff --git a/SOURCES/gcc44-libstdc++-docs.patch b/SOURCES/gcc44-libstdc++-docs.patch new file mode 100644 index 0000000..45caafe --- /dev/null +++ b/SOURCES/gcc44-libstdc++-docs.patch @@ -0,0 +1,47 @@ +--- libstdc++-v3/doc/html/index.html 2009-01-14 12:06:37.000000000 +0100 ++++ libstdc++-v3/doc/html/index.html 2009-05-06 09:17:30.000000000 +0200 +@@ -12,7 +12,8 @@ +
+

The GNU C++ Library Documentation

+ +-

Copyright 2008 FSF

++

Release 4.4.0

++

Copyright 2008, 2009 FSF

+ +

+ Permission is granted to copy, distribute and/or modify this +--- libstdc++-v3/doc/html/api.html 2009-04-20 21:21:15.000000000 +0200 ++++ libstdc++-v3/doc/html/api.html 2009-05-06 09:17:24.000000000 +0200 +@@ -17,27 +17,12 @@ useful for examining the signatures of p + the library classes, finding out what is in a particular include + file, looking at inheritance diagrams, etc. +

+-The source-level documentation for the most recent releases can be +-viewed online: +-

  • +- for the 3.4 release ++The source-level documentation can be viewed here: ++

    ++

    + This generated HTML collection, as above, is also available for download in the libstdc++ snapshots directory at + <URL:ftp://gcc.gnu.org/pub/gcc/libstdc++/doxygen/>. diff --git a/SOURCES/gcc44-libtool-no-rpath.patch b/SOURCES/gcc44-libtool-no-rpath.patch new file mode 100644 index 0000000..466c661 --- /dev/null +++ b/SOURCES/gcc44-libtool-no-rpath.patch @@ -0,0 +1,27 @@ +libtool sucks. +--- ltmain.sh.jj 2007-12-07 14:53:21.000000000 +0100 ++++ ltmain.sh 2008-09-05 21:51:48.000000000 +0200 +@@ -5394,6 +5394,7 @@ EOF + rpath="$finalize_rpath" + test "$mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do ++ case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then +@@ -6071,6 +6072,7 @@ EOF + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do ++ case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then +@@ -6120,6 +6122,7 @@ EOF + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do ++ case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then diff --git a/SOURCES/gcc44-no-add-needed.patch b/SOURCES/gcc44-no-add-needed.patch new file mode 100644 index 0000000..4570c0c --- /dev/null +++ b/SOURCES/gcc44-no-add-needed.patch @@ -0,0 +1,52 @@ +2010-02-08 Roland McGrath + + * config/rs6000/sysv4.h (LINK_EH_SPEC): Pass --no-add-needed to the + linker. + * config/linux.h (LINK_EH_SPEC): Likewise. + * config/alpha/elf.h (LINK_EH_SPEC): Likewise. + * config/ia64/linux.h (LINK_EH_SPEC): Likewise. + +--- gcc/config/alpha/elf.h.~1~ ++++ gcc/config/alpha/elf.h +@@ -421,7 +421,7 @@ extern int alpha_this_gpdisp_sequence_nu + I imagine that other systems will catch up. In the meantime, it + doesn't harm to make sure that the data exists to be used later. */ + #if defined(HAVE_LD_EH_FRAME_HDR) +-#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} %{!r:--build-id} " ++#define LINK_EH_SPEC "--no-add-needed %{!static:--eh-frame-hdr} %{!r:--build-id} " + #endif + + /* A C statement (sans semicolon) to output to the stdio stream STREAM +--- gcc/config/ia64/linux.h.~1~ ++++ gcc/config/ia64/linux.h +@@ -58,7 +58,7 @@ do { \ + Signalize that because we have fde-glibc, we don't need all C shared libs + linked against -lgcc_s. */ + #undef LINK_EH_SPEC +-#define LINK_EH_SPEC "%{!r:--build-id} " ++#define LINK_EH_SPEC "--no-add-needed %{!r:--build-id} " + + #define MD_UNWIND_SUPPORT "config/ia64/linux-unwind.h" + +--- gcc/config/linux.h.~1~ ++++ gcc/config/linux.h +@@ -89,7 +89,7 @@ see the files COPYING3 and COPYING.RUNTI + } while (0) + + #if defined(HAVE_LD_EH_FRAME_HDR) +-#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} %{!r:--build-id} " ++#define LINK_EH_SPEC "--no-add-needed %{!static:--eh-frame-hdr} %{!r:--build-id} " + #endif + + /* Define this so we can compile MS code for use with WINE. */ +--- gcc/config/rs6000/sysv4.h.~1~ ++++ gcc/config/rs6000/sysv4.h +@@ -917,7 +917,7 @@ SVR4_ASM_SPEC \ + %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "}}}" + + #if defined(HAVE_LD_EH_FRAME_HDR) +-# define LINK_EH_SPEC "%{!static:--eh-frame-hdr} %{!r:--build-id} " ++# define LINK_EH_SPEC "--no-add-needed %{!static:--eh-frame-hdr} %{!r:--build-id} " + #endif + + #define CPP_OS_LINUX_SPEC "-D__unix__ -D__gnu_linux__ -D__linux__ \ diff --git a/SOURCES/gcc44-ppc32-retaddr.patch b/SOURCES/gcc44-ppc32-retaddr.patch new file mode 100644 index 0000000..e9ae1bc --- /dev/null +++ b/SOURCES/gcc44-ppc32-retaddr.patch @@ -0,0 +1,86 @@ +2005-11-28 Jakub Jelinek + + * config/rs6000/rs6000.c (rs6000_return_addr): If COUNT == 0, + read word RETURN_ADDRESS_OFFSET bytes above arg_pointer_rtx + instead of doing an extran indirection from frame_pointer_rtx. + + * gcc.dg/20051128-1.c: New test. + +--- gcc/config/rs6000/rs6000.c.jj 2005-11-26 14:38:01.000000000 +0100 ++++ gcc/config/rs6000/rs6000.c 2005-11-28 20:32:18.000000000 +0100 +@@ -13166,17 +13166,22 @@ rs6000_return_addr (int count, rtx frame + don't try to be too clever here. */ + if (count != 0 || (DEFAULT_ABI != ABI_AIX && flag_pic)) + { ++ rtx x; + cfun->machine->ra_needs_full_frame = 1; + +- return +- gen_rtx_MEM +- (Pmode, +- memory_address +- (Pmode, +- plus_constant (copy_to_reg +- (gen_rtx_MEM (Pmode, +- memory_address (Pmode, frame))), +- RETURN_ADDRESS_OFFSET))); ++ if (count == 0) ++ { ++ gcc_assert (frame == frame_pointer_rtx); ++ x = arg_pointer_rtx; ++ } ++ else ++ { ++ x = memory_address (Pmode, frame); ++ x = copy_to_reg (gen_rtx_MEM (Pmode, x)); ++ } ++ ++ x = plus_constant (x, RETURN_ADDRESS_OFFSET); ++ return gen_rtx_MEM (Pmode, memory_address (Pmode, x)); + } + + cfun->machine->ra_need_lr = 1; +--- gcc/testsuite/gcc.dg/20051128-1.c.jj 2005-10-10 11:21:41.096999000 +0200 ++++ gcc/testsuite/gcc.dg/20051128-1.c 2005-11-28 12:30:57.000000000 +0100 +@@ -0,0 +1,41 @@ ++/* { dg-do run } */ ++/* { dg-options "-O2 -fpic" } */ ++ ++extern void exit (int); ++extern void abort (void); ++ ++int b; ++ ++struct A ++{ ++ void *pad[147]; ++ void *ra, *h; ++ long o; ++}; ++ ++void ++__attribute__((noinline)) ++foo (struct A *a, void *x) ++{ ++ __builtin_memset (a, 0, sizeof (a)); ++ if (!b) ++ exit (0); ++} ++ ++void ++__attribute__((noinline)) ++bar (void) ++{ ++ struct A a; ++ ++ __builtin_unwind_init (); ++ foo (&a, __builtin_return_address (0)); ++} ++ ++int ++main (void) ++{ ++ bar (); ++ abort (); ++ return 0; ++} diff --git a/SOURCES/gcc44-ppc64-aixdesc.patch b/SOURCES/gcc44-ppc64-aixdesc.patch new file mode 100644 index 0000000..b9f4a8b --- /dev/null +++ b/SOURCES/gcc44-ppc64-aixdesc.patch @@ -0,0 +1,24 @@ +2009-09-16 Jakub Jelinek + + * config/rs6000/sysv4.h (FP_SAVE_INLINE, GP_SAVE_INLINE): Disable + out of line gpr/fpr saving for -m64 -Os -mcall-aixdesc. + +--- gcc/config/rs6000/sysv4.h.jj 2009-09-16 14:46:19.000000000 +0200 ++++ gcc/config/rs6000/sysv4.h 2009-09-16 14:46:19.000000000 +0200 +@@ -273,12 +273,14 @@ do { \ + /* Define cutoff for using external functions to save floating point. + When optimizing for size, use external functions when profitable. */ + #define FP_SAVE_INLINE(FIRST_REG) (optimize_size \ ++ && (!TARGET_64BIT || !DOT_SYMBOLS) \ + ? ((FIRST_REG) == 62 \ + || (FIRST_REG) == 63) \ + : (FIRST_REG) < 64) + /* And similarly for general purpose registers. */ +-#define GP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) < 32 \ +- && !optimize_size) ++#define GP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) < 32 \ ++ && (!optimize_size \ ++ || (TARGET_64BIT && DOT_SYMBOLS))) + + /* Put jump tables in read-only memory, rather than in .text. */ + #define JUMP_TABLES_IN_TEXT_SECTION 0 diff --git a/SOURCES/gcc44-pr33763.patch b/SOURCES/gcc44-pr33763.patch new file mode 100644 index 0000000..86c8ac7 --- /dev/null +++ b/SOURCES/gcc44-pr33763.patch @@ -0,0 +1,153 @@ +2007-11-06 Jakub Jelinek + + PR tree-optimization/33763 + * gcc.dg/pr33763.c: New test. + * g++.dg/opt/inline13.C: New test. + +2007-11-06 Jan Hubicka + + PR tree-optimization/33763 + * tree-inline.c (expand_call_inline): Silently ignore always_inline + attribute for redefined extern inline functions. + +--- gcc/tree-inline.c.jj 2007-11-06 09:29:04.000000000 +0100 ++++ gcc/tree-inline.c 2007-11-06 16:19:12.000000000 +0100 +@@ -3157,6 +3157,12 @@ expand_call_inline (basic_block bb, gimp + goto egress; + + if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) ++ /* For extern inline functions that get redefined we always ++ silently ignored alway_inline flag. Better behaviour would ++ be to be able to keep both bodies and use extern inline body ++ for inlining, but we can't do that because frontends overwrite ++ the body. */ ++ && !cg_edge->callee->local.redefined_extern_inline + /* Avoid warnings during early inline pass. */ + && cgraph_global_info_ready) + { +--- gcc/testsuite/gcc.dg/pr33763.c.jj 2007-11-06 16:19:12.000000000 +0100 ++++ gcc/testsuite/gcc.dg/pr33763.c 2007-11-06 16:19:12.000000000 +0100 +@@ -0,0 +1,60 @@ ++/* PR tree-optimization/33763 */ ++/* { dg-do compile } */ ++/* { dg-options "-O2" } */ ++ ++typedef struct ++{ ++ void *a; ++ void *b; ++} T; ++extern void *foo (const char *, const char *); ++extern void *bar (void *, const char *, T); ++extern int baz (const char *, int); ++ ++extern inline __attribute__ ((always_inline, gnu_inline)) int ++baz (const char *x, int y) ++{ ++ return 2; ++} ++ ++int ++baz (const char *x, int y) ++{ ++ return 1; ++} ++ ++int xa, xb; ++ ++static void * ++inl (const char *x, const char *y) ++{ ++ T t = { &xa, &xb }; ++ int *f = (int *) __builtin_malloc (sizeof (int)); ++ const char *z; ++ int o = 0; ++ void *r = 0; ++ ++ for (z = y; *z; z++) ++ { ++ if (*z == 'r') ++ o |= 1; ++ if (*z == 'w') ++ o |= 2; ++ } ++ if (o == 1) ++ *f = baz (x, 0); ++ if (o == 2) ++ *f = baz (x, 1); ++ if (o == 3) ++ *f = baz (x, 2); ++ ++ if (o && *f > 0) ++ r = bar (f, "w", t); ++ return r; ++} ++ ++void * ++foo (const char *x, const char *y) ++{ ++ return inl (x, y); ++} +--- gcc/testsuite/g++.dg/opt/inline13.C.jj 2007-11-06 16:20:20.000000000 +0100 ++++ gcc/testsuite/g++.dg/opt/inline13.C 2007-11-06 16:21:30.000000000 +0100 +@@ -0,0 +1,60 @@ ++// PR tree-optimization/33763 ++// { dg-do compile } ++// { dg-options "-O2" } ++ ++typedef struct ++{ ++ void *a; ++ void *b; ++} T; ++extern void *foo (const char *, const char *); ++extern void *bar (void *, const char *, T); ++extern int baz (const char *, int); ++ ++extern inline __attribute__ ((always_inline, gnu_inline)) int ++baz (const char *x, int y) ++{ ++ return 2; ++} ++ ++int ++baz (const char *x, int y) ++{ ++ return 1; ++} ++ ++int xa, xb; ++ ++static void * ++inl (const char *x, const char *y) ++{ ++ T t = { &xa, &xb }; ++ int *f = (int *) __builtin_malloc (sizeof (int)); ++ const char *z; ++ int o = 0; ++ void *r = 0; ++ ++ for (z = y; *z; z++) ++ { ++ if (*z == 'r') ++ o |= 1; ++ if (*z == 'w') ++ o |= 2; ++ } ++ if (o == 1) ++ *f = baz (x, 0); ++ if (o == 2) ++ *f = baz (x, 1); ++ if (o == 3) ++ *f = baz (x, 2); ++ ++ if (o && *f > 0) ++ r = bar (f, "w", t); ++ return r; ++} ++ ++void * ++foo (const char *x, const char *y) ++{ ++ return inl (x, y); ++} diff --git a/SOURCES/gcc44-pr38757.patch b/SOURCES/gcc44-pr38757.patch new file mode 100644 index 0000000..805996f --- /dev/null +++ b/SOURCES/gcc44-pr38757.patch @@ -0,0 +1,125 @@ +2009-03-18 Jakub Jelinek + + PR debug/38757 + * langhooks.h (struct lang_hooks): Add source_language langhook. + * langhooks-def.h (LANG_HOOKS_SOURCE_LANGUAGE): Define to NULL. + (LANG_HOOKS_INITIALIZER): Add LANG_HOOKS_SOURCE_LANGUAGE. + * c-lang.c (c_source_language): New function. + (LANG_HOOKS_SOURCE_LANGUAGE): Define. + * dwarf2out.c (add_prototyped_attribute): Add DW_AT_prototype + also for DW_LANG_{C,C99,ObjC}. + (gen_compile_unit_die): Use lang_hooks.source_language () to + determine if DW_LANG_C99 or DW_LANG_C89 should be returned. + +--- gcc/langhooks.h.jj 2009-03-02 09:45:47.000000000 +0100 ++++ gcc/langhooks.h 2009-03-18 12:53:24.000000000 +0100 +@@ -1,5 +1,5 @@ + /* The lang_hooks data structure. +- Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 ++ Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + Free Software Foundation, Inc. + + This file is part of GCC. +@@ -414,6 +414,10 @@ struct lang_hooks + if in the process TREE_CONSTANT or TREE_SIDE_EFFECTS need updating. */ + tree (*expr_to_decl) (tree expr, bool *tc, bool *se); + ++ /* Return year of the source language standard version if the FE supports ++ multiple versions of the standard. */ ++ int (*source_language) (void); ++ + /* Whenever you add entries here, make sure you adjust langhooks-def.h + and langhooks.c accordingly. */ + }; +--- gcc/langhooks-def.h.jj 2009-03-02 09:45:47.000000000 +0100 ++++ gcc/langhooks-def.h 2009-03-18 12:53:45.000000000 +0100 +@@ -1,5 +1,5 @@ + /* Default macros to initialize the lang_hooks data structure. +- Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 ++ Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + Free Software Foundation, Inc. + Contributed by Alexandre Oliva + +@@ -113,6 +113,7 @@ extern void lhd_omp_firstprivatize_type_ + #define LANG_HOOKS_EXPR_TO_DECL lhd_expr_to_decl + #define LANG_HOOKS_TO_TARGET_CHARSET lhd_to_target_charset + #define LANG_HOOKS_INIT_TS lhd_do_nothing ++#define LANG_HOOKS_SOURCE_LANGUAGE NULL + + /* Attribute hooks. */ + #define LANG_HOOKS_ATTRIBUTE_TABLE NULL +@@ -270,6 +271,7 @@ extern tree lhd_make_node (enum tree_cod + LANG_HOOKS_BUILTIN_FUNCTION_EXT_SCOPE, \ + LANG_HOOKS_INIT_TS, \ + LANG_HOOKS_EXPR_TO_DECL, \ ++ LANG_HOOKS_SOURCE_LANGUAGE, \ + } + + #endif /* GCC_LANG_HOOKS_DEF_H */ +--- gcc/c-lang.c.jj 2009-02-20 15:06:14.000000000 +0100 ++++ gcc/c-lang.c 2009-03-18 13:33:41.000000000 +0100 +@@ -1,6 +1,6 @@ + /* Language-specific hook definitions for C front end. + Copyright (C) 1991, 1995, 1997, 1998, +- 1999, 2000, 2001, 2003, 2004, 2005, 2007, 2008 ++ 1999, 2000, 2001, 2003, 2004, 2005, 2007, 2008, 2009 + Free Software Foundation, Inc. + + This file is part of GCC. +@@ -37,6 +37,12 @@ along with GCC; see the file COPYING3. + + enum c_language_kind c_language = clk_c; + ++static int ++c_source_language (void) ++{ ++ return flag_isoc99 ? 1999 : 1989; ++} ++ + /* Lang hooks common to C and ObjC are declared in c-objc-common.h; + consequently, there should be very few hooks below. */ + +@@ -44,6 +50,8 @@ enum c_language_kind c_language = clk_c; + #define LANG_HOOKS_NAME "GNU C" + #undef LANG_HOOKS_INIT + #define LANG_HOOKS_INIT c_objc_common_init ++#undef LANG_HOOKS_SOURCE_LANGUAGE ++#define LANG_HOOKS_SOURCE_LANGUAGE c_source_language + + /* Each front end provides its own lang hook initializer. */ + const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; +--- gcc/dwarf2out.c.jj 2009-03-17 13:06:29.000000000 +0100 ++++ gcc/dwarf2out.c 2009-03-18 12:55:36.000000000 +0100 +@@ -14286,9 +14286,18 @@ add_bit_size_attribute (dw_die_ref die, + static inline void + add_prototyped_attribute (dw_die_ref die, tree func_type) + { +- if (get_AT_unsigned (comp_unit_die, DW_AT_language) == DW_LANG_C89 +- && TYPE_ARG_TYPES (func_type) != NULL) +- add_AT_flag (die, DW_AT_prototyped, 1); ++ switch (get_AT_unsigned (comp_unit_die, DW_AT_language)) ++ { ++ case DW_LANG_C: ++ case DW_LANG_C89: ++ case DW_LANG_C99: ++ case DW_LANG_ObjC: ++ if (TYPE_ARG_TYPES (func_type) != NULL) ++ add_AT_flag (die, DW_AT_prototyped, 1); ++ break; ++ default: ++ break; ++ } + } + + /* Add an 'abstract_origin' attribute below a given DIE. The DIE is found +@@ -16290,6 +16299,10 @@ gen_compile_unit_die (const char *filena + language = DW_LANG_ObjC; + else if (strcmp (language_string, "GNU Objective-C++") == 0) + language = DW_LANG_ObjC_plus_plus; ++ else if (strcmp (language_string, "GNU C") == 0 ++ && lang_hooks.source_language ++ && lang_hooks.source_language () >= 1999) ++ language = DW_LANG_C99; + } + + add_AT_unsigned (die, DW_AT_language, language); diff --git a/SOURCES/gcc44-pr43680.patch b/SOURCES/gcc44-pr43680.patch new file mode 100644 index 0000000..ab816a4 --- /dev/null +++ b/SOURCES/gcc44-pr43680.patch @@ -0,0 +1,301 @@ +2012-05-03 Jason Merrill + + PR c++/43680 + * c.opt (-fstrict-enums): New. + * doc/invoke.texi (C++ Dialect Options): Document -fstrict-enums. + * tree-vrp.c (needs_overflow_infinity): TREE_TYPE of an + ENUMERAL_TYPE is not an integer base type. + (vrp_val_min, vrp_val_max): Likewise. + (extract_range_from_binary_expr): Likewise. + + * decl.c (finish_enum): Use the TYPE_MIN_VALUE and TYPE_MAX_VALUE + from the selected underlying type unless -fstrict-enums. Set + ENUM_UNDERLYING_TYPE to have the restricted range. + * cvt.c (type_promotes_to): Use ENUM_UNDERLYING_TYPE. + * class.c (check_bitfield_decl): Likewise. + +--- gcc/c.opt ++++ gcc/c.opt +@@ -759,6 +759,10 @@ fstats + C++ ObjC++ + Display statistics accumulated during compilation + ++fstrict-enums ++C++ ObjC++ Optimization Var(flag_strict_enums) ++Assume that values of enumeration type are always within the minimum range of that type ++ + fstrict-prototype + C++ ObjC++ + +--- gcc/cp/class.c ++++ gcc/cp/class.c +@@ -2727,14 +2727,8 @@ check_bitfield_decl (tree field) + && TREE_CODE (type) != BOOLEAN_TYPE) + warning (0, "width of %q+D exceeds its type", field); + else if (TREE_CODE (type) == ENUMERAL_TYPE +- && (0 > compare_tree_int (w, +- tree_int_cst_min_precision +- (TYPE_MIN_VALUE (type), +- TYPE_UNSIGNED (type))) +- || 0 > compare_tree_int (w, +- tree_int_cst_min_precision +- (TYPE_MAX_VALUE (type), +- TYPE_UNSIGNED (type))))) ++ && (0 > (compare_tree_int ++ (w, TYPE_PRECISION (ENUM_UNDERLYING_TYPE (type)))))) + warning (0, "%q+D is too small to hold all values of %q#T", field, type); + } + +--- gcc/cp/cvt.c ++++ gcc/cp/cvt.c +@@ -662,7 +662,8 @@ ocp_convert (tree type, tree expr, int convtype, int flags) + the original value is within the range of the enumeration + values. Otherwise, the resulting enumeration value is + unspecified. */ +- if (TREE_CODE (expr) == INTEGER_CST && !int_fits_type_p (expr, type)) ++ if (TREE_CODE (expr) == INTEGER_CST ++ && !int_fits_type_p (expr, ENUM_UNDERLYING_TYPE (type))) + warning (OPT_Wconversion, + "the result of the conversion is unspecified because " + "%qE is outside the range of type %qT", +@@ -1251,6 +1252,8 @@ type_promotes_to (tree type) + int precision = MAX (TYPE_PRECISION (type), + TYPE_PRECISION (integer_type_node)); + tree totype = c_common_type_for_size (precision, 0); ++ if (TREE_CODE (type) == ENUMERAL_TYPE) ++ type = ENUM_UNDERLYING_TYPE (type); + if (TYPE_UNSIGNED (type) + && ! int_fits_type_p (TYPE_MAX_VALUE (type), totype)) + type = c_common_type_for_size (precision, 1); +--- gcc/cp/decl.c ++++ gcc/cp/decl.c +@@ -11070,12 +11070,6 @@ finish_enum (tree enumtype) + tree maxnode; + tree value; + tree t; +- bool unsignedp; +- bool use_short_enum; +- int lowprec; +- int highprec; +- int precision; +- integer_type_kind itk; + tree underlying_type = NULL_TREE; + bool fixed_underlying_type_p + = ENUM_UNDERLYING_TYPE (enumtype) != NULL_TREE; +@@ -11138,17 +11132,19 @@ finish_enum (tree enumtype) + the enumeration had a single enumerator with value 0. */ + minnode = maxnode = integer_zero_node; + +- /* Compute the number of bits require to represent all values of the +- enumeration. We must do this before the type of MINNODE and +- MAXNODE are transformed, since tree_int_cst_min_precision relies +- on the TREE_TYPE of the value it is passed. */ +- unsignedp = tree_int_cst_sgn (minnode) >= 0; +- lowprec = tree_int_cst_min_precision (minnode, unsignedp); +- highprec = tree_int_cst_min_precision (maxnode, unsignedp); +- precision = MAX (lowprec, highprec); +- + if (!fixed_underlying_type_p) + { ++ /* Compute the number of bits require to represent all values of the ++ enumeration. We must do this before the type of MINNODE and ++ MAXNODE are transformed, since tree_int_cst_min_precision relies ++ on the TREE_TYPE of the value it is passed. */ ++ bool unsignedp = tree_int_cst_sgn (minnode) >= 0; ++ int lowprec = tree_int_cst_min_precision (minnode, unsignedp); ++ int highprec = tree_int_cst_min_precision (maxnode, unsignedp); ++ int precision = MAX (lowprec, highprec); ++ unsigned int itk; ++ bool use_short_enum; ++ + /* Determine the underlying type of the enumeration. + + [dcl.enum] +@@ -11195,42 +11191,51 @@ finish_enum (tree enumtype) + The value of sizeof() applied to an enumeration type, an object + of an enumeration type, or an enumerator, is the value of sizeof() + applied to the underlying type. */ ++ TYPE_MIN_VALUE (enumtype) = TYPE_MIN_VALUE (underlying_type); ++ TYPE_MAX_VALUE (enumtype) = TYPE_MAX_VALUE (underlying_type); + TYPE_SIZE (enumtype) = TYPE_SIZE (underlying_type); + TYPE_SIZE_UNIT (enumtype) = TYPE_SIZE_UNIT (underlying_type); + SET_TYPE_MODE (enumtype, TYPE_MODE (underlying_type)); ++ TYPE_PRECISION (enumtype) = TYPE_PRECISION (underlying_type); + TYPE_ALIGN (enumtype) = TYPE_ALIGN (underlying_type); + TYPE_USER_ALIGN (enumtype) = TYPE_USER_ALIGN (underlying_type); + TYPE_UNSIGNED (enumtype) = TYPE_UNSIGNED (underlying_type); + +- /* Set the underlying type of the enumeration type to the +- computed enumeration type, restricted to the enumerator +- values. */ +- ENUM_UNDERLYING_TYPE (enumtype) = copy_node (underlying_type); +- set_min_and_max_values_for_integral_type ++ /* Compute the minimum and maximum values for the type. ++ ++ [dcl.enum] ++ ++ For an enumeration where emin is the smallest enumerator and emax ++ is the largest, the values of the enumeration are the values of the ++ underlying type in the range bmin to bmax, where bmin and bmax are, ++ respectively, the smallest and largest values of the smallest bit- ++ field that can store emin and emax. */ ++ ++ /* The middle-end currently assumes that types with TYPE_PRECISION ++ narrower than their underlying type are suitably zero or sign ++ extended to fill their mode. Similarly, it assumes that the front ++ end assures that a value of a particular type must be within ++ TYPE_MIN_VALUE and TYPE_MAX_VALUE. ++ ++ We used to set these fields based on bmin and bmax, but that led ++ to invalid assumptions like optimizing away bounds checking. So ++ now we just set the TYPE_PRECISION, TYPE_MIN_VALUE, and ++ TYPE_MAX_VALUE to the values for the mode above and only restrict ++ the ENUM_UNDERLYING_TYPE for the benefit of diagnostics. */ ++ ENUM_UNDERLYING_TYPE (enumtype) ++ = build_distinct_type_copy (underlying_type); ++ TYPE_PRECISION (ENUM_UNDERLYING_TYPE (enumtype)) = precision; ++ set_min_and_max_values_for_integral_type + (ENUM_UNDERLYING_TYPE (enumtype), precision, unsignedp); ++ ++ /* If -fstrict-enums, still constrain TYPE_MIN/MAX_VALUE. */ ++ if (flag_strict_enums) ++ set_min_and_max_values_for_integral_type (enumtype, precision, ++ unsignedp); + } + else + underlying_type = ENUM_UNDERLYING_TYPE (enumtype); + +- /* Compute the minimum and maximum values for the type. +- +- [dcl.enum] +- +- For an enumeration where emin is the smallest enumerator and emax +- is the largest, the values of the enumeration are the values of the +- underlying type in the range bmin to bmax, where bmin and bmax are, +- respectively, the smallest and largest values of the smallest bit- +- field that can store emin and emax. */ +- +- /* The middle-end currently assumes that types with TYPE_PRECISION +- narrower than their underlying type are suitably zero or sign +- extended to fill their mode. g++ doesn't make these guarantees. +- Until the middle-end can represent such paradoxical types, we +- set the TYPE_PRECISION to the width of the underlying type. */ +- TYPE_PRECISION (enumtype) = TYPE_PRECISION (underlying_type); +- +- set_min_and_max_values_for_integral_type (enumtype, precision, unsignedp); +- + /* Convert each of the enumerators to the type of the underlying + type of the enumeration. */ + for (values = TYPE_VALUES (enumtype); values; values = TREE_CHAIN (values)) +--- gcc/doc/invoke.texi ++++ gcc/doc/invoke.texi +@@ -1877,6 +1877,15 @@ unambiguous base classes. + Emit statistics about front-end processing at the end of the compilation. + This information is generally only useful to the G++ development team. + ++@item -fstrict-enums ++@opindex fstrict-enums ++Allow the compiler to optimize using the assumption that a value of ++enumeration type can only be one of the values of the enumeration (as ++defined in the C++ standard; basically, a value which can be ++represented in the minimum number of bits needed to represent all the ++enumerators). This assumption may not be valid if the program uses a ++cast to convert an arbitrary integer value to the enumeration type. ++ + @item -ftemplate-depth-@var{n} + @opindex ftemplate-depth + Set the maximum instantiation depth for template classes to @var{n}. +--- gcc/tree-vrp.c ++++ gcc/tree-vrp.c +@@ -130,7 +130,7 @@ vrp_val_max (const_tree type) + return NULL_TREE; + + /* For integer sub-types the values for the base type are relevant. */ +- if (TREE_TYPE (type)) ++ if (TREE_CODE (type) == INTEGER_TYPE && TREE_TYPE (type)) + type = TREE_TYPE (type); + + return TYPE_MAX_VALUE (type); +@@ -145,7 +145,7 @@ vrp_val_min (const_tree type) + return NULL_TREE; + + /* For integer sub-types the values for the base type are relevant. */ +- if (TREE_TYPE (type)) ++ if (TREE_CODE (type) == INTEGER_TYPE && TREE_TYPE (type)) + type = TREE_TYPE (type); + + return TYPE_MIN_VALUE (type); +@@ -192,7 +192,8 @@ needs_overflow_infinity (const_tree type) + && !TYPE_OVERFLOW_WRAPS (type) + /* Integer sub-types never overflow as they are never + operands of arithmetic operators. */ +- && !(TREE_TYPE (type) && TREE_TYPE (type) != type)); ++ && !(TREE_CODE (type) == INTEGER_TYPE ++ && TREE_TYPE (type) && TREE_TYPE (type) != type)); + } + + /* Return whether TYPE can support our overflow infinity +@@ -2720,9 +2721,9 @@ extract_range_from_unary_expr (value_range_t *vr, enum tree_code code, + + /* Always use base-types here. This is important for the + correct signedness. */ +- if (TREE_TYPE (inner_type)) ++ if (TREE_CODE (inner_type) == INTEGER_TYPE && TREE_TYPE (inner_type)) + inner_type = TREE_TYPE (inner_type); +- if (TREE_TYPE (outer_type)) ++ if (TREE_CODE (outer_type) == INTEGER_TYPE && TREE_TYPE (outer_type)) + outer_type = TREE_TYPE (outer_type); + + /* If VR0 is varying and we increase the type precision, assume +--- gcc/testsuite/g++.dg/opt/enum2.C ++++ gcc/testsuite/g++.dg/opt/enum2.C +@@ -0,0 +1,21 @@ ++// PR c++/43680 ++// Test that we don't make excessively aggressive assumptions about what ++// values an enum variable can have. ++// { dg-options "-O2 -fPIC" } ++// { dg-do run } ++ ++extern "C" void abort (); ++ ++enum E { A, B, C, D }; ++ ++void ++CheckE(const E value) ++{ ++ long v = value; ++ if (v <= D) ++ abort (); ++} ++ ++int main() { ++ CheckE(static_cast(5)); ++} +--- gcc/testsuite/g++.dg/warn/Wswitch-1.C ++++ gcc/testsuite/g++.dg/warn/Wswitch-1.C +@@ -50,13 +50,13 @@ foo (int i, int j, enum e ei, enum e ej, enum e ek, enum e el, + { + case e1: return 1; + case e2: return 2; +- case 3: return 3; /* { dg-warning "exceeds maximum value" } */ ++ case 3: return 3; /* { dg-warning "case value" } */ + } + switch (ep) + { + case e1: return 1; + case e2: return 2; +- case 3: return 3; /* { dg-warning "exceeds maximum value" } */ ++ case 3: return 3; + default: break; + } + return 0; +--- gcc/testsuite/g++.dg/warn/pr33738.C ++++ gcc/testsuite/g++.dg/warn/pr33738.C +@@ -1,5 +1,5 @@ + // { dg-do run } +-// { dg-options "-O2 -Wtype-limits" } ++// { dg-options "-O2 -Wtype-limits -fstrict-enums" } + extern void link_error (void); + + enum Alpha { + diff --git a/SOURCES/gcc44-pr48857-test.patch b/SOURCES/gcc44-pr48857-test.patch new file mode 100644 index 0000000..58a8083 --- /dev/null +++ b/SOURCES/gcc44-pr48857-test.patch @@ -0,0 +1,13 @@ +2011-07-20 Jakub Jelinek + + * gcc.target/powerpc/pr48857.c: Skip if -fstack-protector. + +--- gcc/testsuite/gcc.target/powerpc/pr48857.c 2011-05-11 11:54:12.138421025 +0200 ++++ gcc/testsuite/gcc.target/powerpc/pr48857.c 2011-07-20 17:19:54.230452295 +0200 +@@ -1,5 +1,6 @@ + /* { dg-do compile { target { powerpc*-*-* } } } */ + /* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ ++/* { dg-skip-if "" { ! powerpc*-*-darwin* } { "-fstack-protector" } { "" } } */ + /* { dg-require-effective-target powerpc_vsx_ok } */ + /* { dg-options "-O2 -mcpu=power7 -mabi=altivec" } */ + /* { dg-final { scan-assembler-times "lxvd2x" 1 } } */ diff --git a/SOURCES/gcc44-pr49146.patch b/SOURCES/gcc44-pr49146.patch new file mode 100644 index 0000000..474c463 --- /dev/null +++ b/SOURCES/gcc44-pr49146.patch @@ -0,0 +1,217 @@ +2013-05-17 Richard Henderson + + PR target/49146 + * unwind-dw2.c (UNWIND_COLUMN_IN_RANGE): New macro. + (execute_cfa_program): Use it when storing to fs->regs. + +--- gcc/unwind-dw2.c (revision 199018) ++++ gcc/unwind-dw2.c (revision 199019) +@@ -55,6 +55,35 @@ + #define DWARF_REG_TO_UNWIND_COLUMN(REGNO) (REGNO) + #endif + ++/* ??? For the public function interfaces, we tend to gcc_assert that the ++ column numbers are in range. For the dwarf2 unwind info this does happen, ++ although so far in a case that doesn't actually matter. ++ ++ See PR49146, in which a call from x86_64 ms abi to x86_64 unix abi stores ++ the call-saved xmm registers and annotates them. We havn't bothered ++ providing support for the xmm registers for the x86_64 port primarily ++ because the 64-bit windows targets don't use dwarf2 unwind, using sjlj or ++ SEH instead. Adding the support for unix targets would generally be a ++ waste. However, some runtime libraries supplied with ICC do contain such ++ an unorthodox transition, as well as the unwind info to match. This loss ++ of register restoration doesn't matter in practice, because the exception ++ is caught in the native unix abi, where all of the xmm registers are ++ call clobbered. ++ ++ Ideally, we'd record some bit to notice when we're failing to restore some ++ register recorded in the unwind info, but to do that we need annotation on ++ the unix->ms abi edge, so that we know when the register data may be ++ discarded. And since this edge is also within the ICC library, we're ++ unlikely to be able to get the new annotation. ++ ++ Barring a magic solution to restore the ms abi defined 128-bit xmm registers ++ (as distictly opposed to the full runtime width) without causing extra ++ overhead for normal unix abis, the best solution seems to be to simply ++ ignore unwind data for unknown columns. */ ++ ++#define UNWIND_COLUMN_IN_RANGE(x) \ ++ __builtin_expect((x) <= DWARF_FRAME_REGISTERS, 1) ++ + /* This is the register and unwind state for a particular frame. This + provides the information necessary to unwind up past a frame and return + to its caller. */ +@@ -897,14 +926,19 @@ execute_cfa_program (const unsigned char + reg = insn & 0x3f; + insn_ptr = read_uleb128 (insn_ptr, &utmp); + offset = (_Unwind_Sword) utmp * fs->data_align; +- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].how +- = REG_SAVED_OFFSET; +- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].loc.offset = offset; ++ reg = DWARF_REG_TO_UNWIND_COLUMN (reg); ++ if (UNWIND_COLUMN_IN_RANGE (reg)) ++ { ++ fs->regs.reg[reg].how = REG_SAVED_OFFSET; ++ fs->regs.reg[reg].loc.offset = offset; ++ } + } + else if ((insn & 0xc0) == DW_CFA_restore) + { + reg = insn & 0x3f; +- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].how = REG_UNSAVED; ++ reg = DWARF_REG_TO_UNWIND_COLUMN (reg); ++ if (UNWIND_COLUMN_IN_RANGE (reg)) ++ fs->regs.reg[reg].how = REG_UNSAVED; + } + else switch (insn) + { +@@ -935,26 +969,35 @@ execute_cfa_program (const unsigned char + insn_ptr = read_uleb128 (insn_ptr, ®); + insn_ptr = read_uleb128 (insn_ptr, &utmp); + offset = (_Unwind_Sword) utmp * fs->data_align; +- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].how +- = REG_SAVED_OFFSET; +- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].loc.offset = offset; ++ reg = DWARF_REG_TO_UNWIND_COLUMN (reg); ++ if (UNWIND_COLUMN_IN_RANGE (reg)) ++ { ++ fs->regs.reg[reg].how = REG_SAVED_OFFSET; ++ fs->regs.reg[reg].loc.offset = offset; ++ } + break; + + case DW_CFA_restore_extended: + insn_ptr = read_uleb128 (insn_ptr, ®); + /* FIXME, this is wrong; the CIE might have said that the + register was saved somewhere. */ +- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN(reg)].how = REG_UNSAVED; ++ reg = DWARF_REG_TO_UNWIND_COLUMN (reg); ++ if (UNWIND_COLUMN_IN_RANGE (reg)) ++ fs->regs.reg[reg].how = REG_UNSAVED; + break; + + case DW_CFA_same_value: + insn_ptr = read_uleb128 (insn_ptr, ®); +- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN(reg)].how = REG_UNSAVED; ++ reg = DWARF_REG_TO_UNWIND_COLUMN (reg); ++ if (UNWIND_COLUMN_IN_RANGE (reg)) ++ fs->regs.reg[reg].how = REG_UNSAVED; + break; + + case DW_CFA_undefined: + insn_ptr = read_uleb128 (insn_ptr, ®); +- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN(reg)].how = REG_UNDEFINED; ++ reg = DWARF_REG_TO_UNWIND_COLUMN (reg); ++ if (UNWIND_COLUMN_IN_RANGE (reg)) ++ fs->regs.reg[reg].how = REG_UNDEFINED; + break; + + case DW_CFA_nop: +@@ -965,9 +1008,12 @@ execute_cfa_program (const unsigned char + _uleb128_t reg2; + insn_ptr = read_uleb128 (insn_ptr, ®); + insn_ptr = read_uleb128 (insn_ptr, ®2); +- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].how = REG_SAVED_REG; +- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].loc.reg = +- (_Unwind_Word)reg2; ++ reg = DWARF_REG_TO_UNWIND_COLUMN (reg); ++ if (UNWIND_COLUMN_IN_RANGE (reg)) ++ { ++ fs->regs.reg[reg].how = REG_SAVED_REG; ++ fs->regs.reg[reg].loc.reg = (_Unwind_Word)reg2; ++ } + } + break; + +@@ -1025,8 +1071,12 @@ execute_cfa_program (const unsigned char + + case DW_CFA_expression: + insn_ptr = read_uleb128 (insn_ptr, ®); +- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].how = REG_SAVED_EXP; +- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].loc.exp = insn_ptr; ++ reg = DWARF_REG_TO_UNWIND_COLUMN (reg); ++ if (UNWIND_COLUMN_IN_RANGE (reg)) ++ { ++ fs->regs.reg[reg].how = REG_SAVED_EXP; ++ fs->regs.reg[reg].loc.exp = insn_ptr; ++ } + insn_ptr = read_uleb128 (insn_ptr, &utmp); + insn_ptr += utmp; + break; +@@ -1036,9 +1086,12 @@ execute_cfa_program (const unsigned char + insn_ptr = read_uleb128 (insn_ptr, ®); + insn_ptr = read_sleb128 (insn_ptr, &stmp); + offset = stmp * fs->data_align; +- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].how +- = REG_SAVED_OFFSET; +- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].loc.offset = offset; ++ reg = DWARF_REG_TO_UNWIND_COLUMN (reg); ++ if (UNWIND_COLUMN_IN_RANGE (reg)) ++ { ++ fs->regs.reg[reg].how = REG_SAVED_OFFSET; ++ fs->regs.reg[reg].loc.offset = offset; ++ } + break; + + case DW_CFA_def_cfa_sf: +@@ -1061,25 +1114,34 @@ execute_cfa_program (const unsigned char + insn_ptr = read_uleb128 (insn_ptr, ®); + insn_ptr = read_uleb128 (insn_ptr, &utmp); + offset = (_Unwind_Sword) utmp * fs->data_align; +- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].how +- = REG_SAVED_VAL_OFFSET; +- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].loc.offset = offset; ++ reg = DWARF_REG_TO_UNWIND_COLUMN (reg); ++ if (UNWIND_COLUMN_IN_RANGE (reg)) ++ { ++ fs->regs.reg[reg].how = REG_SAVED_VAL_OFFSET; ++ fs->regs.reg[reg].loc.offset = offset; ++ } + break; + + case DW_CFA_val_offset_sf: + insn_ptr = read_uleb128 (insn_ptr, ®); + insn_ptr = read_sleb128 (insn_ptr, &stmp); + offset = stmp * fs->data_align; +- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].how +- = REG_SAVED_VAL_OFFSET; +- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].loc.offset = offset; ++ reg = DWARF_REG_TO_UNWIND_COLUMN (reg); ++ if (UNWIND_COLUMN_IN_RANGE (reg)) ++ { ++ fs->regs.reg[reg].how = REG_SAVED_VAL_OFFSET; ++ fs->regs.reg[reg].loc.offset = offset; ++ } + break; + + case DW_CFA_val_expression: + insn_ptr = read_uleb128 (insn_ptr, ®); +- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].how +- = REG_SAVED_VAL_EXP; +- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].loc.exp = insn_ptr; ++ reg = DWARF_REG_TO_UNWIND_COLUMN (reg); ++ if (UNWIND_COLUMN_IN_RANGE (reg)) ++ { ++ fs->regs.reg[reg].how = REG_SAVED_VAL_EXP; ++ fs->regs.reg[reg].loc.exp = insn_ptr; ++ } + insn_ptr = read_uleb128 (insn_ptr, &utmp); + insn_ptr += utmp; + break; +@@ -1104,9 +1166,12 @@ execute_cfa_program (const unsigned char + insn_ptr = read_uleb128 (insn_ptr, ®); + insn_ptr = read_uleb128 (insn_ptr, &utmp); + offset = (_Unwind_Word) utmp * fs->data_align; +- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].how +- = REG_SAVED_OFFSET; +- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].loc.offset = -offset; ++ reg = DWARF_REG_TO_UNWIND_COLUMN (reg); ++ if (UNWIND_COLUMN_IN_RANGE (reg)) ++ { ++ fs->regs.reg[reg].how = REG_SAVED_OFFSET; ++ fs->regs.reg[reg].loc.offset = -offset; ++ } + break; + + default: diff --git a/SOURCES/gcc44-pr53199.patch b/SOURCES/gcc44-pr53199.patch new file mode 100644 index 0000000..0343b14 --- /dev/null +++ b/SOURCES/gcc44-pr53199.patch @@ -0,0 +1,145 @@ +2012-05-03 Michael Meissner + + PR target/53199 + * config/rs6000/rs6000.md (bswapdi splitters): If + -mavoid-indexed-addresses (or -mcpu=power6 which sets it by + default) is used, generate an alternate sequence that does not + depend on using indexed addressing. + + * gcc.target/powwerpc/pr53199.c: New file. + +--- gcc/config/rs6000/rs6000.md (revision 187118) ++++ gcc/config/rs6000/rs6000.md (revision 187119) +@@ -2456,7 +2456,18 @@ (define_split + if (GET_CODE (addr1) == PLUS) + { + emit_insn (gen_add3_insn (op2, XEXP (addr1, 0), GEN_INT (4))); +- addr2 = gen_rtx_PLUS (Pmode, op2, XEXP (addr1, 1)); ++ if (TARGET_AVOID_XFORM) ++ { ++ emit_insn (gen_add3_insn (op2, XEXP (addr1, 1), op2)); ++ addr2 = op2; ++ } ++ else ++ addr2 = gen_rtx_PLUS (Pmode, op2, XEXP (addr1, 1)); ++ } ++ else if (TARGET_AVOID_XFORM) ++ { ++ emit_insn (gen_add3_insn (op2, addr1, GEN_INT (4))); ++ addr2 = op2; + } + else + { +@@ -2506,7 +2517,18 @@ (define_split + if (GET_CODE (addr1) == PLUS) + { + emit_insn (gen_add3_insn (op2, XEXP (addr1, 0), GEN_INT (4))); +- addr2 = gen_rtx_PLUS (Pmode, op2, XEXP (addr1, 1)); ++ if (TARGET_AVOID_XFORM) ++ { ++ emit_insn (gen_add3_insn (op2, XEXP (addr1, 1), op2)); ++ addr2 = op2; ++ } ++ else ++ addr2 = gen_rtx_PLUS (Pmode, op2, XEXP (addr1, 1)); ++ } ++ else if (TARGET_AVOID_XFORM) ++ { ++ emit_insn (gen_add3_insn (op2, addr1, GEN_INT (4))); ++ addr2 = op2; + } + else + { +@@ -2587,7 +2609,18 @@ (define_split + if (GET_CODE (addr1) == PLUS) + { + emit_insn (gen_add3_insn (op2, XEXP (addr1, 0), GEN_INT (4))); +- addr2 = gen_rtx_PLUS (SImode, op2, XEXP (addr1, 1)); ++ if (TARGET_AVOID_XFORM) ++ { ++ emit_insn (gen_add3_insn (op2, XEXP (addr1, 1), op2)); ++ addr2 = op2; ++ } ++ else ++ addr2 = gen_rtx_PLUS (SImode, op2, XEXP (addr1, 1)); ++ } ++ else if (TARGET_AVOID_XFORM) ++ { ++ emit_insn (gen_add3_insn (op2, addr1, GEN_INT (4))); ++ addr2 = op2; + } + else + { +@@ -2632,7 +2665,18 @@ (define_split + if (GET_CODE (addr1) == PLUS) + { + emit_insn (gen_add3_insn (op2, XEXP (addr1, 0), GEN_INT (4))); +- addr2 = gen_rtx_PLUS (SImode, op2, XEXP (addr1, 1)); ++ if (TARGET_AVOID_XFORM) ++ { ++ emit_insn (gen_add3_insn (op2, XEXP (addr1, 1), op2)); ++ addr2 = op2; ++ } ++ else ++ addr2 = gen_rtx_PLUS (SImode, op2, XEXP (addr1, 1)); ++ } ++ else if (TARGET_AVOID_XFORM) ++ { ++ emit_insn (gen_add3_insn (op2, addr1, GEN_INT (4))); ++ addr2 = op2; + } + else + { +--- gcc/testsuite/gcc.target/powerpc/pr53199.c (revision 0) ++++ gcc/testsuite/gcc.target/powerpc/pr53199.c (revision 187119) +@@ -0,0 +1,50 @@ ++/* { dg-do compile { target { powerpc*-*-* } } } */ ++/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ ++/* { dg-options "-O2 -mcpu=power6 -mavoid-indexed-addresses" } */ ++/* { dg-final { scan-assembler-times "lwbrx" 6 } } */ ++/* { dg-final { scan-assembler-times "stwbrx" 6 } } */ ++ ++/* PR 51399: bswap gets an error if -mavoid-indexed-addresses was used in ++ creating the two lwbrx instructions. */ ++ ++long long ++load64_reverse_1 (long long *p) ++{ ++ return __builtin_bswap64 (*p); ++} ++ ++long long ++load64_reverse_2 (long long *p) ++{ ++ return __builtin_bswap64 (p[1]); ++} ++ ++long long ++load64_reverse_3 (long long *p, int i) ++{ ++ return __builtin_bswap64 (p[i]); ++} ++ ++void ++store64_reverse_1 (long long *p, long long x) ++{ ++ *p = __builtin_bswap64 (x); ++} ++ ++void ++store64_reverse_2 (long long *p, long long x) ++{ ++ p[1] = __builtin_bswap64 (x); ++} ++ ++void ++store64_reverse_3 (long long *p, long long x, int i) ++{ ++ p[i] = __builtin_bswap64 (x); ++} ++ ++long long ++reg_reverse (long long x) ++{ ++ return __builtin_bswap64 (x); ++} diff --git a/SOURCES/gcc44-pr54487.patch b/SOURCES/gcc44-pr54487.patch new file mode 100644 index 0000000..0384ca6 --- /dev/null +++ b/SOURCES/gcc44-pr54487.patch @@ -0,0 +1,126 @@ +2012-09-12 Teresa Johnson + + PR gcov-profile/54487 + * configure.ac (HOST_HAS_F_SETLKW): Set based on compile + test using F_SETLKW with fcntl. + * configure, config.in: Regenerate. + +--- gcc/configure.ac (revision 191237) ++++ gcc/configure.ac (revision 191238) +@@ -1146,6 +1146,22 @@ if test $gcc_cv_type_clock_t = yes; then + [Define if defines clock_t.]) + fi + ++# Check if F_SETLKW is supported by fcntl. ++AC_CACHE_CHECK(for F_SETLKW, ac_cv_f_setlkw, [ ++AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ++#include ]], [[ ++struct flock fl; ++fl.l_whence = 0; ++fl.l_start = 0; ++fl.l_len = 0; ++fl.l_pid = 0; ++return fcntl (1, F_SETLKW, &fl);]])], ++[ac_cv_f_setlkw=yes],[ac_cv_f_setlkw=no])]) ++if test $ac_cv_f_setlkw = yes; then ++ AC_DEFINE(HOST_HAS_F_SETLKW, 1, ++ [Define if F_SETLKW supported by fcntl.]) ++fi ++ + # Restore CFLAGS from before the gcc_AC_NEED_DECLARATIONS tests. + CFLAGS="$saved_CFLAGS" + +--- gcc/configure (revision 191237) ++++ gcc/configure (revision 191238) +@@ -13271,6 +13271,76 @@ _ACEOF + + fi + ++# Check if F_SETLKW is supported by fcntl. ++echo "$as_me:$LINENO: checking for F_SETLKW" >&5 ++echo $ECHO_N "checking for F_SETLKW... $ECHO_C" >&6 ++if test "${ac_cv_f_setlkw+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++ ++#include ++int ++main () ++{ ++ ++struct flock fl; ++fl.l_whence = 0; ++fl.l_start = 0; ++fl.l_len = 0; ++fl.l_pid = 0; ++return fcntl (1, F_SETLKW, &fl); ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_cv_f_setlkw=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ac_cv_f_setlkw=no ++fi ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++echo "$as_me:$LINENO: result: $ac_cv_f_setlkw" >&5 ++echo "${ECHO_T}$ac_cv_f_setlkw" >&6 ++if test $ac_cv_f_setlkw = yes; then ++ ++cat >>confdefs.h <<\_ACEOF ++#define HOST_HAS_F_SETLKW 1 ++_ACEOF ++ ++fi ++ + # Restore CFLAGS from before the gcc_AC_NEED_DECLARATIONS tests. + CFLAGS="$saved_CFLAGS" + +--- gcc/config.in (revision 191237) ++++ gcc/config.in (revision 191238) +@@ -1398,6 +1398,12 @@ + #endif + + ++/* Define if F_SETLKW supported by fcntl. */ ++#ifndef USED_FOR_TARGET ++#undef HOST_HAS_F_SETLKW ++#endif ++ ++ + /* Define as const if the declaration of iconv() needs const. */ + #ifndef USED_FOR_TARGET + #undef ICONV_CONST diff --git a/SOURCES/gcc44-pr54858.patch b/SOURCES/gcc44-pr54858.patch new file mode 100644 index 0000000..cb12194 --- /dev/null +++ b/SOURCES/gcc44-pr54858.patch @@ -0,0 +1,41 @@ +2012-10-08 Jakub Jelinek + + PR c++/54858 + * tree.c (cp_tree_equal): Handle FIELD_DECL. + + * g++.dg/template/pr54858.C: New test. + +--- gcc/cp/tree.c (revision 192219) ++++ gcc/cp/tree.c (revision 192220) +@@ -1915,6 +1915,7 @@ cp_tree_equal (tree t1, tree t2) + + case VAR_DECL: + case CONST_DECL: ++ case FIELD_DECL: + case FUNCTION_DECL: + case TEMPLATE_DECL: + case IDENTIFIER_NODE: +--- gcc/testsuite/g++.dg/template/pr54858.C (revision 0) ++++ gcc/testsuite/g++.dg/template/pr54858.C (revision 192220) +@@ -0,0 +1,21 @@ ++// PR c++/54858 ++// { dg-do compile } ++ ++template struct A {}; ++template struct B {}; ++template struct C ++{ ++ A<0> c0; B, &C::c0> d0; // { dg-error "could not convert template argument" } ++ A<0> c1; B, &C::c1> d1; // { dg-error "could not convert template argument" } ++ A<0> c2; B, &C::c2> d2; // { dg-error "could not convert template argument" } ++ A<0> c3; B, &C::c3> d3; // { dg-error "could not convert template argument" } ++ A<0> c4; B, &C::c4> d4; // { dg-error "could not convert template argument" } ++ A<0> c5; B, &C::c5> d5; // { dg-error "could not convert template argument" } ++ A<0> c6; B, &C::c6> d6; // { dg-error "could not convert template argument" } ++ A<0> c7; B, &C::c7> d7; // { dg-error "could not convert template argument" } ++ A<0> c8; B, &C::c8> d8; // { dg-error "could not convert template argument" } ++ A<0> c9; B, &C::c9> d9; // { dg-error "could not convert template argument" } ++ A<0> ca; B, &C::ca> da; // { dg-error "could not convert template argument" } ++ A<0> cb; B, &C::cb> db; // { dg-error "could not convert template argument" } ++}; ++C e; diff --git a/SOURCES/gcc44-pr56403.patch b/SOURCES/gcc44-pr56403.patch new file mode 100644 index 0000000..af0458e --- /dev/null +++ b/SOURCES/gcc44-pr56403.patch @@ -0,0 +1,34 @@ +2013-02-24 Jakub Jelinek + + PR c++/56403 + * init.c (build_zero_init_1): Use RECORD_OR_UNION_CODE_P instead + of CLASS_TYPE_P. + + * g++.dg/torture/pr56403.C: New test. + +--- gcc/cp/init.c (revision 196259) ++++ gcc/cp/init.c (revision 196260) +@@ -183,7 +183,7 @@ build_zero_init_1 (tree type, tree nelts + ; + else if (SCALAR_TYPE_P (type)) + init = convert (type, integer_zero_node); +- else if (CLASS_TYPE_P (type)) ++ else if (RECORD_OR_UNION_CODE_P (TREE_CODE (type))) + { + tree field; + VEC(constructor_elt,gc) *v = NULL; +--- gcc/testsuite/g++.dg/torture/pr56403.C (revision 0) ++++ gcc/testsuite/g++.dg/torture/pr56403.C (revision 196260) +@@ -0,0 +1,12 @@ ++// PR c++/56403 ++// { dg-do compile } ++ ++#include ++ ++struct S { va_list err_args; }; ++ ++void * ++foo () ++{ ++ return new S (); ++} diff --git a/SOURCES/gcc44-rh330771.patch b/SOURCES/gcc44-rh330771.patch new file mode 100644 index 0000000..f7c365d --- /dev/null +++ b/SOURCES/gcc44-rh330771.patch @@ -0,0 +1,34 @@ +2007-10-16 Jakub Jelinek + + * Makefile.am (libgcj_tools_la_LIBADD): Add. + * Makefile.in: Regenerated. + +--- libjava/Makefile.am.jj 2009-05-06 08:14:50.000000000 +0200 ++++ libjava/Makefile.am 2009-05-06 10:26:43.000000000 +0200 +@@ -314,6 +314,8 @@ libgcj_tools_la_SOURCES = classpath/tool + libgcj_tools_la_GCJFLAGS = $(AM_GCJFLAGS) -findirect-dispatch \ + -fno-bootstrap-classes -fno-indirect-classes \ + -fsource-filename=$(here)/classpath/tools/all-classes.lst ++## See jv_convert_LDADD. ++libgcj_tools_la_LIBADD = -L$(here)/.libs libgcj.la + libgcj_tools_la_LDFLAGS = -rpath $(toolexeclibdir) \ + -version-info `grep -v '^\#' $(srcdir)/libtool-version` \ + $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS) +--- libjava/Makefile.in.jj 2009-05-06 08:14:49.000000000 +0200 ++++ libjava/Makefile.in 2009-05-06 10:27:18.000000000 +0200 +@@ -160,7 +160,6 @@ am__objects_1 = gnu/gcj/xlib/lib_gnu_awt + am_lib_gnu_awt_xlib_la_OBJECTS = $(am__objects_1) + lib_gnu_awt_xlib_la_OBJECTS = $(am_lib_gnu_awt_xlib_la_OBJECTS) + @XLIB_AWT_TRUE@am_lib_gnu_awt_xlib_la_rpath = -rpath $(toolexeclibdir) +-libgcj_tools_la_LIBADD = + am_libgcj_tools_la_OBJECTS = classpath/tools/libgcj_tools_la-tools.lo + libgcj_tools_la_OBJECTS = $(am_libgcj_tools_la_OBJECTS) + @INTERPRETER_TRUE@am__DEPENDENCIES_1 = gnu/classpath/jdwp.lo \ +@@ -1041,6 +1040,7 @@ libgcj_tools_la_GCJFLAGS = $(AM_GCJFLAGS + -fno-bootstrap-classes -fno-indirect-classes \ + -fsource-filename=$(here)/classpath/tools/all-classes.lst + ++libgcj_tools_la_LIBADD = -L$(here)/.libs libgcj.la + libgcj_tools_la_LDFLAGS = -rpath $(toolexeclibdir) \ + -version-info `grep -v '^\#' $(srcdir)/libtool-version` \ + $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS) diff --git a/SOURCES/gcc44-rh533181.patch b/SOURCES/gcc44-rh533181.patch new file mode 100644 index 0000000..76326e2 --- /dev/null +++ b/SOURCES/gcc44-rh533181.patch @@ -0,0 +1,153 @@ +2010-07-22 Jakub Jelinek + + * gimplify.c (enum gimplify_omp_var_data): Add + GOVD_THREADPRIVATE_WARNED. + (gimplify_bind_expr): Add GOVD_LOCAL | GOVD_SEEN even for global vars. + (omp_notice_threadprivate_variable): Note used threadprivate vars + with current function's context in shared clauses. + (gimplify_adjust_omp_clauses_1): Allow globals with current function's + context in taskreg shared clause. + * omp-low.c (lower_rec_input_clauses): For function-local is_global_var + VAR_DECLs in shared clauses add a decl copy with DECL_VALUE_EXPR + pointing to the original. + + * trans-openmp.c (gfc_omp_private_debug_clause): Return false for + threadprivate decls. + + * gcc.dg/gomp/tls-3.c: New test. + +--- gcc/fortran/trans-openmp.c.jj 2010-06-24 21:47:09.908230044 +0200 ++++ gcc/fortran/trans-openmp.c 2010-07-26 10:45:15.830229443 +0200 +@@ -351,6 +351,18 @@ gfc_omp_disregard_value_expr (tree decl, + bool + gfc_omp_private_debug_clause (tree decl, bool shared) + { ++ if (TREE_STATIC (decl) || DECL_EXTERNAL (decl)) ++ { ++ if (DECL_THREAD_LOCAL_P (decl)) ++ return false; ++ if (DECL_HAS_VALUE_EXPR_P (decl)) ++ { ++ tree value = get_base_address (DECL_VALUE_EXPR (decl)); ++ if (value && DECL_P (value) && DECL_THREAD_LOCAL_P (value)) ++ return false; ++ } ++ } ++ + if (GFC_DECL_CRAY_POINTEE (decl)) + return true; + +--- gcc/gimplify.c.jj 2010-07-09 09:01:37.049604412 +0200 ++++ gcc/gimplify.c 2010-07-26 10:50:05.646291216 +0200 +@@ -66,6 +66,7 @@ enum gimplify_omp_var_data + GOVD_LOCAL = 128, + GOVD_DEBUG_PRIVATE = 256, + GOVD_PRIVATE_OUTER_REF = 512, ++ GOVD_THREADPRIVATE_WARNED = 1024, + GOVD_DATA_SHARE_CLASS = (GOVD_SHARED | GOVD_PRIVATE | GOVD_FIRSTPRIVATE + | GOVD_LASTPRIVATE | GOVD_REDUCTION | GOVD_LOCAL) + }; +@@ -1234,7 +1235,7 @@ gimplify_bind_expr (tree *expr_p, gimple + struct gimplify_omp_ctx *ctx = gimplify_omp_ctxp; + + /* Mark variable as local. */ +- if (ctx && !is_global_var (t) ++ if (ctx + && (! DECL_SEEN_IN_BIND_EXPR_P (t) + || splay_tree_lookup (ctx->variables, + (splay_tree_key) t) == NULL)) +@@ -5339,18 +5340,36 @@ omp_notice_threadprivate_variable (struc + { + splay_tree_node n; + +- if (ctx->region_type != ORT_UNTIED_TASK) ++ while (ctx && ctx->region_type == ORT_WORKSHARE) ++ { ++ n = splay_tree_lookup (ctx->variables, (splay_tree_key)decl); ++ if (n != NULL) ++ { ++ gcc_assert (n->value & GOVD_LOCAL); ++ return false; ++ } ++ ctx = ctx->outer_context; ++ } ++ if (ctx == NULL) + return false; ++ + n = splay_tree_lookup (ctx->variables, (splay_tree_key)decl); + if (n == NULL) ++ n = splay_tree_insert (ctx->variables, (splay_tree_key)decl, ++ DECL_CONTEXT (decl) == current_function_decl ++ ? GOVD_SHARED | GOVD_SEEN : 0); ++ if (ctx->region_type == ORT_UNTIED_TASK ++ && (n->value & GOVD_THREADPRIVATE_WARNED) == 0) + { + error ("threadprivate variable %qs used in untied task", + IDENTIFIER_POINTER (DECL_NAME (decl))); + error ("%Henclosing task", &ctx->location); +- splay_tree_insert (ctx->variables, (splay_tree_key)decl, 0); ++ n->value |= GOVD_THREADPRIVATE_WARNED; + } + if (decl2) +- splay_tree_insert (ctx->variables, (splay_tree_key)decl2, 0); ++ splay_tree_insert (ctx->variables, (splay_tree_key)decl2, ++ DECL_CONTEXT (decl2) == current_function_decl ++ ? GOVD_SHARED | GOVD_SEEN : 0); + return false; + } + +@@ -5779,7 +5798,9 @@ gimplify_adjust_omp_clauses_1 (splay_tre + break; + ctx = ctx->outer_context; + } +- if (ctx == NULL) ++ if (ctx == NULL ++ && (DECL_CONTEXT (decl) != current_function_decl ++ || gimplify_omp_ctxp->region_type == ORT_WORKSHARE)) + return 0; + } + code = OMP_CLAUSE_SHARED; +--- gcc/omp-low.c.jj 2010-06-11 11:06:00.913659301 +0200 ++++ gcc/omp-low.c 2010-07-26 10:45:15.866229447 +0200 +@@ -2222,6 +2222,17 @@ lower_rec_input_clauses (tree clauses, g + continue; + break; + case OMP_CLAUSE_SHARED: ++ if (pass == 0 ++ && is_global_var (OMP_CLAUSE_DECL (c)) ++ && (DECL_CONTEXT (OMP_CLAUSE_DECL (c)) ++ == current_function_decl) ++ && is_taskreg_ctx (ctx) ++ && !DECL_IGNORED_P (OMP_CLAUSE_DECL (c))) ++ { ++ new_var = omp_copy_decl_1 (OMP_CLAUSE_DECL (c), ctx); ++ SET_DECL_VALUE_EXPR (new_var, OMP_CLAUSE_DECL (c)); ++ DECL_HAS_VALUE_EXPR_P (new_var) = 1; ++ } + if (maybe_lookup_decl (OMP_CLAUSE_DECL (c), ctx) == NULL) + { + gcc_assert (is_global_var (OMP_CLAUSE_DECL (c))); +--- gcc/testsuite/gcc.dg/gomp/tls-3.c.jj 2010-07-26 10:45:15.868228753 +0200 ++++ gcc/testsuite/gcc.dg/gomp/tls-3.c 2010-07-26 10:45:15.868228753 +0200 +@@ -0,0 +1,21 @@ ++/* { dg-do compile } */ ++/* { dg-require-effective-target tls_native } */ ++ ++int thr; ++#pragma omp threadprivate(thr) ++ ++void ++foo (void) ++{ ++ #pragma omp task untied /* { dg-error "enclosing task" } */ ++ { ++ static int thr2; ++ #pragma omp threadprivate(thr2) ++ static int thr3; ++ #pragma omp threadprivate(thr3) ++ thr++; /* { dg-error "used in untied task" } */ ++ thr2++; /* { dg-error "used in untied task" } */ ++ thr++; ++ thr2++; ++ } ++} diff --git a/SOURCES/gcc44-rh610785.patch b/SOURCES/gcc44-rh610785.patch new file mode 100644 index 0000000..91d0934 --- /dev/null +++ b/SOURCES/gcc44-rh610785.patch @@ -0,0 +1,74 @@ +2010-07-07 Jakub Jelinek + + * tree-sra.c (sra_build_assignment): Don't add BIT_XOR_EXPR/MINUS_EXPR + of signbit if signbit is the most significant bit of utype already. + + * gcc.c-torture/execute/20100707-1.c: New test. + +--- gcc/tree-sra.c.jj 2010-05-13 13:08:52.000000000 +0200 ++++ gcc/tree-sra.c 2010-07-06 19:50:09.000000000 +0200 +@@ -2211,7 +2211,10 @@ sra_build_assignment (tree dst, tree src + + /* Perform sign extension, if required. + ??? This should never be necessary. */ +- if (!unsignedp) ++ if (!unsignedp ++ && (TREE_INT_CST_LOW (width) != TYPE_PRECISION (utype) ++ || (TREE_INT_CST_LOW (width) ++ != GET_MODE_BITSIZE (TYPE_MODE (utype))))) + { + tree signbit = int_const_binop (LSHIFT_EXPR, + build_int_cst_wide (utype, 1, 0), +--- gcc/testsuite/gcc.c-torture/execute/20100707-1.c 2010-05-27 15:41:40.446237053 +0200 ++++ gcc/testsuite/gcc.c-torture/execute/20100707-1.c 2010-07-06 13:55:35.000000000 +0200 +@@ -0,0 +1,50 @@ ++struct S { int s; }; ++struct T { int w; int h; }; ++int vr; ++ ++inline struct T ++bar (const struct S * x) ++{ ++ struct T t; ++ t.w = vr; ++ t.h = x->s; ++ return t; ++} ++ ++__attribute__ ((noinline)) ++void foo (struct S * w, unsigned char *x, int y, int *z[2]) ++{ ++ struct T t; ++ int i, j, k; ++ t = bar (w); ++ k = t.w + 2; ++ for (i = 0; i <= t.h; i++) ++ { ++ int *u = z[i > 0] + 1; ++ unsigned char *v; ++ int q = 0; ++ v = x + k * i + 1; ++ for (j = 0; j < t.w; j++) ++ { ++ int m = u[j]; ++ if (m > y && !q && v[j - k] != 2) ++ v[j] = 0; ++ } ++ } ++} ++ ++unsigned char b[64]; ++ ++int ++main (void) ++{ ++ int v[32], *z[2]; ++ struct S s; ++ __builtin_memset (v, 0, sizeof (v)); ++ vr = 16; ++ s.s = 16; ++ z[0] = v; ++ z[1] = v; ++ foo (&s, b + 32, -1, z); ++ return 0; ++} diff --git a/SOURCES/gcc44-rh750545.patch b/SOURCES/gcc44-rh750545.patch new file mode 100644 index 0000000..b7b68a4 --- /dev/null +++ b/SOURCES/gcc44-rh750545.patch @@ -0,0 +1,55 @@ +2012-04-10 Jason Merrill + + Red Hat BZ 750545 + * method.c (locate_dtor): Lazily declare the destructor. + +--- gcc/cp/method.c ++++ gcc/cp/method.c +@@ -870,6 +870,8 @@ synthesize_exception_spec (tree type, tr + tree + locate_dtor (tree type, void *client ATTRIBUTE_UNUSED) + { ++ if (CLASSTYPE_LAZY_DESTRUCTOR (type)) ++ lazily_declare_fn (sfk_destructor, type); + return CLASSTYPE_DESTRUCTORS (type); + } + +--- gcc/testsuite/g++.dg/eh/dtor3.C ++++ gcc/testsuite/g++.dg/eh/dtor3.C +@@ -0,0 +1,36 @@ ++// Red Hat bug 750545 ++// { dg-do run } ++ ++class excep {}; ++class A ++{ ++public: ++ ~A() { throw excep(); } ++}; ++ ++class B ++{ ++ A a; ++}; ++ ++class C ++{ ++ B b; ++}; ++ ++void f() ++{ ++ C* c = new C(); ++ ++ try ++ { ++ delete c; ++ } ++ catch(...) ++ {} ++} ++ ++int main() ++{ ++ f(); ++} diff --git a/SOURCES/gcc44-rh801144.patch b/SOURCES/gcc44-rh801144.patch new file mode 100644 index 0000000..a9274cc --- /dev/null +++ b/SOURCES/gcc44-rh801144.patch @@ -0,0 +1,192 @@ +2009-09-07 Laurent GUERBY + + * make.adb: Add missing documentation for multilib handling. + +2009-08-17 Robert Dewar + + * make.adb: Add ??? comment + +2009-08-17 Arnaud Charlet + + * make.adb (Process_Multilib, Scan_Make_Arg): Refine previous change + and ignore -mieee switch to avoid spawning an extra gcc in this case. + +2009-08-10 Laurent GUERBY + + * make.adb: Handle multilib + +--- gcc/ada/make.adb (revision 150622,150828,150830,151472) ++++ gcc/ada/make.adb (revision 150623,150829,150831,151473) +@@ -195,6 +195,9 @@ package body Make is + RTS_Specified : String_Access := null; + -- Used to detect multiple --RTS= switches + ++ N_M_Switch : Natural := 0; ++ -- Used to count -mxxx switches that can affect multilib ++ + type Q_Record is record + File : File_Name_Type; + Unit : Unit_Name_Type; +@@ -666,6 +669,9 @@ package body Make is + -- directory of the ultimate extending project. If it is not, we ignore + -- the fact that this ALI file is read-only. + ++ procedure Process_Multilib; ++ -- Add appropriate --RTS argument to handle multilib. ++ + ---------------------------------------------------- + -- Compiler, Binder & Linker Data and Subprograms -- + ---------------------------------------------------- +@@ -6854,6 +6860,7 @@ package body Make is + Dependencies.Init; + + RTS_Specified := null; ++ N_M_Switch := 0; + + Mains.Delete; + +@@ -6913,6 +6920,10 @@ package body Make is + Scan_Make_Arg (Argument (Next_Arg), And_Save => True); + end loop Scan_Args; + ++ if N_M_Switch > 0 and RTS_Specified = null then ++ Process_Multilib; ++ end if; ++ + if Commands_To_Stdout then + Set_Standard_Output; + end if; +@@ -7587,6 +7598,117 @@ package body Make is + Set_Name_Table_Byte (N, B or Mark); + end Mark_Directory; + ++ ---------------------- ++ -- Process_Multilib -- ++ ---------------------- ++ ++ procedure Process_Multilib is ++ ++ Output_FD : File_Descriptor; ++ Output_Name : String_Access; ++ Arg_Index : Natural := 0; ++ Success : Boolean := False; ++ Return_Code : Integer := 0; ++ Multilib_Gcc_Path : String_Access; ++ Multilib_Gcc : String_Access; ++ N_Read : Integer := 0; ++ Line : String (1 .. 1000); ++ Args : Argument_List (1 .. N_M_Switch + 1); ++ ++ begin ++ pragma Assert (N_M_Switch > 0 and RTS_Specified = null); ++ ++ -- In case we detected a multilib switch and the user has not ++ -- manually specified a specific RTS we emulate the following command: ++ -- gnatmake $FLAGS --RTS=$(gcc -print-multi-directory $FLAGS) ++ ++ -- First select the flags which might have an impact on multilib ++ -- processing. Note that this is an heuristic selection and it ++ -- will need to be maintained over time. The condition has to ++ -- be kept synchronized with N_M_Switch counting in Scan_Make_Arg. ++ ++ for Next_Arg in 1 .. Argument_Count loop ++ declare ++ Argv : constant String := Argument (Next_Arg); ++ begin ++ if Argv'Length > 2 ++ and then Argv (1) = '-' ++ and then Argv (2) = 'm' ++ and then Argv /= "-margs" ++ ++ -- Ignore -mieee to avoid spawning an extra gcc in this case ++ ++ and then Argv /= "-mieee" ++ then ++ Arg_Index := Arg_Index + 1; ++ Args (Arg_Index) := new String'(Argv); ++ end if; ++ ++ end; ++ end loop; ++ ++ pragma Assert (Arg_Index = N_M_Switch); ++ ++ Args (Args'Last) := new String'("-print-multi-directory"); ++ ++ -- Call the GCC driver with the collected flags and save its ++ -- output. Alternate design would be to link in gnatmake the ++ -- relevant part of the GCC driver. ++ ++ if Saved_Gcc /= null then ++ Multilib_Gcc := Saved_Gcc; ++ else ++ Multilib_Gcc := Gcc; ++ end if; ++ ++ Multilib_Gcc_Path := ++ GNAT.OS_Lib.Locate_Exec_On_Path (Multilib_Gcc.all); ++ ++ Create_Temp_File (Output_FD, Output_Name); ++ if Output_FD = Invalid_FD then ++ return; ++ end if; ++ ++ GNAT.OS_Lib.Spawn (Multilib_Gcc_Path.all, Args, Output_FD, ++ Return_Code, False); ++ Close (Output_FD); ++ if Return_Code /= 0 then ++ return; ++ end if; ++ ++ -- Parse the GCC driver output which is a single line, removing CR/LF ++ ++ Output_FD := Open_Read (Output_Name.all, Binary); ++ if Output_FD = Invalid_FD then ++ return; ++ end if; ++ ++ N_Read := Read (Output_FD, Line (1)'Address, Line'Length); ++ Close (Output_FD); ++ Delete_File (Output_Name.all, Success); ++ ++ for I in reverse 1 .. N_Read loop ++ if Line (I) = ASCII.CR or else Line (I) = ASCII.LF then ++ N_Read := N_Read - 1; ++ else ++ exit; ++ end if; ++ end loop; ++ ++ -- In case the standard RTS is selected do nothing ++ ++ if N_Read = 0 or else Line (1 .. N_Read) = "." then ++ return; ++ end if; ++ ++ -- Otherwise add -margs --RTS=output ++ ++ Scan_Make_Arg ("-margs", And_Save => True); ++ Scan_Make_Arg ("--RTS=" & Line (1 .. N_Read), ++ And_Save => True); ++ ++ end Process_Multilib; ++ + ----------------------------- + -- Recursive_Compute_Depth -- + ----------------------------- +@@ -8043,6 +8165,15 @@ package body Make is + Add_Switch (Argv, Compiler, And_Save => And_Save); + Add_Switch (Argv, Linker, And_Save => And_Save); + ++ -- The following condition has to be kept synchronized with ++ -- the Process_Multilib one. ++ ++ if Argv (2) = 'm' ++ and then Argv /= "-mieee" ++ then ++ N_M_Switch := N_M_Switch + 1; ++ end if; ++ + -- -C= + + elsif Argv'Last > 2 and then Argv (2) = 'C' then diff --git a/SOURCES/gcc44-rh808590.patch b/SOURCES/gcc44-rh808590.patch new file mode 100644 index 0000000..3f08449 --- /dev/null +++ b/SOURCES/gcc44-rh808590.patch @@ -0,0 +1,107 @@ +2012-10-09 Benjamin Kosnik + + * testsuite/20_util/specialized_algorithms/uninitialized_copy/808590.cc: + Fix constant value. + +2012-04-17 Benjamin Kosnik + + * testsuite/20_util/specialized_algorithms/uninitialized_copy/ + 808590.cc: New. + +2009-09-02 Paolo Carlini + + * include/bits/stl_uninitialized.h + (__uninitialized_copy::uninitialized_copy): Just call (the now + forwarding) _Construct. + +2009-08-29 Benjamin Kosnik + Chris Jefferson + + * include/bits/stl_construct.h (_Construct(_T1*, _T2&&)): Add in + C++0x mode. + +--- libstdc++-v3/include/bits/stl_construct.h (revision 186113) ++++ libstdc++-v3/include/bits/stl_construct.h (working copy) +@@ -67,12 +67,19 @@ + */ + template + inline void ++#ifdef __GXX_EXPERIMENTAL_CXX0X__ ++ _Construct(_T1* __p, _T2&& __value) ++ { ++ ::new(static_cast(__p)) _T1(std::forward<_T2>(__value)); ++ } ++#else + _Construct(_T1* __p, const _T2& __value) + { + // _GLIBCXX_RESOLVE_LIB_DEFECTS + // 402. wrong new expression in [some_]allocator::construct + ::new(static_cast(__p)) _T1(__value); + } ++#endif + + /** + * Destroy the object pointed to by a pointer type. +--- libstdc++-v3/include/bits/stl_uninitialized.h (revision 186113) ++++ libstdc++-v3/include/bits/stl_uninitialized.h (working copy) +@@ -71,8 +71,7 @@ + __try + { + for (; __first != __last; ++__first, ++__cur) +- ::new(static_cast(&*__cur)) typename +- iterator_traits<_ForwardIterator>::value_type(*__first); ++ std::_Construct(&*__cur, *__first); + return __cur; + } + __catch(...) +--- libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_copy/808590.cc (revision 0) ++++ libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_copy/808590.cc (revision 186539) +@@ -0,0 +1,48 @@ ++// Copyright (C) 2012 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 3, or (at your option) ++// any later version. ++ ++// This library is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without Pred the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++// GNU General Public License for more details. ++ ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING3. If not see ++// . ++ ++#include ++#include ++ ++// 4.4.x only ++struct c ++{ ++ void *m; ++ ++ c(void* o = 0) : m(o) {} ++ c(const c &r) : m(r.m) {} ++ ++ template ++ explicit c(T &o) : m((void*)0xdeadbeef) { } ++}; ++ ++int main() ++{ ++ std::vector cbs; ++ const c cb((void*)0xcafebabe); ++ ++ for (int fd = 62; fd < 67; ++fd) ++ { ++ cbs.resize(fd + 1); ++ cbs[fd] = cb; ++ } ++ ++ for (int fd = 62; fd< 67; ++fd) ++ if (cb.m != cbs[fd].m) ++ throw std::runtime_error("wrong"); ++ return 0; ++} diff --git a/SOURCES/gcc44-rh820281.patch b/SOURCES/gcc44-rh820281.patch new file mode 100644 index 0000000..2d1cbd6 --- /dev/null +++ b/SOURCES/gcc44-rh820281.patch @@ -0,0 +1,17 @@ +2012-05-09 Jakub Jelinek + + * tree-data-ref.c (stmt_simple_memref_p): Return false + if get_base_address (op) is NULL. + +--- gcc/tree-data-ref.c.jj 2009-03-19 17:17:05.000000000 +0100 ++++ gcc/tree-data-ref.c 2012-05-09 17:49:01.351102695 +0200 +@@ -3326,6 +3326,9 @@ stmt_simple_memref_p (struct loop *loop, + data_reference_p dr; + bool res = true; + ++ if (get_base_address (op) == NULL_TREE) ++ return false; ++ + dr = create_data_ref (loop, op, stmt, true); + if (!access_functions_are_affine_or_constant_p (dr, loop)) + res = false; diff --git a/SOURCES/gcc44-rh867878.patch b/SOURCES/gcc44-rh867878.patch new file mode 100644 index 0000000..99fd754 --- /dev/null +++ b/SOURCES/gcc44-rh867878.patch @@ -0,0 +1,15 @@ +2012-01-31 Andreas Krebbel + + * config/s390/s390.md ("*ashr3_and"): Add missing z196 flag + to srak instruction. + +--- gcc/config/s390/s390.md (revision 183758) ++++ gcc/config/s390/s390.md (revision 183759) +@@ -7650,6 +7650,7 @@ (define_insn "*ashr3_and" + sra\t%0,%1,%Y2" + [(set_attr "op_type" "RS,RSY") + (set_attr "atype" "reg,reg") ++ (set_attr "cpu_facility" "*,z196") + (set_attr "z10prop" "z10_super_E1,*")]) + + diff --git a/SOURCES/gcc44-rh906234.patch b/SOURCES/gcc44-rh906234.patch new file mode 100644 index 0000000..7f7d718 --- /dev/null +++ b/SOURCES/gcc44-rh906234.patch @@ -0,0 +1,16 @@ +2009-08-14 Ulrich Weigand + + * c-lex.c (c_lex_with_flags): Increase size of local variable + to avoid memory clobber. + +--- gcc/c-lex.c (revision 150755) ++++ gcc/c-lex.c (revision 150756) +@@ -390,7 +390,7 @@ c_lex_with_flags (tree *value, location_ + case CPP_HASH: + case CPP_PASTE: + { +- unsigned char name[4]; ++ unsigned char name[8]; + + *cpp_spell_token (parse_in, tok, name, true) = 0; + diff --git a/SOURCES/gcc44-rh908025.patch b/SOURCES/gcc44-rh908025.patch new file mode 100644 index 0000000..b266e7b --- /dev/null +++ b/SOURCES/gcc44-rh908025.patch @@ -0,0 +1,280 @@ +2013-05-06 Maxim Kuznetsov + + * final.c (do_assembler_dialects): Don't handle curly braces and + vertical bar escaped by % as dialect delimiters. + (output_asm_insn): Print curly braces and vertical bar if escaped + by % and ASSEMBLER_DIALECT defined. + * doc/tm.texi (ASSEMBLER_DIALECT): Document new standard escapes. + + * gcc.target/i386/asm-dialect-2.c: New testcase. + +2012-07-25 Siddhesh Poyarekar + + * final.c [ASSEMBLER_DIALECT](do_assembler_dialects): New + function to implement assembler dialects. + (output_asm_insn): Use do_assembler_dialects. + (asm_fprintf): Likewise. + + * gcc.target/i386/asm-dialect-1.c: New test case. + +--- gcc/final.c (revision 189853, 198640) ++++ gcc/final.c (revision 189854, 198641) +@@ -3134,6 +3134,96 @@ output_asm_operand_names (rtx *operands, + } + } + ++#ifdef ASSEMBLER_DIALECT ++/* Helper function to parse assembler dialects in the asm string. ++ This is called from output_asm_insn and asm_fprintf. */ ++static const char * ++do_assembler_dialects (const char *p, int *dialect) ++{ ++ char c = *(p - 1); ++ ++ switch (c) ++ { ++ case '{': ++ { ++ int i; ++ ++ if (*dialect) ++ output_operand_lossage ("nested assembly dialect alternatives"); ++ else ++ *dialect = 1; ++ ++ /* If we want the first dialect, do nothing. Otherwise, skip ++ DIALECT_NUMBER of strings ending with '|'. */ ++ for (i = 0; i < dialect_number; i++) ++ { ++ while (*p && *p != '}') ++ { ++ if (*p == '|') ++ { ++ p++; ++ break; ++ } ++ ++ /* Skip over any character after a percent sign. */ ++ if (*p == '%') ++ p++; ++ if (*p) ++ p++; ++ } ++ ++ if (*p == '}') ++ break; ++ } ++ ++ if (*p == '\0') ++ output_operand_lossage ("unterminated assembly dialect alternative"); ++ } ++ break; ++ ++ case '|': ++ if (*dialect) ++ { ++ /* Skip to close brace. */ ++ do ++ { ++ if (*p == '\0') ++ { ++ output_operand_lossage ("unterminated assembly dialect alternative"); ++ break; ++ } ++ ++ /* Skip over any character after a percent sign. */ ++ if (*p == '%' && p[1]) ++ { ++ p += 2; ++ continue; ++ } ++ ++ if (*p++ == '}') ++ break; ++ } ++ while (1); ++ ++ *dialect = 0; ++ } ++ else ++ putc (c, asm_out_file); ++ break; ++ ++ case '}': ++ if (! *dialect) ++ putc (c, asm_out_file); ++ *dialect = 0; ++ break; ++ default: ++ gcc_unreachable (); ++ } ++ ++ return p; ++} ++#endif ++ + /* Output text from TEMPLATE to the assembler output file, + obeying %-directions to substitute operands taken from + the vector OPERANDS. +@@ -3200,63 +3290,24 @@ output_asm_insn (const char *templ, rtx + + #ifdef ASSEMBLER_DIALECT + case '{': +- { +- int i; +- +- if (dialect) +- output_operand_lossage ("nested assembly dialect alternatives"); +- else +- dialect = 1; +- +- /* If we want the first dialect, do nothing. Otherwise, skip +- DIALECT_NUMBER of strings ending with '|'. */ +- for (i = 0; i < dialect_number; i++) +- { +- while (*p && *p != '}' && *p++ != '|') +- ; +- if (*p == '}') +- break; +- if (*p == '|') +- p++; +- } +- +- if (*p == '\0') +- output_operand_lossage ("unterminated assembly dialect alternative"); +- } +- break; +- +- case '|': +- if (dialect) +- { +- /* Skip to close brace. */ +- do +- { +- if (*p == '\0') +- { +- output_operand_lossage ("unterminated assembly dialect alternative"); +- break; +- } +- } +- while (*p++ != '}'); +- dialect = 0; +- } +- else +- putc (c, asm_out_file); +- break; +- + case '}': +- if (! dialect) +- putc (c, asm_out_file); +- dialect = 0; ++ case '|': ++ p = do_assembler_dialects (p, &dialect); + break; + #endif + + case '%': +- /* %% outputs a single %. */ +- if (*p == '%') ++ /* %% outputs a single %. %{, %} and %| print {, } and | respectively ++ if ASSEMBLER_DIALECT defined and these characters have a special ++ meaning as dialect delimiters.*/ ++ if (*p == '%' ++#ifdef ASSEMBLER_DIALECT ++ || *p == '{' || *p == '}' || *p == '|' ++#endif ++ ) + { ++ putc (*p, asm_out_file); + p++; +- putc (c, asm_out_file); + } + /* %= outputs a number which is unique to each insn in the entire + compilation. This is useful for making local labels that are +@@ -3600,6 +3651,9 @@ asm_fprintf (FILE *file, const char *p, + { + char buf[10]; + char *q, c; ++#ifdef ASSEMBLER_DIALECT ++ int dialect = 0; ++#endif + va_list argptr; + + va_start (argptr, p); +@@ -3611,29 +3665,9 @@ asm_fprintf (FILE *file, const char *p, + { + #ifdef ASSEMBLER_DIALECT + case '{': +- { +- int i; +- +- /* If we want the first dialect, do nothing. Otherwise, skip +- DIALECT_NUMBER of strings ending with '|'. */ +- for (i = 0; i < dialect_number; i++) +- { +- while (*p && *p++ != '|') +- ; +- +- if (*p == '|') +- p++; +- } +- } +- break; +- +- case '|': +- /* Skip to close brace. */ +- while (*p && *p++ != '}') +- ; +- break; +- + case '}': ++ case '|': ++ p = do_assembler_dialects (p, &dialect); + break; + #endif + +--- gcc/doc/tm.texi (revision 198640) ++++ gcc/doc/tm.texi (revision 198641) +@@ -8274,7 +8274,9 @@ first argument of @code{asm_fprintf}. T + @code{ASSEMBLER_DIALECT} is zero, one, two, etc. Any special characters + within these strings retain their usual meaning. If there are fewer + alternatives within the braces than the value of +-@code{ASSEMBLER_DIALECT}, the construct outputs nothing. ++@code{ASSEMBLER_DIALECT}, the construct outputs nothing. If it's needed ++to print curly braces or @samp{|} character in assembler output directly, ++@samp{%@{}, @samp{%@}} and @samp{%|} can be used. + + If you do not define this macro, the characters @samp{@{}, @samp{|} and + @samp{@}} do not have any special meaning when used in templates or +--- gcc/testsuite/gcc.target/i386/asm-dialect-1.c (revision 0) ++++ gcc/testsuite/gcc.target/i386/asm-dialect-1.c (revision 189854) +@@ -0,0 +1,15 @@ ++/* { dg-options "-masm=intel" } */ ++ ++extern void abort (void); ++ ++int ++main (void) ++{ ++ int f = 0; ++ asm ("{movl $42, %%eax | mov eax, 42}" : :); ++ asm ("{movl $41, %0||mov %0, 43}" : "=r"(f)); ++ if (f != 42) ++ abort (); ++ ++ return 0; ++} +--- gcc/testsuite/gcc.target/i386/asm-dialect-2.c (revision 0) ++++ gcc/testsuite/gcc.target/i386/asm-dialect-2.c (revision 198641) +@@ -0,0 +1,11 @@ ++/* { dg-do compile } */ ++/* { dg-options "-masm=att" } */ ++/* { dg-final { scan-assembler "%{a}|" } } */ ++ ++int a, b; ++ ++void f() ++{ ++ /* Check for escaped curly braces support. */ ++ asm volatile ("{%%%{a%}%||%%%}b}" : :); ++} diff --git a/SOURCES/gcc44-rh967003.patch b/SOURCES/gcc44-rh967003.patch new file mode 100644 index 0000000..3cc1ef2 --- /dev/null +++ b/SOURCES/gcc44-rh967003.patch @@ -0,0 +1,28 @@ +--- gcc/tree-ssa-ccp.c.jj 2013-07-10 14:23:48.649363309 +1000 ++++ gcc/tree-ssa-ccp.c 2013-07-10 14:25:46.767447105 +1000 +@@ -2877,6 +2877,12 @@ fold_stmt (gimple_stmt_iterator *gsi) + /* Fold the individual operands. + For example, fold instances of *&VAR into VAR, etc. */ + res = walk_gimple_op (stmt, fold_stmt_r, &wi); ++ if (res && is_gimple_debug (stmt)) ++ { ++ gimple_debug_bind_reset_value (stmt); ++ changed = true; ++ res = NULL_TREE; ++ } + gcc_assert (!res); + + /* Fold the main computation performed by the statement. */ +@@ -2941,6 +2947,12 @@ fold_stmt_inplace (gimple stmt) + a call to _builtin_trap. This functionality is currently + disabled, as noted in a FIXME, and cannot be supported here. */ + res = walk_gimple_op (stmt, fold_stmt_r, &wi); ++ if (res && is_gimple_debug (stmt)) ++ { ++ gimple_debug_bind_reset_value (stmt); ++ changed = true; ++ res = NULL_TREE; ++ } + gcc_assert (!res); + + /* Fold the main computation performed by the statement. */ diff --git a/SOURCES/gcc44-siginfo_t.patch b/SOURCES/gcc44-siginfo_t.patch new file mode 100644 index 0000000..82a0a44 --- /dev/null +++ b/SOURCES/gcc44-siginfo_t.patch @@ -0,0 +1,136 @@ +2012-04-20 Thomas Schwinge + + struct siginfo vs. siginfo_t + + Backport from trunk (but apply to gcc/): + + 2012-04-20 Thomas Schwinge + + * config/alpha/linux-unwind.h (alpha_fallback_frame_state): Use + siginfo_t instead of struct siginfo. + * config/bfin/linux-unwind.h (bfin_fallback_frame_state): Likewise. + * config/i386/linux-unwind.h (x86_fallback_frame_state): Likewise. + * config/ia64/linux-unwind.h (ia64_fallback_frame_state) + (ia64_handle_unwabi): Likewise. + * config/mips/linux-unwind.h (mips_fallback_frame_state): Likewise. + * config/pa/linux-unwind.h (pa32_fallback_frame_state): Likewise. + * config/sh/linux-unwind.h (shmedia_fallback_frame_state) + (sh_fallback_frame_state): Likewise. + * config/xtensa/linux-unwind.h (xtensa_fallback_frame_state): Likewise. + +--- gcc/config/alpha/linux-unwind.h (revision 186612) ++++ gcc/config/alpha/linux-unwind.h (revision 186613) +@@ -49,7 +49,7 @@ alpha_fallback_frame_state (struct _Unwi + else if (pc[1] == 0x201f015f) /* lda $0,NR_rt_sigreturn */ + { + struct rt_sigframe { +- struct siginfo info; ++ siginfo_t info; + struct ucontext uc; + } *rt_ = context->cfa; + sc = &rt_->uc.uc_mcontext; +--- gcc/config/i386/linux-unwind.h (revision 186612) ++++ gcc/config/i386/linux-unwind.h (revision 186613) +@@ -133,9 +133,9 @@ x86_fallback_frame_state (struct _Unwind + { + struct rt_sigframe { + int sig; +- struct siginfo *pinfo; ++ siginfo_t *pinfo; + void *puc; +- struct siginfo info; ++ siginfo_t info; + struct ucontext uc; + } *rt_ = context->cfa; + /* The void * cast is necessary to avoid an aliasing warning. +--- gcc/config/sh/linux-unwind.h (revision 186612) ++++ gcc/config/sh/linux-unwind.h (revision 186613) +@@ -80,9 +81,9 @@ shmedia_fallback_frame_state (struct _Un + && (*(unsigned long *) (pc+11) == 0x6ff0fff0)) + { + struct rt_sigframe { +- struct siginfo *pinfo; ++ siginfo_t *pinfo; + void *puc; +- struct siginfo info; ++ siginfo_t info; + struct ucontext uc; + } *rt_ = context->cfa; + /* The void * cast is necessary to avoid an aliasing warning. +@@ -179,7 +180,7 @@ sh_fallback_frame_state (struct _Unwind_ + && (*(unsigned short *) (pc+14) == 0x00ad)))) + { + struct rt_sigframe { +- struct siginfo info; ++ siginfo_t info; + struct ucontext uc; + } *rt_ = context->cfa; + /* The void * cast is necessary to avoid an aliasing warning. +--- gcc/config/xtensa/linux-unwind.h (revision 186612) ++++ gcc/config/xtensa/linux-unwind.h (revision 186613) +@@ -62,7 +62,7 @@ xtensa_fallback_frame_state (struct _Unw + struct sigcontext *sc; + + struct rt_sigframe { +- struct siginfo info; ++ siginfo_t info; + struct ucontext uc; + } *rt_; + +--- gcc/config/ia64/linux-unwind.h (revision 186612) ++++ gcc/config/ia64/linux-unwind.h (revision 186613) +@@ -47,7 +47,7 @@ ia64_fallback_frame_state (struct _Unwin + struct sigframe { + char scratch[16]; + unsigned long sig_number; +- struct siginfo *info; ++ siginfo_t *info; + struct sigcontext *sc; + } *frame_ = (struct sigframe *)context->psp; + struct sigcontext *sc = frame_->sc; +@@ -137,7 +137,7 @@ ia64_handle_unwabi (struct _Unwind_Conte + struct sigframe { + char scratch[16]; + unsigned long sig_number; +- struct siginfo *info; ++ siginfo_t *info; + struct sigcontext *sc; + } *frame = (struct sigframe *)context->psp; + struct sigcontext *sc = frame->sc; +--- gcc/config/pa/linux-unwind.h (revision 186612) ++++ gcc/config/pa/linux-unwind.h (revision 186613) +@@ -63,7 +63,7 @@ pa32_fallback_frame_state (struct _Unwin + int i; + struct sigcontext *sc; + struct rt_sigframe { +- struct siginfo info; ++ siginfo_t info; + struct ucontext uc; + } *frame; + +--- gcc/config/mips/linux-unwind.h (revision 186612) ++++ gcc/config/mips/linux-unwind.h (revision 186613) +@@ -75,7 +76,7 @@ mips_fallback_frame_state (struct _Unwin + struct rt_sigframe { + u_int32_t ass[4]; /* Argument save space for o32. */ + u_int32_t trampoline[2]; +- struct siginfo info; ++ siginfo_t info; + _sig_ucontext_t uc; + } *rt_ = context->cfa; + sc = &rt_->uc.uc_mcontext; +--- gcc/config/bfin/linux-unwind.h (revision 186612) ++++ gcc/config/bfin/linux-unwind.h (revision 186613) +@@ -48,10 +48,10 @@ bfin_fallback_frame_state (struct _Unwin + { + struct rt_sigframe { + int sig; +- struct siginfo *pinfo; ++ siginfo_t *pinfo; + void *puc; + char retcode[8]; +- struct siginfo info; ++ siginfo_t info; + struct ucontext uc; + } *rt_ = context->cfa; + diff --git a/SOURCES/gcc44-sparc-config-detection.patch b/SOURCES/gcc44-sparc-config-detection.patch new file mode 100644 index 0000000..9c6b57e --- /dev/null +++ b/SOURCES/gcc44-sparc-config-detection.patch @@ -0,0 +1,40 @@ +--- gcc/config.gcc.jj 2008-04-24 15:42:46.000000000 -0500 ++++ gcc/config.gcc 2008-04-24 15:44:51.000000000 -0500 +@@ -2175,7 +2175,7 @@ sparc-*-elf*) + tmake_file="sparc/t-elf sparc/t-crtfm" + extra_parts="crti.o crtn.o crtbegin.o crtend.o" + ;; +-sparc-*-linux*) # SPARC's running GNU/Linux, libc6 ++sparc-*-linux* | sparcv9*-*-linux*) # SPARC's running GNU/Linux, libc6 + tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/gas.h linux.h" + extra_options="${extra_options} sparc/long-double-switch.opt" + tmake_file="${tmake_file} sparc/t-linux" +@@ -2287,7 +2287,7 @@ sparc64-*-freebsd*|ultrasparc-*-freebsd* + *) echo "$with_cpu not supported for freebsd target"; exit 1 ;; + esac + ;; +-sparc64-*-linux*) # 64-bit SPARC's running GNU/Linux ++sparc64*-*-linux*) # 64-bit SPARC's running GNU/Linux + tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/gas.h linux.h sparc/linux64.h" + extra_options="${extra_options} sparc/long-double-switch.opt" + tmake_file="${tmake_file} sparc/t-linux sparc/t-linux64 sparc/t-crtfm" +--- libgcc/config.host.jj 2008-04-24 15:46:19.000000000 -0500 ++++ libgcc/config.host 2008-04-24 15:46:49.000000000 -0500 +@@ -572,7 +572,7 @@ sparc64-*-openbsd*) + ;; + sparc-*-elf*) + ;; +-sparc-*-linux*) # SPARC's running GNU/Linux, libc6 ++sparc-*-linux* | sparcv9*-*-linux*) # SPARC's running GNU/Linux, libc6 + extra_parts="$extra_parts crtfastmath.o" + tmake_file="${tmake_file} sparc/t-crtfm" + ;; +@@ -590,7 +590,7 @@ sparc-wrs-vxworks) + ;; + sparc64-*-freebsd*|ultrasparc-*-freebsd*) + ;; +-sparc64-*-linux*) # 64-bit SPARC's running GNU/Linux ++sparc64*-*-linux*) # 64-bit SPARC's running GNU/Linux + extra_parts="$extra_parts crtfastmath.o" + tmake_file="${tmake_file} sparc/t-crtfm" + ;; diff --git a/SOURCES/gcc44-texinfo.patch b/SOURCES/gcc44-texinfo.patch new file mode 100644 index 0000000..8deda2b --- /dev/null +++ b/SOURCES/gcc44-texinfo.patch @@ -0,0 +1,113 @@ +2013-03-20 Jack Howarth + + PR bootstrap/56258 + * doc/c-tree.texi (POINTER_PLUS_EXPR): Use @item instead of @itemx. + (PLUS_EXPR): Likewise. + * doc/cppopts.texi (--help): Likewise. + * doc/invoke.texi (-fenable-@var{kind}-@var{pass}): Likewise + (-fdump-rtl-cprop_hardreg): Likewise. + (-fdump-rtl-csa): Likewise. + (-fdump-rtl-dce): Likewise. + (-fdump-rtl-dbr): Likewise. + (-fdump-rtl-into_cfglayout): Likewise. + (-fdump-rtl-outof_cfglayout): Likewise. + (@gccoptlist): Move misplaced bracket. + * doc/sourcebuild.texi (all.cross): Use @item instead of @itemx. + +--- gcc/doc/c-tree.texi (revision 196819) ++++ gcc/doc/c-tree.texi (revision 196820) +@@ -2338,13 +2338,13 @@ generate these expressions anyhow, if it + not matter. The type of the operands and that of the result are + always of @code{BOOLEAN_TYPE} or @code{INTEGER_TYPE}. + +-@itemx POINTER_PLUS_EXPR ++@item POINTER_PLUS_EXPR + This node represents pointer arithmetic. The first operand is always + a pointer/reference type. The second operand is always an unsigned + integer type compatible with sizetype. This is the only binary + arithmetic operand that can operate on pointer types. + +-@itemx PLUS_EXPR ++@item PLUS_EXPR + @itemx MINUS_EXPR + @itemx MULT_EXPR + These nodes represent various binary arithmetic operations. +--- gcc/doc/cppopts.texi (revision 196819) ++++ gcc/doc/cppopts.texi (revision 196820) +@@ -758,7 +758,7 @@ Replacement: [ ] @{ @} + Enable special code to work around file systems which only permit very + short file names, such as MS-DOS@. + +-@itemx --help ++@item --help + @itemx --target-help + @opindex help + @opindex target-help +--- gcc/doc/invoke.texi (revision 196819) ++++ gcc/doc/invoke.texi (revision 196820) +@@ -4749,11 +4749,11 @@ Dump after duplicating the computed goto + @option{-fdump-rtl-ce3} enable dumping after the three + if conversion passes. + +-@itemx -fdump-rtl-cprop_hardreg ++@item -fdump-rtl-cprop_hardreg + @opindex fdump-rtl-cprop_hardreg + Dump after hard register copy propagation. + +-@itemx -fdump-rtl-csa ++@item -fdump-rtl-csa + @opindex fdump-rtl-csa + Dump after combining stack adjustments. + +@@ -4764,11 +4764,11 @@ Dump after combining stack adjustments. + @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after + the two common sub-expression elimination passes. + +-@itemx -fdump-rtl-dce ++@item -fdump-rtl-dce + @opindex fdump-rtl-dce + Dump after the standalone dead code elimination passes. + +-@itemx -fdump-rtl-dbr ++@item -fdump-rtl-dbr + @opindex fdump-rtl-dbr + Dump after delayed branch scheduling. + +@@ -4813,7 +4813,7 @@ Dump after the initialization of the reg + @opindex fdump-rtl-initvals + Dump after the computation of the initial value sets. + +-@itemx -fdump-rtl-into_cfglayout ++@item -fdump-rtl-into_cfglayout + @opindex fdump-rtl-into_cfglayout + Dump after converting to cfglayout mode. + +@@ -4843,7 +4843,7 @@ Dump after removing redundant mode switc + @opindex fdump-rtl-rnreg + Dump after register renumbering. + +-@itemx -fdump-rtl-outof_cfglayout ++@item -fdump-rtl-outof_cfglayout + @opindex fdump-rtl-outof_cfglayout + Dump after converting from cfglayout mode. + +@@ -4855,7 +4855,7 @@ Dump after the peephole pass. + @opindex fdump-rtl-postreload + Dump after post-reload optimizations. + +-@itemx -fdump-rtl-pro_and_epilogue ++@item -fdump-rtl-pro_and_epilogue + @opindex fdump-rtl-pro_and_epilogue + Dump after generating the function pro and epilogues. + +--- gcc/doc/sourcebuild.texi.jj 2010-05-25 18:19:29.000000000 -0400 ++++ gcc/doc/sourcebuild.texi 2013-07-20 22:00:49.715657448 -0400 +@@ -573,7 +573,7 @@ standard rule in @file{gcc/Makefile.in} + @code{lang_checks}. + + @table @code +-@itemx all.cross ++@item all.cross + @itemx start.encap + @itemx rest.encap + FIXME: exactly what goes in each of these targets? diff --git a/SOURCES/gcc44-unwind-debug-hook.patch b/SOURCES/gcc44-unwind-debug-hook.patch new file mode 100644 index 0000000..9b7c59e --- /dev/null +++ b/SOURCES/gcc44-unwind-debug-hook.patch @@ -0,0 +1,51 @@ +2010-04-27 Jakub Jelinek + + * unwind-dw2.c (_Unwind_DebugHook): Add used attribute. + +2009-05-27 Tom Tromey + + * unwind-dw2.c (_Unwind_DebugHook): New function. + (uw_install_context): Call _Unwind_DebugHook. + +--- gcc/unwind-dw2.c (revision 147933) ++++ gcc/unwind-dw2.c (revision 147934) +@@ -1473,18 +1473,32 @@ uw_init_context_1 (struct _Unwind_Contex + context->ra = __builtin_extract_return_addr (outer_ra); + } + ++static void _Unwind_DebugHook (void *, void *) ++ __attribute__ ((__noinline__, __used__)); ++ ++/* This function is called during unwinding. It is intended as a hook ++ for a debugger to intercept exceptions. CFA is the CFA of the ++ target frame. HANDLER is the PC to which control will be ++ transferred. */ ++static void ++_Unwind_DebugHook (void *cfa __attribute__ ((__unused__)), ++ void *handler __attribute__ ((__unused__))) ++{ ++ asm (""); ++} + + /* Install TARGET into CURRENT so that we can return to it. This is a + macro because __builtin_eh_return must be invoked in the context of + our caller. */ + +-#define uw_install_context(CURRENT, TARGET) \ +- do \ +- { \ +- long offset = uw_install_context_1 ((CURRENT), (TARGET)); \ +- void *handler = __builtin_frob_return_addr ((TARGET)->ra); \ +- __builtin_eh_return (offset, handler); \ +- } \ ++#define uw_install_context(CURRENT, TARGET) \ ++ do \ ++ { \ ++ long offset = uw_install_context_1 ((CURRENT), (TARGET)); \ ++ void *handler = __builtin_frob_return_addr ((TARGET)->ra); \ ++ _Unwind_DebugHook ((TARGET)->cfa, handler); \ ++ __builtin_eh_return (offset, handler); \ ++ } \ + while (0) + + static long diff --git a/SPECS/compat-gcc-44.spec b/SPECS/compat-gcc-44.spec new file mode 100644 index 0000000..156c0c6 --- /dev/null +++ b/SPECS/compat-gcc-44.spec @@ -0,0 +1,870 @@ +%global DATE 20120601 +%global SVNREV 188105 +# Note, gcc_release must be integer, if you want to add suffixes to +# %{release}, append them after %{gcc_release} on Release: line. +%global gcc_release 4 +%global _unpackaged_files_terminate_build 0 +%global multilib_64_archs sparc64 ppc64 s390x x86_64 +%ifarch s390x +%global multilib_32_arch s390 +%endif +%ifarch sparc64 +%global multilib_32_arch sparcv9 +%endif +%ifarch ppc64 +%global multilib_32_arch ppc +%endif +%ifarch x86_64 +%global multilib_32_arch i686 +%endif +Summary: Compatibility GNU Compiler Collection +Name: compat-gcc-44 +Version: 4.4.7 +Release: %{gcc_release}.1%{?dist} +# libgcc, libgfortran, libmudflap, libgomp, libstdc++ and crtstuff have +# GCC Runtime Exception. +License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions +Group: Development/Languages +# The source for this package was pulled from upstream's vcs. Use the +# following commands to generate the tarball: +# svn export svn://gcc.gnu.org/svn/gcc/branches/redhat/gcc-4_4-branch@%{SVNREV} gcc-%{version}-%{DATE} +# tar cf - gcc-%{version}-%{DATE} | bzip2 -9 > gcc-%{version}-%{DATE}.tar.bz2 +Source0: gcc-%{version}-%{DATE}.tar.bz2 +Source1: dummylib.sh +URL: http://gcc.gnu.org +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +# Need binutils with -pie support >= 2.14.90.0.4-4 +# Need binutils which can omit dot symbols and overlap .opd on ppc64 >= 2.15.91.0.2-4 +# Need binutils which handle -msecure-plt on ppc >= 2.16.91.0.2-2 +# Need binutils which support .weakref >= 2.16.91.0.3-1 +# Need binutils which support --hash-style=gnu >= 2.17.50.0.2-7 +# Need binutils which support mffgpr and mftgpr >= 2.17.50.0.2-8 +# Need binutils which support --build-id >= 2.17.50.0.17-3 +# Need binutils which support %gnu_unique_object >= 2.19.51.0.14 +# Need binutils which support .cfi_sections >= 2.19.51.0.14-33 +# Need binutils which support --no-add-needed >= 2.20.51.0.2-12 +BuildRequires: binutils >= 2.20.51.0.2-12 +# While gcc doesn't include statically linked binaries, during testing +# -static is used several times. +BuildRequires: glibc-static +BuildRequires: zlib-devel, gettext, dejagnu, bison, flex, texinfo, sharutils +# For VTA guality testing +BuildRequires: gdb +# Make sure pthread.h doesn't contain __thread tokens +# Make sure glibc supports stack protector +# Make sure glibc supports DT_GNU_HASH +BuildRequires: glibc-devel >= 2.4.90-13 +BuildRequires: elfutils-devel >= 0.72 +%ifarch ppc ppc64 s390 s390x sparc sparcv9 alpha +# Make sure glibc supports TFmode long double +BuildRequires: glibc >= 2.3.90-35 +%endif +%ifarch %{multilib_64_archs} sparcv9 ppc +# Ensure glibc{,-devel} is installed for both multilib arches +BuildRequires: /lib/libc.so.6 /usr/lib/libc.so /lib64/libc.so.6 /usr/lib64/libc.so +%endif +%ifarch ia64 +BuildRequires: libunwind >= 0.98 +%endif +# Need .eh_frame ld optimizations +# Need proper visibility support +# Need -pie support +# Need --as-needed/--no-as-needed support +# On ppc64, need omit dot symbols support and --non-overlapping-opd +# Need binutils that owns /usr/bin/c++filt +# Need binutils that support .weakref +# Need binutils that supports --hash-style=gnu +# Need binutils that support mffgpr/mftgpr +# Need binutils that support --build-id +# Need binutils that support %gnu_unique_object +# Need binutils that support .cfi_sections +# Need binutils that support --no-add-needed +Requires: binutils >= 2.20.51.0.2-12 +# Make sure gdb will understand DW_FORM_strp +Conflicts: gdb < 5.1-2 +Requires: glibc-devel >= 2.2.90-12 +%ifarch ppc ppc64 s390 s390x sparc sparcv9 alpha +# Make sure glibc supports TFmode long double +Requires: glibc >= 2.3.90-35 +%endif +Requires: libgcc >= %{version}-%{release} +Requires: libgomp >= %{version}-%{release} +AutoReq: true +AutoProv: false +Obsoletes: compat-egcs +Obsoletes: compat-gcc +Obsoletes: compat-gcc-objc +Obsoletes: compat-egcs-objc +Obsoletes: compat-gcc-g77 +Obsoletes: compat-egcs-g77 +Obsoletes: compat-gcc-java +Obsoletes: compat-libgcj +Obsoletes: compat-libgcj-devel +Obsoletes: compat-gcc-32 +Obsoletes: compat-gcc-34 +Obsoletes: gcc44 + +Patch0: gcc44-hack.patch +Patch1: gcc44-build-id.patch +Patch2: gcc44-c++-builtin-redecl.patch +Patch3: gcc44-ia64-libunwind.patch +Patch4: gcc44-java-nomulti.patch +Patch5: gcc44-ppc32-retaddr.patch +Patch6: gcc44-pr33763.patch +Patch7: gcc44-rh330771.patch +Patch8: gcc44-i386-libgomp.patch +Patch9: gcc44-sparc-config-detection.patch +Patch10: gcc44-libgomp-omp_h-multilib.patch +Patch11: gcc44-libtool-no-rpath.patch +Patch12: gcc44-cloog-dl.patch +Patch13: gcc44-unwind-debug-hook.patch +Patch14: gcc44-pr38757.patch +Patch15: gcc44-libstdc++-docs.patch +Patch16: gcc44-ppc64-aixdesc.patch +Patch17: gcc44-no-add-needed.patch +Patch18: gcc44-rh610785.patch +Patch19: gcc44-rh533181.patch +Patch20: gcc44-pr48857-test.patch +Patch21: gcc44-pr43680.patch +Patch22: gcc44-rh750545.patch +Patch23: gcc44-pr53199.patch +Patch24: gcc44-rh801144.patch +Patch25: gcc44-rh808590.patch +Patch26: gcc44-rh820281.patch +Patch27: gcc44-pr54858.patch +Patch28: gcc44-pr54487.patch +Patch29: gcc44-rh867878.patch +Patch30: gcc44-pr49146.patch +Patch31: gcc44-pr56403.patch +Patch32: gcc44-rh906234.patch +Patch33: gcc44-rh908025.patch +Patch34: gcc44-rh967003.patch + +Patch100: gcc44-texinfo.patch +Patch101: gcc44-siginfo_t.patch + +# On ARM EABI systems, we do want -gnueabi to be part of the +# target triple. +%ifnarch %{arm} +%global _gnu %{nil} +%endif +%ifarch sparcv9 +%global gcc_target_platform sparc64-%{_vendor}-%{_target_os} +%endif +%ifarch ppc +%global gcc_target_platform ppc64-%{_vendor}-%{_target_os} +%endif +%ifnarch sparcv9 ppc +%global gcc_target_platform %{_target_platform} +%endif + +%description +This package includes a GCC 4.4.7-RH compatibility compiler. + +%package c++ +Summary: C++ support for compatibility compiler +Group: Development/Languages +Requires: compat-gcc-44 = %{version}-%{release} +Requires: libstdc++ >= 4.8.0, libstdc++ < 4.9.0 +BuildRequires: libstdc++ +Autoreq: true +Autoprov: false +Obsoletes: compat-egcs-c++ +Obsoletes: compat-gcc-c++ +Obsoletes: compat-libstdc++ +Obsoletes: compat-libstdc++-devel +Obsoletes: compat-gcc-32-c++ +Obsoletes: compat-gcc-34-c++ +Obsoletes: gcc44-c++ + +%description c++ +This package includes a GCC 4.4.7-RH compatibility C++ compiler. + +%package gfortran +Summary: Fortran support for compatibility compiler +Group: Development/Languages +Requires: compat-gcc-44 = %{version}-%{release} +Requires: libgfortran >= 4.8.0, libgfortran < 4.9.0 +BuildRequires: gmp-devel >= 4.1.2-8, mpfr-devel >= 2.2.1 +BuildRequires: libgfortran +Autoreq: true +Autoprov: false +Obsoletes: gcc3-g77 +Obsoletes: gcc-g77 +Obsoletes: compat-gcc-32-g77 +Obsoletes: compat-gcc-34-g77 +Obsoletes: gcc44-gfortran + +%description gfortran +This package includes a GCC 4.4.7-RH compatibility Fortran compiler. + +%prep +%setup -q -n gcc-%{version}-%{DATE} +%patch0 -p0 -b .hack~ +%patch1 -p0 -b .build-id~ +%patch2 -p0 -b .c++-builtin-redecl~ +%patch3 -p0 -b .ia64-libunwind~ +%patch4 -p0 -b .java-nomulti~ +%patch5 -p0 -b .ppc32-retaddr~ +%patch6 -p0 -b .pr33763~ +%patch7 -p0 -b .rh330771~ +%patch8 -p0 -b .i386-libgomp~ +%patch9 -p0 -b .sparc-config-detection~ +%patch10 -p0 -b .libgomp-omp_h-multilib~ +%patch11 -p0 -b .libtool-no-rpath~ +%patch13 -p0 -b .unwind-debug-hook~ +%patch14 -p0 -b .pr38757~ +%patch16 -p0 -b .ppc64-aixdesc~ +%patch17 -p0 -b .no-add-needed~ +%patch18 -p0 -b .rh610785~ +%patch19 -p0 -b .rh533181~ +%patch20 -p0 -b .pr48857-test~ +%patch21 -p0 -b .pr43680~ +%patch22 -p0 -b .rh750545~ +%patch23 -p0 -b .pr53199~ +%patch24 -p0 -b .rh801144~ +%patch25 -p0 -b .rh808590~ +%patch26 -p0 -b .rh820281~ +%patch27 -p0 -b .pr54858~ +%patch28 -p0 -b .pr54487~ +%patch29 -p0 -b .rh867878~ +%patch30 -p0 -b .pr49146~ +%patch31 -p0 -b .pr56403~ +%patch32 -p0 -b .rh906234~ +%patch33 -p0 -b .rh908025~ +%patch34 -p0 -b .rh967003~ + +%patch100 -p0 -b .texinfo~ +%patch101 -p0 -b .siginfo_t~ + +#sed -i -e 's/4\.4\.7/4.4.7/' gcc/BASE-VER +echo 'Red Hat %{version}-%{gcc_release}' > gcc/DEV-PHASE + +# Default to -gdwarf-3 rather than -gdwarf-2 +sed -i '/UInteger Var(dwarf_version)/s/Init(2)/Init(3)/' gcc/common.opt +sed -i 's/\(may be either 2 or 3; the default version is \)2\./\13./' gcc/doc/invoke.texi + +cp -a libstdc++-v3/config/cpu/i{4,3}86/atomicity.h + +./contrib/gcc_update --touch + +LC_ALL=C sed -i -e 's/\xa0/ /' gcc/doc/options.texi + +%ifarch ppc +if [ -d libstdc++-v3/config/abi/post/powerpc64-linux-gnu ]; then + mkdir -p libstdc++-v3/config/abi/post/powerpc64-linux-gnu/64 + mv libstdc++-v3/config/abi/post/powerpc64-linux-gnu/{,64/}baseline_symbols.txt + mv libstdc++-v3/config/abi/post/powerpc64-linux-gnu/{32/,}baseline_symbols.txt + rm -rf libstdc++-v3/config/abi/post/powerpc64-linux-gnu/32 +fi +%endif +%ifarch sparc +if [ -d libstdc++-v3/config/abi/post/sparc64-linux-gnu ]; then + mkdir -p libstdc++-v3/config/abi/post/sparc64-linux-gnu/64 + mv libstdc++-v3/config/abi/post/sparc64-linux-gnu/{,64/}baseline_symbols.txt + mv libstdc++-v3/config/abi/post/sparc64-linux-gnu/{32/,}baseline_symbols.txt + rm -rf libstdc++-v3/config/abi/post/sparc64-linux-gnu/32 +fi +%endif + +%build + +rm -fr obj-%{gcc_target_platform} +mkdir obj-%{gcc_target_platform} +cd obj-%{gcc_target_platform} + +CC=gcc +OPT_FLAGS=`echo %{optflags}|sed -e 's/\(-Wp,\)\?-D_FORTIFY_SOURCE=[12]//g'` +OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-m64//g;s/-m32//g;s/-m31//g'` +%ifarch sparc +OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-mcpu=ultrasparc/-mtune=ultrasparc/g;s/-mcpu=v[78]//g'` +%endif +OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-grecord-gcc-switches//g'` +%ifarch %{ix86} +OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-march=i.86//g'` +%endif +%ifarch ppc ppc64 +OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-march=power[467]//g;s/-mtune=power[678]//g'` +%endif +%ifarch s390 s390x +OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-march=z10//g;s/-march=z196//g;s/-mtune=zEC12//g'` +%endif +%ifarch sparc64 +cat > gcc64 <<"EOF" +#!/bin/sh +exec /usr/bin/gcc -m64 "$@" +EOF +chmod +x gcc64 +CC=`pwd`/gcc64 +%endif +%ifarch ppc64 +if gcc -m64 -xc -S /dev/null -o - > /dev/null 2>&1; then + cat > gcc64 <<"EOF" +#!/bin/sh +exec /usr/bin/gcc -m64 "$@" +EOF + chmod +x gcc64 + CC=`pwd`/gcc64 +fi +%endif +OPT_FLAGS=`echo "$OPT_FLAGS" | sed -e 's/[[:blank:]]\+/ /g'` +case "$OPT_FLAGS" in + *-fasynchronous-unwind-tables*) + sed -i -e 's/-fno-exceptions /-fno-exceptions -fno-asynchronous-unwind-tables/' \ + ../gcc/Makefile.in + ;; +esac +CC="$CC" CFLAGS="$OPT_FLAGS" CXXFLAGS="`echo $OPT_FLAGS | sed 's/ -Wall / /g'`" XCFLAGS="$OPT_FLAGS" TCFLAGS="$OPT_FLAGS" \ + GCJFLAGS="$OPT_FLAGS" \ + ../configure --prefix=%{_prefix} --mandir=%{_mandir} --infodir=%{_infodir} \ + --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap \ + --enable-shared --enable-threads=posix --enable-checking=release \ + --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions \ + --enable-gnu-unique-object --enable-languages=c,c++,fortran --disable-libgcj \ + --without-cloog --without-ppl \ +%ifarch %{arm} + --disable-sjlj-exceptions \ +%endif +%ifarch ppc ppc64 + --enable-secureplt \ +%endif +%ifarch sparc sparcv9 sparc64 ppc ppc64 s390 s390x alpha + --with-long-double-128 \ +%endif +%ifarch sparc + --disable-linux-futex \ +%endif +%ifarch sparc64 + --with-cpu=ultrasparc \ +%endif +%ifarch sparc sparcv9 + --host=%{gcc_target_platform} --build=%{gcc_target_platform} --target=%{gcc_target_platform} --with-cpu=v7 +%endif +%if 0%{?rhel} >= 6 +%ifarch ppc ppc64 + --with-cpu-32=power4 --with-tune-32=power6 --with-cpu-64=power4 --with-tune-64=power6 \ +%endif +%endif +%ifarch ppc + --build=%{gcc_target_platform} --target=%{gcc_target_platform} --with-cpu=default32 +%endif +%ifarch %{ix86} x86_64 + --with-tune=generic \ +%endif +%ifarch %{ix86} + --with-arch=i686 \ +%endif +%ifarch x86_64 + --with-arch_32=i686 \ +%endif +%ifarch s390 s390x + --with-arch=z9-109 --with-tune=z10 --enable-decimal-float \ +%endif +%ifnarch sparc sparcv9 ppc + --build=%{gcc_target_platform} +%endif + +#GCJFLAGS="$OPT_FLAGS" make %{?_smp_mflags} BOOT_CFLAGS="$OPT_FLAGS" bootstrap +GCJFLAGS="$OPT_FLAGS" make %{?_smp_mflags} BOOT_CFLAGS="$OPT_FLAGS" profiledbootstrap + +# Make generated man pages even if Pod::Man is not new enough +perl -pi -e 's/head3/head2/' ../contrib/texi2pod.pl +for i in ../gcc/doc/*.texi; do + cp -a $i $i.orig; sed 's/ftable/table/' $i.orig > $i +done +make -C gcc generated-manpages +for i in ../gcc/doc/*.texi; do mv -f $i.orig $i; done + +# Make generated doxygen pages. + +# Copy various doc files here and there +cd .. +mkdir -p rpm.doc/gfortran +mkdir -p rpm.doc/changelogs/{gcc/cp,libstdc++-v3,libmudflap,libgomp} + +for i in {gcc,gcc/cp,libstdc++-v3,libmudflap,libgomp}/ChangeLog*; do + cp -p $i rpm.doc/changelogs/$i +done + +(cd gcc/fortran; for i in ChangeLog*; do + cp -p $i ../../rpm.doc/gfortran/$i +done) +(cd libgfortran; for i in ChangeLog*; do + cp -p $i ../rpm.doc/gfortran/$i.libgfortran +done) + +rm -f rpm.doc/changelogs/gcc/ChangeLog.[1-9] +find rpm.doc -name \*ChangeLog\* | xargs bzip2 -9 + +cd - + +# Fix up libstdc++.so's +d_first=yes +for d in `pwd`/%{gcc_target_platform}/libstdc++-v3 `pwd`/%{gcc_target_platform}/*/libstdc++-v3; do + test -d $d || continue + pushd $d/src + sh %{SOURCE1} .libs/libstdc++.so .libs/ll.so libstdc++-symbols.ver + rm .libs/libstdc++.so; cp .libs/ll.so .libs/libstdc++.so + if [ x"$d_first" = xyes ]; then + rm .libs/libstdc++.so.6 + libstdcxx_so=`basename %{_prefix}/%{_lib}/libstdc++.so.6.0.*` + cp -a %{_prefix}/%{_lib}/$libstdcxx_so .libs/ + cd .libs; ln -sf $libstdcxx_so libstdc++.so.6; cd - + d_first=no + fi + popd +done +# Fix up libgomp.so's +d_first=yes +for d in `pwd`/%{gcc_target_platform}/libgomp `pwd`/%{gcc_target_platform}/*/libgomp; do + test -d $d || continue + mapf=`pwd`/../libgomp/libgomp.map + pushd $d + sh %{SOURCE1} .libs/libgomp.so .libs/ll.so $mapf + rm .libs/libgomp.so; cp .libs/ll.so .libs/libgomp.so + if [ x"$d_first" = xyes ]; then + rm .libs/libgomp.so.1 + libgomp_so=`basename %{_prefix}/%{_lib}/libgomp.so.1.0.*` + cp -a %{_prefix}/%{_lib}/$libgomp_so .libs/ + cd .libs; ln -sf $libgomp_so libgomp.so.1; cd - + d_first=no + fi + popd +done +# Fix up libgfortran.so's +d_first=yes +for d in `pwd`/%{gcc_target_platform}/libgfortran `pwd`/%{gcc_target_platform}/*/libgfortran; do + test -d $d || continue + mapf=`pwd`/../libgfortran/gfortran.map + pushd $d + sh %{SOURCE1} .libs/libgfortran.so .libs/ll.so $mapf + rm .libs/libgfortran.so; cp .libs/ll.so .libs/libgfortran.so + if [ x"$d_first" = xyes ]; then + rm .libs/libgfortran.so.3 + libgfortran_so=`basename %{_prefix}/%{_lib}/libgfortran.so.3.0.*` + cp -a %{_prefix}/%{_lib}/$libgfortran_so .libs/ + cd .libs; ln -sf $libgfortran_so libgfortran.so.3; cd - + d_first=no + fi + popd +done +# Fix up libgcc_s.so's +d_first=yes +for d in `pwd`/%{gcc_target_platform}/libgcc `pwd`/%{gcc_target_platform}/*/libgcc/*/; do + test -d $d || continue + pushd $d + mapf=libgcc.map + if [ ! -f $mapf ]; then mapf=../libgcc.map; fi + sh %{SOURCE1} libgcc_s.so ll.so $mapf + rm libgcc_s.so; cp ll.so libgcc_s.so + if [ x"$d_first" = xyes ]; then + rm libgcc_s.so.1 + libgcc_s_so=`basename /%{_lib}/libgcc_s-4*.so.1` + cp -a /%{_lib}/$libgcc_s_so . + ln -sf $libgcc_s_so libgcc_s.so.1 + d_first=no + fi + popd +done + +%install +rm -fr %{buildroot} + +cd obj-%{gcc_target_platform} + +TARGET_PLATFORM=%{gcc_target_platform} + +# There are some MP bugs in libstdc++ Makefiles +make -C %{gcc_target_platform}/libstdc++-v3 + +make prefix=%{buildroot}%{_prefix} mandir=%{buildroot}%{_mandir} \ + infodir=%{buildroot}%{_infodir} install + +FULLPATH=%{buildroot}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version} +FULLEPATH=%{buildroot}%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{version} + +# fix some things +gzip -9 %{buildroot}%{_infodir}/*.info* + +cxxconfig="`find %{gcc_target_platform}/libstdc++-v3/include -name c++config.h`" +for i in `find %{gcc_target_platform}/[36]*/libstdc++-v3/include -name c++config.h 2>/dev/null`; do + if ! diff -up $cxxconfig $i; then + cat > %{buildroot}%{_prefix}/include/c++/%{version}/%{gcc_target_platform}/bits/c++config.h < +#if __WORDSIZE == 32 +%ifarch %{multilib_64_archs} +`cat $(find %{gcc_target_platform}/32/libstdc++-v3/include -name c++config.h)` +%else +`cat $(find %{gcc_target_platform}/libstdc++-v3/include -name c++config.h)` +%endif +#else +%ifarch %{multilib_64_archs} +`cat $(find %{gcc_target_platform}/libstdc++-v3/include -name c++config.h)` +%else +`cat $(find %{gcc_target_platform}/64/libstdc++-v3/include -name c++config.h)` +%endif +#endif +#endif +EOF + break + fi +done + +for f in `find %{buildroot}%{_prefix}/include/c++/%{version}/%{gcc_target_platform}/ -name c++config.h`; do + for i in 1 2 4 8; do + sed -i -e 's/#define _GLIBCXX_ATOMIC_BUILTINS_'$i' 1/#ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_'$i'\ +&\ +#endif/' $f + done +done + +# Nuke bits/stdc++.h.gch dirs +# 1) there is no bits/stdc++.h header installed, so when gch file can't be +# used, compilation fails +# 2) sometimes it is hard to match the exact options used for building +# libstdc++-v3 or they aren't desirable +# 3) there are multilib issues, conflicts etc. with this +# 4) it is huge +# People can always precompile on their own whatever they want, but +# shipping this for everybody is unnecessary. +rm -rf %{buildroot}%{_prefix}/include/c++/%{version}/%{gcc_target_platform}/bits/stdc++.h.gch + +%ifarch sparcv9 sparc64 +ln -f %{buildroot}%{_prefix}/bin/%{gcc_target_platform}-gcc \ + %{buildroot}%{_prefix}/bin/sparc-%{_vendor}-%{_target_os}-gcc +%endif +%ifarch ppc ppc64 +ln -f %{buildroot}%{_prefix}/bin/%{gcc_target_platform}-gcc \ + %{buildroot}%{_prefix}/bin/ppc-%{_vendor}-%{_target_os}-gcc +%endif + +find %{buildroot} -name \*.la | xargs rm -f + +mv -f %{buildroot}%{_prefix}/%{_lib}/libgomp.spec $FULLPATH/ + +OBJDIR=`pwd`/%{gcc_target_platform} +pushd $FULLPATH +cp -a $OBJDIR/libstdc++-v3/src/.libs/libstdc++.so . +cp -a $OBJDIR/libgfortran/.libs/libgfortran.so . +cp -a $OBJDIR/libgcc/libgcc_s.so . +cp -a $OBJDIR/libgomp/.libs/libgomp.so . +echo 'INPUT ( %{_prefix}/%{_lib}/'`echo ../../../../%{_lib}/libmudflap.so.0.* | sed 's,^.*libm,libm,'`' )' > libmudflap.so +echo 'INPUT ( %{_prefix}/%{_lib}/'`echo ../../../../%{_lib}/libmudflapth.so.0.* | sed 's,^.*libm,libm,'`' )' > libmudflapth.so +mv -f %{buildroot}%{_prefix}/%{_lib}/libstdc++.*a $FULLPATH/ +mv -f %{buildroot}%{_prefix}/%{_lib}/libsupc++.*a $FULLPATH/ +mv -f %{buildroot}%{_prefix}/%{_lib}/libgfortran.*a $FULLPATH/ +mv -f %{buildroot}%{_prefix}/%{_lib}/libgomp.*a $FULLPATH/ +mv -f %{buildroot}%{_prefix}/%{_lib}/libmudflap{,th}.*a $FULLPATH/ + +%ifarch sparcv9 ppc +mkdir -p 64 +cp -a $OBJDIR/64/libstdc++-v3/src/.libs/libstdc++.so 64/ +cp -a $OBJDIR/64/libgfortran/.libs/libgfortran.so 64/ +cp -a $OBJDIR/64/libgcc/64/libgcc_s.so 64/ +cp -a $OBJDIR/64/libgomp/.libs/libgomp.so 64/ +echo 'INPUT ( %{_prefix}/lib64/'`echo ../../../../lib/libmudflap.so.0.* | sed 's,^.*libm,libm,'`' )' > 64/libmudflap.so +echo 'INPUT ( %{_prefix}/lib64/'`echo ../../../../lib/libmudflapth.so.0.* | sed 's,^.*libm,libm,'`' )' > 64/libmudflapth.so +mv -f %{buildroot}%{_prefix}/lib64/libstdc++.*a 64/ +mv -f %{buildroot}%{_prefix}/lib64/libsupc++.*a 64/ +mv -f %{buildroot}%{_prefix}/lib64/libgfortran.*a 64/ +mv -f %{buildroot}%{_prefix}/lib64/libgomp.*a 64/ +mv -f %{buildroot}%{_prefix}/lib64/libmudflap{,th}.*a 64/ +%endif +%ifarch %{multilib_64_archs} +mkdir -p 32 +cp -a $OBJDIR/32/libstdc++-v3/src/.libs/libstdc++.so 32/ +cp -a $OBJDIR/32/libgfortran/.libs/libgfortran.so 32/ +cp -a $OBJDIR/32/libgcc/32/libgcc_s.so 32/ +cp -a $OBJDIR/32/libgomp/.libs/libgomp.so 32/ +echo 'INPUT ( %{_prefix}/lib/'`echo ../../../../lib64/libmudflap.so.0.* | sed 's,^.*libm,libm,'`' )' > 32/libmudflap.so +echo 'INPUT ( %{_prefix}/lib/'`echo ../../../../lib64/libmudflapth.so.0.* | sed 's,^.*libm,libm,'`' )' > 32/libmudflapth.so +mv -f %{buildroot}%{_prefix}/lib/libstdc++.*a 32/ +mv -f %{buildroot}%{_prefix}/lib/libsupc++.*a 32/ +mv -f %{buildroot}%{_prefix}/lib/libgfortran.*a 32/ +mv -f %{buildroot}%{_prefix}/lib/libgomp.*a 32/ +mv -f %{buildroot}%{_prefix}/lib/libmudflap{,th}.*a 32/ +%endif + +%ifarch ppc +mv -f $FULLPATH/libgcc_s.so $FULLPATH/libgcc_s_shared.so +echo '/* GNU ld script + Use the shared library, but some functions are only in + the static library, so try that secondarily. */ +OUTPUT_FORMAT(elf32-powerpc) +GROUP ( libgcc_s_shared.so libgcc.a )' > $FULLPATH/libgcc_s.so +%endif +%ifarch ppc64 +mv -f $FULLPATH/32/libgcc_s.so $FULLPATH/32/libgcc_s_shared.so +echo '/* GNU ld script + Use the shared library, but some functions are only in + the static library, so try that secondarily. */ +OUTPUT_FORMAT(elf32-powerpc) +GROUP ( libgcc_s_shared.so libgcc.a )' > $FULLPATH/32/libgcc_s.so +%endif + +# Strip debug info from Fortran/ObjC/Java static libraries +strip -g `find . \( -name libgfortran.a -o -name libgomp.a \ + -o -name libmudflap.a -o -name libmudflapth.a \ + -o -name libgcc.a -o -name libgcov.a \ + -o -name libstdc++.a -o -name libsupc++.a \ + -o -name libgcc_eh.a \) -a -type f` +chmod 755 %{buildroot}%{_prefix}/%{_lib}/libgfortran.so.3.* +chmod 755 %{buildroot}%{_prefix}/%{_lib}/libgomp.so.1.* +chmod 755 %{buildroot}%{_prefix}/%{_lib}/libmudflap{,th}.so.0.* + +mv $FULLPATH/include-fixed/syslimits.h $FULLPATH/include/syslimits.h +mv $FULLPATH/include-fixed/limits.h $FULLPATH/include/limits.h +for h in `find $FULLPATH/include -name \*.h`; do + if grep -q 'It has been auto-edited by fixincludes from' $h; then + rh=`grep -A2 'It has been auto-edited by fixincludes from' $h | tail -1 | sed 's|^.*"\(.*\)".*$|\1|'` + diff -up $rh $h || : + rm -f $h + fi +done + +cd .. + +for i in %{buildroot}%{_prefix}/bin/{*gcc,*++,gcov,gfortran}; do + mv -f $i ${i}44 +done +for i in %{buildroot}%{_mandir}/man1/{gcc,g++,gcov,gfortran}; do + mv -f $i.1 ${i}44.1 +done +for i in %{buildroot}%{_infodir}/{gcc,gfortran}; do + mv -f $i.info.gz ${i}44.info.gz +done + +# Remove binaries we will not be including, so that they don't end up in +# gcc-debuginfo +rm -f %{buildroot}%{_prefix}/%{_lib}/{libffi*,libiberty.a} +rm -f $FULLEPATH/install-tools/{mkheaders,fixincl} +rm -f %{buildroot}%{_prefix}/lib/{32,64}/libiberty.a +rm -f %{buildroot}%{_prefix}/%{_lib}/libssp* +rm -f %{buildroot}%{_prefix}/bin/%{gcc_target_platform}-{gcc*,c++*,g++*gfortran*} +rm -f %{buildroot}%{_prefix}/bin/cpp + +rm -f %{buildroot}%{_prefix}/%{_lib}/lib*.so* +rm -f %{buildroot}%{_prefix}/%{_lib}/lib*.a +%ifarch %{multilib_64_archs} +# Remove libraries for the other arch on multilib arches +rm -f %{buildroot}%{_prefix}/lib/lib*.so* +rm -f %{buildroot}%{_prefix}/lib/lib*.a +%else +%ifarch sparcv9 ppc +rm -f %{buildroot}%{_prefix}/lib64/lib*.so* +rm -f %{buildroot}%{_prefix}/lib64/lib*.a +%endif +%endif + +%check +cd obj-%{gcc_target_platform} + +# run the tests. +make %{?_smp_mflags} -k check ALT_CC_UNDER_TEST=gcc ALT_CXX_UNDER_TEST=g++ RUNTESTFLAGS="--target_board=unix/'{,-fstack-protector}'" || : +echo ====================TESTING========================= +( LC_ALL=C ../contrib/test_summary || : ) 2>&1 | sed -n '/^cat.*EOF/,/^EOF/{/^cat.*EOF/d;/^EOF/d;/^LAST_UPDATED:/d;p;}' +echo ====================TESTING END===================== +mkdir testlogs-%{_target_platform}-%{version}-%{release} +for i in `find . -name \*.log | grep -F testsuite/ | grep -v 'config.log\|acats.*/tests/'`; do + ln $i testlogs-%{_target_platform}-%{version}-%{release}/ || : +done +tar cf - testlogs-%{_target_platform}-%{version}-%{release} | bzip2 -9c \ + | uuencode testlogs-%{_target_platform}.tar.bz2 || : +rm -rf testlogs-%{_target_platform}-%{version}-%{release} + +%clean +rm -rf %{buildroot} + +%files +%defattr(-,root,root,-) +%{_prefix}/bin/gcc44 +%{_prefix}/bin/gcov44 +%{_mandir}/man1/gcc44.1* +%{_mandir}/man1/gcov44.1* +%{_infodir}/gcc44* +%dir %{_prefix}/lib/gcc +%dir %{_prefix}/lib/gcc/%{gcc_target_platform} +%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{version} +%dir %{_prefix}/libexec/gcc +%dir %{_prefix}/libexec/gcc/%{gcc_target_platform} +%dir %{_prefix}/libexec/gcc/%{gcc_target_platform}/%{version} +%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{version}/cc1 +%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/stddef.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/stdarg.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/stdfix.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/varargs.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/float.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/limits.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/stdbool.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/iso646.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/syslimits.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/unwind.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/omp.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/mf-runtime.h +%ifarch %{ix86} x86_64 +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/mmintrin.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/xmmintrin.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/emmintrin.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/pmmintrin.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/tmmintrin.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/ammintrin.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/smmintrin.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/nmmintrin.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/bmmintrin.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/wmmintrin.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/immintrin.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/avxintrin.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/x86intrin.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/fma4intrin.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/xopintrin.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/lwpintrin.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/abmintrin.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/popcntintrin.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/bmiintrin.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/tbmintrin.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/f16cintrin.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/mm_malloc.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/mm3dnow.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/cpuid.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/cross-stdarg.h +%endif +%ifarch ia64 +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/ia64intrin.h +%endif +%ifarch ppc ppc64 +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/ppc-asm.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/altivec.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/spe.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/paired.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/ppu_intrinsics.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/si2vmx.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/spu2vmx.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/include/vec_types.h +%endif +%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{version}/collect2 +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/crt*.o +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/libgcc.a +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/libgcov.a +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/libgcc_eh.a +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/libgcc_s.so +%ifarch ppc +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/libgcc_s_shared.so +%endif +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/libgomp.spec +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/libgomp.a +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/libgomp.so +%ifarch sparcv9 ppc +%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/64 +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/64/crt*.o +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/64/libgcc.a +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/64/libgcov.a +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/64/libgcc_eh.a +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/64/libgcc_s.so +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/64/libgomp.a +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/64/libgomp.so +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/64/libmudflap.a +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/64/libmudflapth.a +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/64/libmudflap.so +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/64/libmudflapth.so +%endif +%ifarch %{multilib_64_archs} +%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/32 +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/32/crt*.o +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/32/libgcc.a +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/32/libgcov.a +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/32/libgcc_eh.a +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/32/libgcc_s.so +%ifarch ppc64 +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/32/libgcc_s_shared.so +%endif +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/32/libgomp.a +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/32/libgomp.so +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/32/libmudflap.a +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/32/libmudflapth.a +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/32/libmudflap.so +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/32/libmudflapth.so +%endif +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/libmudflap.a +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/libmudflapth.a +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/libmudflap.so +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/libmudflapth.so +%doc gcc/README* rpm.doc/changelogs/gcc/ChangeLog* gcc/COPYING* +%doc rpm.doc/changelogs/libmudflap/ChangeLog* + +%files c++ +%defattr(-,root,root,-) +%{_prefix}/bin/g++44 +%{_mandir}/man1/g++44.1* +%dir %{_prefix}/include/c++ +%dir %{_prefix}/include/c++/%{version} +%{_prefix}/include/c++/%{version}/[^gjos]* +%{_prefix}/include/c++/%{version}/os* +%{_prefix}/include/c++/%{version}/s[^u]* +%dir %{_prefix}/lib/gcc +%dir %{_prefix}/lib/gcc/%{gcc_target_platform} +%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{version} +%dir %{_prefix}/libexec/gcc +%dir %{_prefix}/libexec/gcc/%{gcc_target_platform} +%dir %{_prefix}/libexec/gcc/%{gcc_target_platform}/%{version} +%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{version}/cc1plus +%ifarch sparcv9 ppc +%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/64 +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/64/libstdc++.so +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/64/libstdc++.a +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/64/libsupc++.a +%endif +%ifarch %{multilib_64_archs} +%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/32 +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/32/libstdc++.so +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/32/libstdc++.a +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/32/libsupc++.a +%endif +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/libstdc++.so +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/libstdc++.a +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/libsupc++.a +%doc rpm.doc/changelogs/gcc/cp/ChangeLog* +%doc rpm.doc/changelogs/libstdc++-v3/ChangeLog* libstdc++-v3/README* + +%files gfortran +%defattr(-,root,root,-) +%{_prefix}/bin/gfortran44 +%{_mandir}/man1/gfortran44.1* +%{_infodir}/gfortran44* +%dir %{_prefix}/lib/gcc +%dir %{_prefix}/lib/gcc/%{gcc_target_platform} +%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{version} +%dir %{_prefix}/libexec/gcc +%dir %{_prefix}/libexec/gcc/%{gcc_target_platform} +%dir %{_prefix}/libexec/gcc/%{gcc_target_platform}/%{version} +%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/finclude +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/finclude/omp_lib.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/finclude/omp_lib.f90 +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/finclude/omp_lib.mod +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/finclude/omp_lib_kinds.mod +%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{version}/f951 +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/libgfortranbegin.a +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/libgfortran.a +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/libgfortran.so +%ifarch sparcv9 ppc +%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/64 +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/64/libgfortranbegin.a +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/64/libgfortran.a +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/64/libgfortran.so +%endif +%ifarch %{multilib_64_archs} +%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/32 +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/32/libgfortranbegin.a +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/32/libgfortran.a +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{version}/32/libgfortran.so +%endif +%doc rpm.doc/gfortran/* + +%changelog +* Mon Nov 01 2013 Marek Polacek 4.4.7-4 +- don't obsolete compat-libstdc++-33 (#1031748) + +* Sat Jul 20 2013 Jakub Jelinek 4.4.7-3 +- new compat package