diff --git a/.gcc-libraries.metadata b/.gcc-libraries.metadata new file mode 100644 index 0000000..75a2a6c --- /dev/null +++ b/.gcc-libraries.metadata @@ -0,0 +1,2 @@ +fcbc6afe50a4566e97b19bbe9d4896543b3afbb3 SOURCES/gcc-5.2.1-20150716.tar.bz2 +5ef03ca7aee134fe7dfecb6c9d048799f0810278 SOURCES/mpc-0.8.1.tar.gz diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5ca0c12 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +SOURCES/gcc-5.2.1-20150716.tar.bz2 +SOURCES/mpc-0.8.1.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 98f42b4..0000000 --- a/README.md +++ /dev/null @@ -1,4 +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/gcc5-alt-compat-test.patch b/SOURCES/gcc5-alt-compat-test.patch new file mode 100644 index 0000000..3907d55 --- /dev/null +++ b/SOURCES/gcc5-alt-compat-test.patch @@ -0,0 +1,49 @@ +--- gcc/testsuite/g++.dg/compat/struct-layout-1_generate.c.jj 2011-01-03 06:50:42.000000000 -0500 ++++ gcc/testsuite/g++.dg/compat/struct-layout-1_generate.c 2011-02-18 06:28:53.858200077 -0500 +@@ -1501,6 +1501,8 @@ generate_random_tests (enum FEATURE feat + int i, r; + if (len > 'z' - 'a' + 1) + abort (); ++ if (getenv ("ALT_CXX_UNDER_TEST") != NULL) ++ features &= ~FEATURE_VECTOR; + memset (e, 0, sizeof (e)); + r = generate_random (); + if ((r & 7) == 0) +--- gcc/testsuite/g++.dg/compat/compat.exp.jj 2011-01-03 06:50:42.000000000 -0500 ++++ gcc/testsuite/g++.dg/compat/compat.exp 2011-02-18 06:30:54.248200398 -0500 +@@ -116,7 +116,12 @@ if [info exists ALT_CXX_UNDER_TEST] then + } + + # Main loop. +-foreach src [lsort [find $srcdir/$subdir *_main.C]] { ++set tests [lsort [find $srcdir/$subdir *_main.C]] ++if { $use_alt != 0 } then { ++ set tests [prune $tests $srcdir/$subdir/decimal/*] ++} ++ ++foreach src $tests { + # If we're only testing specific files and this isn't one of them, skip it. + if ![runtest_file_p $runtests $src] then { + continue +--- gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c.jj 2011-01-03 06:49:58.000000000 -0500 ++++ gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c 2011-02-18 06:27:54.922262671 -0500 +@@ -1912,6 +1912,8 @@ generate_random_tests (enum FEATURE feat + int i, r; + if (len > 'z' - 'a' + 1) + abort (); ++ if (getenv ("ALT_CC_UNDER_TEST") != NULL) ++ features &= ~FEATURE_VECTOR; + memset (e, 0, sizeof (e)); + r = generate_random (); + if ((r & 7) == 0) +--- gcc/testsuite/lib/c-compat.exp.jj 2011-01-03 06:48:38.000000000 -0500 ++++ gcc/testsuite/lib/c-compat.exp 2011-02-18 06:38:19.124265008 -0500 +@@ -75,7 +75,7 @@ proc compat_setup_dfp { } { + # If there is an alternate compiler, does it support decimal float types? + if { $compat_have_dfp == 1 && $compat_use_alt == 1 && $compat_same_alt == 0 } { + compat-use-alt-compiler +- set compat_have_dfp [check_effective_target_dfprt_nocache] ++ set compat_have_dfp 0 + compat-use-tst-compiler + verbose "compat_have_dfp for alt compiler: $compat_have_dfp" 2 + } diff --git a/SOURCES/gcc5-hack.patch b/SOURCES/gcc5-hack.patch new file mode 100644 index 0000000..950ff63 --- /dev/null +++ b/SOURCES/gcc5-hack.patch @@ -0,0 +1,159 @@ +--- libada/Makefile.in.jj 2009-01-14 12:07:35.000000000 +0100 ++++ libada/Makefile.in 2009-01-15 14:25:33.000000000 +0100 +@@ -66,18 +66,40 @@ libsubdir := $(libdir)/gcc/$(target_nonc + ADA_RTS_DIR=$(GCC_DIR)/ada/rts$(subst /,_,$(MULTISUBDIR)) + ADA_RTS_SUBDIR=./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=$(LDFLAGS) $(DEFAULTMULTIFLAGS)" \ + "LN_S=$(LN_S)" \ + "SHELL=$(SHELL)" \ +- "GNATLIBFLAGS=$(GNATLIBFLAGS) $(MULTIFLAGS)" \ +- "GNATLIBCFLAGS=$(GNATLIBCFLAGS) $(MULTIFLAGS)" \ +- "GNATLIBCFLAGS_FOR_C=$(GNATLIBCFLAGS_FOR_C) $(MULTIFLAGS)" \ ++ "GNATLIBFLAGS=$(GNATLIBFLAGS) $(MULTIFLAGS) $(DEFAULTMULTIFLAGS)" \ ++ "GNATLIBCFLAGS=$(GNATLIBCFLAGS) $(MULTIFLAGS) $(DEFAULTMULTIFLAGS)" \ ++ "GNATLIBCFLAGS_FOR_C=$(GNATLIBCFLAGS_FOR_C) $(MULTIFLAGS) $(DEFAULTMULTIFLAGS)" \ + "PICFLAG_FOR_TARGET=$(PICFLAG)" \ + "THREAD_KIND=$(THREAD_KIND)" \ + "TRACE=$(TRACE)" \ +@@ -88,7 +110,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)" ++ "CFLAGS=$(CFLAGS) $(DEFAULTMULTIFLAGS)" + + # Rules to build gnatlib. + .PHONY: gnatlib gnatlib-plain gnatlib-sjlj gnatlib-zcx gnatlib-shared osconstool +--- gcc/ada/sem_util.adb (revision 161677) ++++ gcc/ada/sem_util.adb (working copy) +@@ -5487,7 +5487,7 @@ package body Sem_Util is + Exp : Node_Id; + Assn : Node_Id; + Choice : Node_Id; +- Comp_Type : Entity_Id; ++ Comp_Type : Entity_Id := Empty; + Is_Array_Aggr : Boolean; + + begin +--- config-ml.in.jj 2010-06-30 09:50:44.000000000 +0200 ++++ config-ml.in 2010-07-02 21:24:17.994211151 +0200 +@@ -516,6 +516,8 @@ multi-do: + ADAFLAGS="$(ADAFLAGS) $${flags}" \ + prefix="$(prefix)" \ + exec_prefix="$(exec_prefix)" \ ++ mandir="$(mandir)" \ ++ infodir="$(infodir)" \ + GCJFLAGS="$(GCJFLAGS) $${flags}" \ + GOCFLAGS="$(GOCFLAGS) $${flags}" \ + CXXFLAGS="$(CXXFLAGS) $${flags}" \ +--- libjava/Makefile.am.jj 2010-07-09 11:17:33.729604090 +0200 ++++ libjava/Makefile.am 2010-07-09 13:16:41.894375641 +0200 +@@ -710,7 +710,8 @@ if USE_LIBGCJ_BC + ## later. + @echo Installing dummy lib libgcj_bc.so.1.0.0; \ + rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so; \ +- mv $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1.0.0 $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so; \ ++ $(INSTALL) $(INSTALL_STRIP_FLAG) $(here)/.libs/libgcj_bc.so $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so; \ ++ rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1.0.0; \ + $(libgcj_bc_dummy_LINK) -xc /dev/null -Wl,-soname,libgcj_bc.so.1 \ + -o $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1.0.0 -lgcj || exit; \ + rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1; \ +--- libjava/Makefile.in.jj 2010-07-09 11:17:34.000000000 +0200 ++++ libjava/Makefile.in 2010-07-09 13:18:07.542572270 +0200 +@@ -12665,7 +12665,8 @@ install-exec-hook: install-binPROGRAMS i + install-libexecsubPROGRAMS + @USE_LIBGCJ_BC_TRUE@ @echo Installing dummy lib libgcj_bc.so.1.0.0; \ + @USE_LIBGCJ_BC_TRUE@ rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so; \ +-@USE_LIBGCJ_BC_TRUE@ mv $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1.0.0 $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so; \ ++@USE_LIBGCJ_BC_TRUE@ $(INSTALL) $(INSTALL_STRIP_FLAG) $(here)/.libs/libgcj_bc.so $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so; \ ++@USE_LIBGCJ_BC_TRUE@ rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1.0.0; \ + @USE_LIBGCJ_BC_TRUE@ $(libgcj_bc_dummy_LINK) -xc /dev/null -Wl,-soname,libgcj_bc.so.1 \ + @USE_LIBGCJ_BC_TRUE@ -o $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1.0.0 -lgcj || exit; \ + @USE_LIBGCJ_BC_TRUE@ rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1; \ +--- libcpp/macro.c.jj 2015-01-14 11:01:34.000000000 +0100 ++++ libcpp/macro.c 2015-01-14 14:22:19.286949884 +0100 +@@ -2947,8 +2947,6 @@ create_iso_definition (cpp_reader *pfile + cpp_token *token; + const cpp_token *ctoken; + bool following_paste_op = false; +- const char *paste_op_error_msg = +- N_("'##' cannot appear at either end of a macro expansion"); + unsigned int num_extra_tokens = 0; + + /* Get the first token of the expansion (or the '(' of a +@@ -3059,7 +3057,8 @@ create_iso_definition (cpp_reader *pfile + function-like macros, but not at the end. */ + if (following_paste_op) + { +- cpp_error (pfile, CPP_DL_ERROR, paste_op_error_msg); ++ cpp_error (pfile, CPP_DL_ERROR, ++ "'##' cannot appear at either end of a macro expansion"); + return false; + } + break; +@@ -3072,7 +3071,8 @@ create_iso_definition (cpp_reader *pfile + function-like macros, but not at the beginning. */ + if (macro->count == 1) + { +- cpp_error (pfile, CPP_DL_ERROR, paste_op_error_msg); ++ cpp_error (pfile, CPP_DL_ERROR, ++ "'##' cannot appear at either end of a macro expansion"); + return false; + } + +--- libcpp/expr.c.jj 2015-01-14 11:01:34.000000000 +0100 ++++ libcpp/expr.c 2015-01-14 14:35:52.851002344 +0100 +@@ -672,16 +672,17 @@ cpp_classify_number (cpp_reader *pfile, + if ((result & CPP_N_WIDTH) == CPP_N_LARGE + && CPP_OPTION (pfile, cpp_warn_long_long)) + { +- const char *message = CPP_OPTION (pfile, cplusplus) +- ? N_("use of C++11 long long integer constant") +- : N_("use of C99 long long integer constant"); +- + if (CPP_OPTION (pfile, c99)) + cpp_warning_with_line (pfile, CPP_W_LONG_LONG, virtual_location, +- 0, message); ++ 0, CPP_OPTION (pfile, cplusplus) ++ ? N_("use of C++11 long long integer constant") ++ : N_("use of C99 long long integer constant")); + else + cpp_pedwarning_with_line (pfile, CPP_W_LONG_LONG, +- virtual_location, 0, message); ++ virtual_location, 0, ++ CPP_OPTION (pfile, cplusplus) ++ ? N_("use of C++11 long long integer constant") ++ : N_("use of C99 long long integer constant")); + } + + result |= CPP_N_INTEGER; diff --git a/SOURCES/gcc5-htm-in-asm.patch b/SOURCES/gcc5-htm-in-asm.patch new file mode 100644 index 0000000..a7f1b7b --- /dev/null +++ b/SOURCES/gcc5-htm-in-asm.patch @@ -0,0 +1,55 @@ +--- libitm/config/x86/target.h.jj 2013-06-23 20:43:50.000000000 +0200 ++++ libitm/config/x86/target.h 2013-08-13 17:14:57.540012109 +0200 +@@ -64,7 +64,7 @@ cpu_relax (void) + + // Use Intel RTM if supported by the assembler. + // See gtm_thread::begin_transaction for how these functions are used. +-#ifdef HAVE_AS_RTM ++#if 1 /* def HAVE_AS_RTM */ + #define USE_HTM_FASTPATH + #ifdef __x86_64__ + // Use the custom fastpath in ITM_beginTransaction. +@@ -97,7 +97,10 @@ htm_init () + static inline uint32_t + htm_begin () + { +- return _xbegin(); ++// return _xbegin(); ++ uint32_t ret; ++ __asm volatile ("movl $-1, %%eax; .byte 0xc7, 0xf8, 0, 0, 0, 0" : "=a" (ret) : : "memory"); ++ return ret; + } + + static inline bool +@@ -109,7 +112,8 @@ htm_begin_success (uint32_t begin_ret) + static inline void + htm_commit () + { +- _xend(); ++// _xend(); ++ __asm volatile (".byte 0x0f, 0x01, 0xd5" : : : "memory"); + } + + static inline void +@@ -117,7 +121,8 @@ htm_abort () + { + // ??? According to a yet unpublished ABI rule, 0xff is reserved and + // supposed to signal a busy lock. Source: andi.kleen@intel.com +- _xabort(0xff); ++// _xabort(0xff); ++ __asm volatile (".byte 0xc6, 0xf8, 0xff" : : : "memory"); + } + + static inline bool +@@ -130,7 +135,10 @@ htm_abort_should_retry (uint32_t begin_r + static inline bool + htm_transaction_active () + { +- return _xtest() != 0; ++// return _xtest() != 0; ++ bool ret; ++ __asm volatile (".byte 0x0f, 0x01, 0xd6; setne %%al" : "=a" (ret) : : "memory"); ++ return ret; + } + #endif + diff --git a/SOURCES/gcc5-i386-libgomp.patch b/SOURCES/gcc5-i386-libgomp.patch new file mode 100644 index 0000000..520561e --- /dev/null +++ b/SOURCES/gcc5-i386-libgomp.patch @@ -0,0 +1,11 @@ +--- libgomp/configure.tgt.jj 2008-01-10 20:53:48.000000000 +0100 ++++ libgomp/configure.tgt 2008-03-27 12:44:51.000000000 +0100 +@@ -67,7 +67,7 @@ if test $enable_linux_futex = yes; then + ;; + *) + if test -z "$with_arch"; then +- XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}" ++ XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic" + fi + esac + ;; diff --git a/SOURCES/gcc5-java-nomulti.patch b/SOURCES/gcc5-java-nomulti.patch new file mode 100644 index 0000000..17334aa --- /dev/null +++ b/SOURCES/gcc5-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/gcc5-libgo-p224.patch b/SOURCES/gcc5-libgo-p224.patch new file mode 100644 index 0000000..43509b1 --- /dev/null +++ b/SOURCES/gcc5-libgo-p224.patch @@ -0,0 +1,1093 @@ +--- libgo/Makefile.am.jj 2014-01-08 13:53:06.000000000 +0100 ++++ libgo/Makefile.am 2014-03-05 15:20:09.938466093 +0100 +@@ -1133,7 +1133,6 @@ go_crypto_ecdsa_files = \ + go/crypto/ecdsa/ecdsa.go + go_crypto_elliptic_files = \ + go/crypto/elliptic/elliptic.go \ +- go/crypto/elliptic/p224.go \ + go/crypto/elliptic/p256.go + go_crypto_hmac_files = \ + go/crypto/hmac/hmac.go +--- libgo/Makefile.in.jj 2014-01-08 13:53:06.000000000 +0100 ++++ libgo/Makefile.in 2014-03-05 15:20:20.372465471 +0100 +@@ -1291,7 +1291,6 @@ go_crypto_ecdsa_files = \ + + go_crypto_elliptic_files = \ + go/crypto/elliptic/elliptic.go \ +- go/crypto/elliptic/p224.go \ + go/crypto/elliptic/p256.go + + go_crypto_hmac_files = \ +--- libgo/go/crypto/elliptic/elliptic.go.jj 2013-11-07 11:59:09.000000000 +0100 ++++ libgo/go/crypto/elliptic/elliptic.go 2014-03-05 15:21:04.186462859 +0100 +@@ -326,7 +326,6 @@ var p384 *CurveParams + var p521 *CurveParams + + func initAll() { +- initP224() + initP256() + initP384() + initP521() +--- libgo/go/crypto/elliptic/elliptic_test.go.jj 2013-11-07 11:59:09.000000000 +0100 ++++ libgo/go/crypto/elliptic/elliptic_test.go 2014-03-05 15:46:03.739373453 +0100 +@@ -5,26 +5,16 @@ + package elliptic + + import ( +- "crypto/rand" +- "encoding/hex" +- "fmt" + "math/big" + "testing" + ) + +-func TestOnCurve(t *testing.T) { +- p224 := P224() +- if !p224.IsOnCurve(p224.Params().Gx, p224.Params().Gy) { +- t.Errorf("FAIL") +- } +-} +- + type baseMultTest struct { + k string + x, y string + } + +-var p224BaseMultTests = []baseMultTest{ ++var p256BaseMultTests = []baseMultTest{ + { + "1", + "b70e0cbd6bb4bf7f321390b94a03c1d356c21122343280d6115c1d21", +@@ -287,47 +277,12 @@ var p224BaseMultTests = []baseMultTest{ + }, + } + +-func TestBaseMult(t *testing.T) { +- p224 := P224() +- for i, e := range p224BaseMultTests { +- k, ok := new(big.Int).SetString(e.k, 10) +- if !ok { +- t.Errorf("%d: bad value for k: %s", i, e.k) +- } +- x, y := p224.ScalarBaseMult(k.Bytes()) +- if fmt.Sprintf("%x", x) != e.x || fmt.Sprintf("%x", y) != e.y { +- t.Errorf("%d: bad output for k=%s: got (%x, %x), want (%s, %s)", i, e.k, x, y, e.x, e.y) +- } +- if testing.Short() && i > 5 { +- break +- } +- } +-} +- +-func TestGenericBaseMult(t *testing.T) { +- // We use the P224 CurveParams directly in order to test the generic implementation. +- p224 := P224().Params() +- for i, e := range p224BaseMultTests { +- k, ok := new(big.Int).SetString(e.k, 10) +- if !ok { +- t.Errorf("%d: bad value for k: %s", i, e.k) +- } +- x, y := p224.ScalarBaseMult(k.Bytes()) +- if fmt.Sprintf("%x", x) != e.x || fmt.Sprintf("%x", y) != e.y { +- t.Errorf("%d: bad output for k=%s: got (%x, %x), want (%s, %s)", i, e.k, x, y, e.x, e.y) +- } +- if testing.Short() && i > 5 { +- break +- } +- } +-} +- + func TestP256BaseMult(t *testing.T) { + p256 := P256() + p256Generic := p256.Params() + +- scalars := make([]*big.Int, 0, len(p224BaseMultTests)+1) +- for _, e := range p224BaseMultTests { ++ scalars := make([]*big.Int, 0, len(p256BaseMultTests)+1) ++ for _, e := range p256BaseMultTests { + k, _ := new(big.Int).SetString(e.k, 10) + scalars = append(scalars, k) + } +@@ -352,7 +307,7 @@ func TestP256Mult(t *testing.T) { + p256 := P256() + p256Generic := p256.Params() + +- for i, e := range p224BaseMultTests { ++ for i, e := range p256BaseMultTests { + x, _ := new(big.Int).SetString(e.x, 16) + y, _ := new(big.Int).SetString(e.y, 16) + k, _ := new(big.Int).SetString(e.k, 10) +@@ -373,7 +328,6 @@ func TestInfinity(t *testing.T) { + name string + curve Curve + }{ +- {"p224", P224()}, + {"p256", P256()}, + } + +@@ -406,53 +360,13 @@ func TestInfinity(t *testing.T) { + } + } + +-func BenchmarkBaseMult(b *testing.B) { +- b.ResetTimer() +- p224 := P224() +- e := p224BaseMultTests[25] +- k, _ := new(big.Int).SetString(e.k, 10) +- b.StartTimer() +- for i := 0; i < b.N; i++ { +- p224.ScalarBaseMult(k.Bytes()) +- } +-} +- + func BenchmarkBaseMultP256(b *testing.B) { + b.ResetTimer() + p256 := P256() +- e := p224BaseMultTests[25] ++ e := p256BaseMultTests[25] + k, _ := new(big.Int).SetString(e.k, 10) + b.StartTimer() + for i := 0; i < b.N; i++ { + p256.ScalarBaseMult(k.Bytes()) + } + } +- +-func TestMarshal(t *testing.T) { +- p224 := P224() +- _, x, y, err := GenerateKey(p224, rand.Reader) +- if err != nil { +- t.Error(err) +- return +- } +- serialized := Marshal(p224, x, y) +- xx, yy := Unmarshal(p224, serialized) +- if xx == nil { +- t.Error("failed to unmarshal") +- return +- } +- if xx.Cmp(x) != 0 || yy.Cmp(y) != 0 { +- t.Error("unmarshal returned different values") +- return +- } +-} +- +-func TestP224Overflow(t *testing.T) { +- // This tests for a specific bug in the P224 implementation. +- p224 := P224() +- pointData, _ := hex.DecodeString("049B535B45FB0A2072398A6831834624C7E32CCFD5A4B933BCEAF77F1DD945E08BBE5178F5EDF5E733388F196D2A631D2E075BB16CBFEEA15B") +- x, y := Unmarshal(p224, pointData) +- if !p224.IsOnCurve(x, y) { +- t.Error("P224 failed to validate a correct point") +- } +-} +--- libgo/go/crypto/ecdsa/ecdsa_test.go.jj 2012-11-15 18:26:56.000000000 +0100 ++++ libgo/go/crypto/ecdsa/ecdsa_test.go 2014-03-05 15:26:38.461442929 +0100 +@@ -33,7 +33,6 @@ func testKeyGeneration(t *testing.T, c e + } + + func TestKeyGeneration(t *testing.T) { +- testKeyGeneration(t, elliptic.P224(), "p224") + if testing.Short() { + return + } +@@ -63,7 +62,6 @@ func testSignAndVerify(t *testing.T, c e + } + + func TestSignAndVerify(t *testing.T) { +- testSignAndVerify(t, elliptic.P224(), "p224") + if testing.Short() { + return + } +@@ -129,8 +127,6 @@ func TestVectors(t *testing.T) { + parts := strings.SplitN(line, ",", 2) + + switch parts[0] { +- case "P-224": +- pub.Curve = elliptic.P224() + case "P-256": + pub.Curve = elliptic.P256() + case "P-384": +--- libgo/go/crypto/x509/x509.go.jj 2013-11-07 11:59:09.000000000 +0100 ++++ libgo/go/crypto/x509/x509.go 2014-03-05 15:27:37.022439437 +0100 +@@ -306,9 +306,6 @@ func getPublicKeyAlgorithmFromOID(oid as + + // RFC 5480, 2.1.1.1. Named Curve + // +-// secp224r1 OBJECT IDENTIFIER ::= { +-// iso(1) identified-organization(3) certicom(132) curve(0) 33 } +-// + // secp256r1 OBJECT IDENTIFIER ::= { + // iso(1) member-body(2) us(840) ansi-X9-62(10045) curves(3) + // prime(1) 7 } +@@ -321,7 +318,6 @@ func getPublicKeyAlgorithmFromOID(oid as + // + // NB: secp256r1 is equivalent to prime256v1 + var ( +- oidNamedCurveP224 = asn1.ObjectIdentifier{1, 3, 132, 0, 33} + oidNamedCurveP256 = asn1.ObjectIdentifier{1, 2, 840, 10045, 3, 1, 7} + oidNamedCurveP384 = asn1.ObjectIdentifier{1, 3, 132, 0, 34} + oidNamedCurveP521 = asn1.ObjectIdentifier{1, 3, 132, 0, 35} +@@ -329,8 +325,6 @@ var ( + + func namedCurveFromOID(oid asn1.ObjectIdentifier) elliptic.Curve { + switch { +- case oid.Equal(oidNamedCurveP224): +- return elliptic.P224() + case oid.Equal(oidNamedCurveP256): + return elliptic.P256() + case oid.Equal(oidNamedCurveP384): +@@ -343,8 +337,6 @@ func namedCurveFromOID(oid asn1.ObjectId + + func oidFromNamedCurve(curve elliptic.Curve) (asn1.ObjectIdentifier, bool) { + switch curve { +- case elliptic.P224(): +- return oidNamedCurveP224, true + case elliptic.P256(): + return oidNamedCurveP256, true + case elliptic.P384(): +@@ -1371,7 +1363,7 @@ func signingParamsForPrivateKey(priv int + pubType = ECDSA + + switch priv.Curve { +- case elliptic.P224(), elliptic.P256(): ++ case elliptic.P256(): + hashFunc = crypto.SHA256 + sigAlgo.Algorithm = oidSignatureECDSAWithSHA256 + case elliptic.P384(): +--- libgo/go/crypto/elliptic/p224.go.jj 2012-11-15 18:26:57.000000000 +0100 ++++ libgo/go/crypto/elliptic/p224.go 2014-03-05 15:30:01.189430842 +0100 +@@ -1,765 +0,0 @@ +-// Copyright 2012 The Go Authors. All rights reserved. +-// Use of this source code is governed by a BSD-style +-// license that can be found in the LICENSE file. +- +-package elliptic +- +-// This is a constant-time, 32-bit implementation of P224. See FIPS 186-3, +-// section D.2.2. +-// +-// See http://www.imperialviolet.org/2010/12/04/ecc.html ([1]) for background. +- +-import ( +- "math/big" +-) +- +-var p224 p224Curve +- +-type p224Curve struct { +- *CurveParams +- gx, gy, b p224FieldElement +-} +- +-func initP224() { +- // See FIPS 186-3, section D.2.2 +- p224.CurveParams = new(CurveParams) +- p224.P, _ = new(big.Int).SetString("26959946667150639794667015087019630673557916260026308143510066298881", 10) +- p224.N, _ = new(big.Int).SetString("26959946667150639794667015087019625940457807714424391721682722368061", 10) +- p224.B, _ = new(big.Int).SetString("b4050a850c04b3abf54132565044b0b7d7bfd8ba270b39432355ffb4", 16) +- p224.Gx, _ = new(big.Int).SetString("b70e0cbd6bb4bf7f321390b94a03c1d356c21122343280d6115c1d21", 16) +- p224.Gy, _ = new(big.Int).SetString("bd376388b5f723fb4c22dfe6cd4375a05a07476444d5819985007e34", 16) +- p224.BitSize = 224 +- +- p224FromBig(&p224.gx, p224.Gx) +- p224FromBig(&p224.gy, p224.Gy) +- p224FromBig(&p224.b, p224.B) +-} +- +-// P224 returns a Curve which implements P-224 (see FIPS 186-3, section D.2.2) +-func P224() Curve { +- initonce.Do(initAll) +- return p224 +-} +- +-func (curve p224Curve) Params() *CurveParams { +- return curve.CurveParams +-} +- +-func (curve p224Curve) IsOnCurve(bigX, bigY *big.Int) bool { +- var x, y p224FieldElement +- p224FromBig(&x, bigX) +- p224FromBig(&y, bigY) +- +- // y² = x³ - 3x + b +- var tmp p224LargeFieldElement +- var x3 p224FieldElement +- p224Square(&x3, &x, &tmp) +- p224Mul(&x3, &x3, &x, &tmp) +- +- for i := 0; i < 8; i++ { +- x[i] *= 3 +- } +- p224Sub(&x3, &x3, &x) +- p224Reduce(&x3) +- p224Add(&x3, &x3, &curve.b) +- p224Contract(&x3, &x3) +- +- p224Square(&y, &y, &tmp) +- p224Contract(&y, &y) +- +- for i := 0; i < 8; i++ { +- if y[i] != x3[i] { +- return false +- } +- } +- return true +-} +- +-func (p224Curve) Add(bigX1, bigY1, bigX2, bigY2 *big.Int) (x, y *big.Int) { +- var x1, y1, z1, x2, y2, z2, x3, y3, z3 p224FieldElement +- +- p224FromBig(&x1, bigX1) +- p224FromBig(&y1, bigY1) +- if bigX1.Sign() != 0 || bigY1.Sign() != 0 { +- z1[0] = 1 +- } +- p224FromBig(&x2, bigX2) +- p224FromBig(&y2, bigY2) +- if bigX2.Sign() != 0 || bigY2.Sign() != 0 { +- z2[0] = 1 +- } +- +- p224AddJacobian(&x3, &y3, &z3, &x1, &y1, &z1, &x2, &y2, &z2) +- return p224ToAffine(&x3, &y3, &z3) +-} +- +-func (p224Curve) Double(bigX1, bigY1 *big.Int) (x, y *big.Int) { +- var x1, y1, z1, x2, y2, z2 p224FieldElement +- +- p224FromBig(&x1, bigX1) +- p224FromBig(&y1, bigY1) +- z1[0] = 1 +- +- p224DoubleJacobian(&x2, &y2, &z2, &x1, &y1, &z1) +- return p224ToAffine(&x2, &y2, &z2) +-} +- +-func (p224Curve) ScalarMult(bigX1, bigY1 *big.Int, scalar []byte) (x, y *big.Int) { +- var x1, y1, z1, x2, y2, z2 p224FieldElement +- +- p224FromBig(&x1, bigX1) +- p224FromBig(&y1, bigY1) +- z1[0] = 1 +- +- p224ScalarMult(&x2, &y2, &z2, &x1, &y1, &z1, scalar) +- return p224ToAffine(&x2, &y2, &z2) +-} +- +-func (curve p224Curve) ScalarBaseMult(scalar []byte) (x, y *big.Int) { +- var z1, x2, y2, z2 p224FieldElement +- +- z1[0] = 1 +- p224ScalarMult(&x2, &y2, &z2, &curve.gx, &curve.gy, &z1, scalar) +- return p224ToAffine(&x2, &y2, &z2) +-} +- +-// Field element functions. +-// +-// The field that we're dealing with is ℤ/pℤ where p = 2**224 - 2**96 + 1. +-// +-// Field elements are represented by a FieldElement, which is a typedef to an +-// array of 8 uint32's. The value of a FieldElement, a, is: +-// a[0] + 2**28·a[1] + 2**56·a[1] + ... + 2**196·a[7] +-// +-// Using 28-bit limbs means that there's only 4 bits of headroom, which is less +-// than we would really like. But it has the useful feature that we hit 2**224 +-// exactly, making the reflections during a reduce much nicer. +-type p224FieldElement [8]uint32 +- +-// p224P is the order of the field, represented as a p224FieldElement. +-var p224P = [8]uint32{1, 0, 0, 0xffff000, 0xfffffff, 0xfffffff, 0xfffffff, 0xfffffff} +- +-// p224IsZero returns 1 if a == 0 mod p and 0 otherwise. +-// +-// a[i] < 2**29 +-func p224IsZero(a *p224FieldElement) uint32 { +- // Since a p224FieldElement contains 224 bits there are two possible +- // representations of 0: 0 and p. +- var minimal p224FieldElement +- p224Contract(&minimal, a) +- +- var isZero, isP uint32 +- for i, v := range minimal { +- isZero |= v +- isP |= v - p224P[i] +- } +- +- // If either isZero or isP is 0, then we should return 1. +- isZero |= isZero >> 16 +- isZero |= isZero >> 8 +- isZero |= isZero >> 4 +- isZero |= isZero >> 2 +- isZero |= isZero >> 1 +- +- isP |= isP >> 16 +- isP |= isP >> 8 +- isP |= isP >> 4 +- isP |= isP >> 2 +- isP |= isP >> 1 +- +- // For isZero and isP, the LSB is 0 iff all the bits are zero. +- result := isZero & isP +- result = (^result) & 1 +- +- return result +-} +- +-// p224Add computes *out = a+b +-// +-// a[i] + b[i] < 2**32 +-func p224Add(out, a, b *p224FieldElement) { +- for i := 0; i < 8; i++ { +- out[i] = a[i] + b[i] +- } +-} +- +-const two31p3 = 1<<31 + 1<<3 +-const two31m3 = 1<<31 - 1<<3 +-const two31m15m3 = 1<<31 - 1<<15 - 1<<3 +- +-// p224ZeroModP31 is 0 mod p where bit 31 is set in all limbs so that we can +-// subtract smaller amounts without underflow. See the section "Subtraction" in +-// [1] for reasoning. +-var p224ZeroModP31 = []uint32{two31p3, two31m3, two31m3, two31m15m3, two31m3, two31m3, two31m3, two31m3} +- +-// p224Sub computes *out = a-b +-// +-// a[i], b[i] < 2**30 +-// out[i] < 2**32 +-func p224Sub(out, a, b *p224FieldElement) { +- for i := 0; i < 8; i++ { +- out[i] = a[i] + p224ZeroModP31[i] - b[i] +- } +-} +- +-// LargeFieldElement also represents an element of the field. The limbs are +-// still spaced 28-bits apart and in little-endian order. So the limbs are at +-// 0, 28, 56, ..., 392 bits, each 64-bits wide. +-type p224LargeFieldElement [15]uint64 +- +-const two63p35 = 1<<63 + 1<<35 +-const two63m35 = 1<<63 - 1<<35 +-const two63m35m19 = 1<<63 - 1<<35 - 1<<19 +- +-// p224ZeroModP63 is 0 mod p where bit 63 is set in all limbs. See the section +-// "Subtraction" in [1] for why. +-var p224ZeroModP63 = [8]uint64{two63p35, two63m35, two63m35, two63m35, two63m35m19, two63m35, two63m35, two63m35} +- +-const bottom12Bits = 0xfff +-const bottom28Bits = 0xfffffff +- +-// p224Mul computes *out = a*b +-// +-// a[i] < 2**29, b[i] < 2**30 (or vice versa) +-// out[i] < 2**29 +-func p224Mul(out, a, b *p224FieldElement, tmp *p224LargeFieldElement) { +- for i := 0; i < 15; i++ { +- tmp[i] = 0 +- } +- +- for i := 0; i < 8; i++ { +- for j := 0; j < 8; j++ { +- tmp[i+j] += uint64(a[i]) * uint64(b[j]) +- } +- } +- +- p224ReduceLarge(out, tmp) +-} +- +-// Square computes *out = a*a +-// +-// a[i] < 2**29 +-// out[i] < 2**29 +-func p224Square(out, a *p224FieldElement, tmp *p224LargeFieldElement) { +- for i := 0; i < 15; i++ { +- tmp[i] = 0 +- } +- +- for i := 0; i < 8; i++ { +- for j := 0; j <= i; j++ { +- r := uint64(a[i]) * uint64(a[j]) +- if i == j { +- tmp[i+j] += r +- } else { +- tmp[i+j] += r << 1 +- } +- } +- } +- +- p224ReduceLarge(out, tmp) +-} +- +-// ReduceLarge converts a p224LargeFieldElement to a p224FieldElement. +-// +-// in[i] < 2**62 +-func p224ReduceLarge(out *p224FieldElement, in *p224LargeFieldElement) { +- for i := 0; i < 8; i++ { +- in[i] += p224ZeroModP63[i] +- } +- +- // Eliminate the coefficients at 2**224 and greater. +- for i := 14; i >= 8; i-- { +- in[i-8] -= in[i] +- in[i-5] += (in[i] & 0xffff) << 12 +- in[i-4] += in[i] >> 16 +- } +- in[8] = 0 +- // in[0..8] < 2**64 +- +- // As the values become small enough, we start to store them in |out| +- // and use 32-bit operations. +- for i := 1; i < 8; i++ { +- in[i+1] += in[i] >> 28 +- out[i] = uint32(in[i] & bottom28Bits) +- } +- in[0] -= in[8] +- out[3] += uint32(in[8]&0xffff) << 12 +- out[4] += uint32(in[8] >> 16) +- // in[0] < 2**64 +- // out[3] < 2**29 +- // out[4] < 2**29 +- // out[1,2,5..7] < 2**28 +- +- out[0] = uint32(in[0] & bottom28Bits) +- out[1] += uint32((in[0] >> 28) & bottom28Bits) +- out[2] += uint32(in[0] >> 56) +- // out[0] < 2**28 +- // out[1..4] < 2**29 +- // out[5..7] < 2**28 +-} +- +-// Reduce reduces the coefficients of a to smaller bounds. +-// +-// On entry: a[i] < 2**31 + 2**30 +-// On exit: a[i] < 2**29 +-func p224Reduce(a *p224FieldElement) { +- for i := 0; i < 7; i++ { +- a[i+1] += a[i] >> 28 +- a[i] &= bottom28Bits +- } +- top := a[7] >> 28 +- a[7] &= bottom28Bits +- +- // top < 2**4 +- mask := top +- mask |= mask >> 2 +- mask |= mask >> 1 +- mask <<= 31 +- mask = uint32(int32(mask) >> 31) +- // Mask is all ones if top != 0, all zero otherwise +- +- a[0] -= top +- a[3] += top << 12 +- +- // We may have just made a[0] negative but, if we did, then we must +- // have added something to a[3], this it's > 2**12. Therefore we can +- // carry down to a[0]. +- a[3] -= 1 & mask +- a[2] += mask & (1<<28 - 1) +- a[1] += mask & (1<<28 - 1) +- a[0] += mask & (1 << 28) +-} +- +-// p224Invert calculates *out = in**-1 by computing in**(2**224 - 2**96 - 1), +-// i.e. Fermat's little theorem. +-func p224Invert(out, in *p224FieldElement) { +- var f1, f2, f3, f4 p224FieldElement +- var c p224LargeFieldElement +- +- p224Square(&f1, in, &c) // 2 +- p224Mul(&f1, &f1, in, &c) // 2**2 - 1 +- p224Square(&f1, &f1, &c) // 2**3 - 2 +- p224Mul(&f1, &f1, in, &c) // 2**3 - 1 +- p224Square(&f2, &f1, &c) // 2**4 - 2 +- p224Square(&f2, &f2, &c) // 2**5 - 4 +- p224Square(&f2, &f2, &c) // 2**6 - 8 +- p224Mul(&f1, &f1, &f2, &c) // 2**6 - 1 +- p224Square(&f2, &f1, &c) // 2**7 - 2 +- for i := 0; i < 5; i++ { // 2**12 - 2**6 +- p224Square(&f2, &f2, &c) +- } +- p224Mul(&f2, &f2, &f1, &c) // 2**12 - 1 +- p224Square(&f3, &f2, &c) // 2**13 - 2 +- for i := 0; i < 11; i++ { // 2**24 - 2**12 +- p224Square(&f3, &f3, &c) +- } +- p224Mul(&f2, &f3, &f2, &c) // 2**24 - 1 +- p224Square(&f3, &f2, &c) // 2**25 - 2 +- for i := 0; i < 23; i++ { // 2**48 - 2**24 +- p224Square(&f3, &f3, &c) +- } +- p224Mul(&f3, &f3, &f2, &c) // 2**48 - 1 +- p224Square(&f4, &f3, &c) // 2**49 - 2 +- for i := 0; i < 47; i++ { // 2**96 - 2**48 +- p224Square(&f4, &f4, &c) +- } +- p224Mul(&f3, &f3, &f4, &c) // 2**96 - 1 +- p224Square(&f4, &f3, &c) // 2**97 - 2 +- for i := 0; i < 23; i++ { // 2**120 - 2**24 +- p224Square(&f4, &f4, &c) +- } +- p224Mul(&f2, &f4, &f2, &c) // 2**120 - 1 +- for i := 0; i < 6; i++ { // 2**126 - 2**6 +- p224Square(&f2, &f2, &c) +- } +- p224Mul(&f1, &f1, &f2, &c) // 2**126 - 1 +- p224Square(&f1, &f1, &c) // 2**127 - 2 +- p224Mul(&f1, &f1, in, &c) // 2**127 - 1 +- for i := 0; i < 97; i++ { // 2**224 - 2**97 +- p224Square(&f1, &f1, &c) +- } +- p224Mul(out, &f1, &f3, &c) // 2**224 - 2**96 - 1 +-} +- +-// p224Contract converts a FieldElement to its unique, minimal form. +-// +-// On entry, in[i] < 2**29 +-// On exit, in[i] < 2**28 +-func p224Contract(out, in *p224FieldElement) { +- copy(out[:], in[:]) +- +- for i := 0; i < 7; i++ { +- out[i+1] += out[i] >> 28 +- out[i] &= bottom28Bits +- } +- top := out[7] >> 28 +- out[7] &= bottom28Bits +- +- out[0] -= top +- out[3] += top << 12 +- +- // We may just have made out[i] negative. So we carry down. If we made +- // out[0] negative then we know that out[3] is sufficiently positive +- // because we just added to it. +- for i := 0; i < 3; i++ { +- mask := uint32(int32(out[i]) >> 31) +- out[i] += (1 << 28) & mask +- out[i+1] -= 1 & mask +- } +- +- // We might have pushed out[3] over 2**28 so we perform another, partial, +- // carry chain. +- for i := 3; i < 7; i++ { +- out[i+1] += out[i] >> 28 +- out[i] &= bottom28Bits +- } +- top = out[7] >> 28 +- out[7] &= bottom28Bits +- +- // Eliminate top while maintaining the same value mod p. +- out[0] -= top +- out[3] += top << 12 +- +- // There are two cases to consider for out[3]: +- // 1) The first time that we eliminated top, we didn't push out[3] over +- // 2**28. In this case, the partial carry chain didn't change any values +- // and top is zero. +- // 2) We did push out[3] over 2**28 the first time that we eliminated top. +- // The first value of top was in [0..16), therefore, prior to eliminating +- // the first top, 0xfff1000 <= out[3] <= 0xfffffff. Therefore, after +- // overflowing and being reduced by the second carry chain, out[3] <= +- // 0xf000. Thus it cannot have overflowed when we eliminated top for the +- // second time. +- +- // Again, we may just have made out[0] negative, so do the same carry down. +- // As before, if we made out[0] negative then we know that out[3] is +- // sufficiently positive. +- for i := 0; i < 3; i++ { +- mask := uint32(int32(out[i]) >> 31) +- out[i] += (1 << 28) & mask +- out[i+1] -= 1 & mask +- } +- +- // Now we see if the value is >= p and, if so, subtract p. +- +- // First we build a mask from the top four limbs, which must all be +- // equal to bottom28Bits if the whole value is >= p. If top4AllOnes +- // ends up with any zero bits in the bottom 28 bits, then this wasn't +- // true. +- top4AllOnes := uint32(0xffffffff) +- for i := 4; i < 8; i++ { +- top4AllOnes &= out[i] +- } +- top4AllOnes |= 0xf0000000 +- // Now we replicate any zero bits to all the bits in top4AllOnes. +- top4AllOnes &= top4AllOnes >> 16 +- top4AllOnes &= top4AllOnes >> 8 +- top4AllOnes &= top4AllOnes >> 4 +- top4AllOnes &= top4AllOnes >> 2 +- top4AllOnes &= top4AllOnes >> 1 +- top4AllOnes = uint32(int32(top4AllOnes<<31) >> 31) +- +- // Now we test whether the bottom three limbs are non-zero. +- bottom3NonZero := out[0] | out[1] | out[2] +- bottom3NonZero |= bottom3NonZero >> 16 +- bottom3NonZero |= bottom3NonZero >> 8 +- bottom3NonZero |= bottom3NonZero >> 4 +- bottom3NonZero |= bottom3NonZero >> 2 +- bottom3NonZero |= bottom3NonZero >> 1 +- bottom3NonZero = uint32(int32(bottom3NonZero<<31) >> 31) +- +- // Everything depends on the value of out[3]. +- // If it's > 0xffff000 and top4AllOnes != 0 then the whole value is >= p +- // If it's = 0xffff000 and top4AllOnes != 0 and bottom3NonZero != 0, +- // then the whole value is >= p +- // If it's < 0xffff000, then the whole value is < p +- n := out[3] - 0xffff000 +- out3Equal := n +- out3Equal |= out3Equal >> 16 +- out3Equal |= out3Equal >> 8 +- out3Equal |= out3Equal >> 4 +- out3Equal |= out3Equal >> 2 +- out3Equal |= out3Equal >> 1 +- out3Equal = ^uint32(int32(out3Equal<<31) >> 31) +- +- // If out[3] > 0xffff000 then n's MSB will be zero. +- out3GT := ^uint32(int32(n) >> 31) +- +- mask := top4AllOnes & ((out3Equal & bottom3NonZero) | out3GT) +- out[0] -= 1 & mask +- out[3] -= 0xffff000 & mask +- out[4] -= 0xfffffff & mask +- out[5] -= 0xfffffff & mask +- out[6] -= 0xfffffff & mask +- out[7] -= 0xfffffff & mask +-} +- +-// Group element functions. +-// +-// These functions deal with group elements. The group is an elliptic curve +-// group with a = -3 defined in FIPS 186-3, section D.2.2. +- +-// p224AddJacobian computes *out = a+b where a != b. +-func p224AddJacobian(x3, y3, z3, x1, y1, z1, x2, y2, z2 *p224FieldElement) { +- // See http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-p224Add-2007-bl +- var z1z1, z2z2, u1, u2, s1, s2, h, i, j, r, v p224FieldElement +- var c p224LargeFieldElement +- +- z1IsZero := p224IsZero(z1) +- z2IsZero := p224IsZero(z2) +- +- // Z1Z1 = Z1² +- p224Square(&z1z1, z1, &c) +- // Z2Z2 = Z2² +- p224Square(&z2z2, z2, &c) +- // U1 = X1*Z2Z2 +- p224Mul(&u1, x1, &z2z2, &c) +- // U2 = X2*Z1Z1 +- p224Mul(&u2, x2, &z1z1, &c) +- // S1 = Y1*Z2*Z2Z2 +- p224Mul(&s1, z2, &z2z2, &c) +- p224Mul(&s1, y1, &s1, &c) +- // S2 = Y2*Z1*Z1Z1 +- p224Mul(&s2, z1, &z1z1, &c) +- p224Mul(&s2, y2, &s2, &c) +- // H = U2-U1 +- p224Sub(&h, &u2, &u1) +- p224Reduce(&h) +- xEqual := p224IsZero(&h) +- // I = (2*H)² +- for j := 0; j < 8; j++ { +- i[j] = h[j] << 1 +- } +- p224Reduce(&i) +- p224Square(&i, &i, &c) +- // J = H*I +- p224Mul(&j, &h, &i, &c) +- // r = 2*(S2-S1) +- p224Sub(&r, &s2, &s1) +- p224Reduce(&r) +- yEqual := p224IsZero(&r) +- if xEqual == 1 && yEqual == 1 && z1IsZero == 0 && z2IsZero == 0 { +- p224DoubleJacobian(x3, y3, z3, x1, y1, z1) +- return +- } +- for i := 0; i < 8; i++ { +- r[i] <<= 1 +- } +- p224Reduce(&r) +- // V = U1*I +- p224Mul(&v, &u1, &i, &c) +- // Z3 = ((Z1+Z2)²-Z1Z1-Z2Z2)*H +- p224Add(&z1z1, &z1z1, &z2z2) +- p224Add(&z2z2, z1, z2) +- p224Reduce(&z2z2) +- p224Square(&z2z2, &z2z2, &c) +- p224Sub(z3, &z2z2, &z1z1) +- p224Reduce(z3) +- p224Mul(z3, z3, &h, &c) +- // X3 = r²-J-2*V +- for i := 0; i < 8; i++ { +- z1z1[i] = v[i] << 1 +- } +- p224Add(&z1z1, &j, &z1z1) +- p224Reduce(&z1z1) +- p224Square(x3, &r, &c) +- p224Sub(x3, x3, &z1z1) +- p224Reduce(x3) +- // Y3 = r*(V-X3)-2*S1*J +- for i := 0; i < 8; i++ { +- s1[i] <<= 1 +- } +- p224Mul(&s1, &s1, &j, &c) +- p224Sub(&z1z1, &v, x3) +- p224Reduce(&z1z1) +- p224Mul(&z1z1, &z1z1, &r, &c) +- p224Sub(y3, &z1z1, &s1) +- p224Reduce(y3) +- +- p224CopyConditional(x3, x2, z1IsZero) +- p224CopyConditional(x3, x1, z2IsZero) +- p224CopyConditional(y3, y2, z1IsZero) +- p224CopyConditional(y3, y1, z2IsZero) +- p224CopyConditional(z3, z2, z1IsZero) +- p224CopyConditional(z3, z1, z2IsZero) +-} +- +-// p224DoubleJacobian computes *out = a+a. +-func p224DoubleJacobian(x3, y3, z3, x1, y1, z1 *p224FieldElement) { +- var delta, gamma, beta, alpha, t p224FieldElement +- var c p224LargeFieldElement +- +- p224Square(&delta, z1, &c) +- p224Square(&gamma, y1, &c) +- p224Mul(&beta, x1, &gamma, &c) +- +- // alpha = 3*(X1-delta)*(X1+delta) +- p224Add(&t, x1, &delta) +- for i := 0; i < 8; i++ { +- t[i] += t[i] << 1 +- } +- p224Reduce(&t) +- p224Sub(&alpha, x1, &delta) +- p224Reduce(&alpha) +- p224Mul(&alpha, &alpha, &t, &c) +- +- // Z3 = (Y1+Z1)²-gamma-delta +- p224Add(z3, y1, z1) +- p224Reduce(z3) +- p224Square(z3, z3, &c) +- p224Sub(z3, z3, &gamma) +- p224Reduce(z3) +- p224Sub(z3, z3, &delta) +- p224Reduce(z3) +- +- // X3 = alpha²-8*beta +- for i := 0; i < 8; i++ { +- delta[i] = beta[i] << 3 +- } +- p224Reduce(&delta) +- p224Square(x3, &alpha, &c) +- p224Sub(x3, x3, &delta) +- p224Reduce(x3) +- +- // Y3 = alpha*(4*beta-X3)-8*gamma² +- for i := 0; i < 8; i++ { +- beta[i] <<= 2 +- } +- p224Sub(&beta, &beta, x3) +- p224Reduce(&beta) +- p224Square(&gamma, &gamma, &c) +- for i := 0; i < 8; i++ { +- gamma[i] <<= 3 +- } +- p224Reduce(&gamma) +- p224Mul(y3, &alpha, &beta, &c) +- p224Sub(y3, y3, &gamma) +- p224Reduce(y3) +-} +- +-// p224CopyConditional sets *out = *in iff the least-significant-bit of control +-// is true, and it runs in constant time. +-func p224CopyConditional(out, in *p224FieldElement, control uint32) { +- control <<= 31 +- control = uint32(int32(control) >> 31) +- +- for i := 0; i < 8; i++ { +- out[i] ^= (out[i] ^ in[i]) & control +- } +-} +- +-func p224ScalarMult(outX, outY, outZ, inX, inY, inZ *p224FieldElement, scalar []byte) { +- var xx, yy, zz p224FieldElement +- for i := 0; i < 8; i++ { +- outX[i] = 0 +- outY[i] = 0 +- outZ[i] = 0 +- } +- +- for _, byte := range scalar { +- for bitNum := uint(0); bitNum < 8; bitNum++ { +- p224DoubleJacobian(outX, outY, outZ, outX, outY, outZ) +- bit := uint32((byte >> (7 - bitNum)) & 1) +- p224AddJacobian(&xx, &yy, &zz, inX, inY, inZ, outX, outY, outZ) +- p224CopyConditional(outX, &xx, bit) +- p224CopyConditional(outY, &yy, bit) +- p224CopyConditional(outZ, &zz, bit) +- } +- } +-} +- +-// p224ToAffine converts from Jacobian to affine form. +-func p224ToAffine(x, y, z *p224FieldElement) (*big.Int, *big.Int) { +- var zinv, zinvsq, outx, outy p224FieldElement +- var tmp p224LargeFieldElement +- +- if isPointAtInfinity := p224IsZero(z); isPointAtInfinity == 1 { +- return new(big.Int), new(big.Int) +- } +- +- p224Invert(&zinv, z) +- p224Square(&zinvsq, &zinv, &tmp) +- p224Mul(x, x, &zinvsq, &tmp) +- p224Mul(&zinvsq, &zinvsq, &zinv, &tmp) +- p224Mul(y, y, &zinvsq, &tmp) +- +- p224Contract(&outx, x) +- p224Contract(&outy, y) +- return p224ToBig(&outx), p224ToBig(&outy) +-} +- +-// get28BitsFromEnd returns the least-significant 28 bits from buf>>shift, +-// where buf is interpreted as a big-endian number. +-func get28BitsFromEnd(buf []byte, shift uint) (uint32, []byte) { +- var ret uint32 +- +- for i := uint(0); i < 4; i++ { +- var b byte +- if l := len(buf); l > 0 { +- b = buf[l-1] +- // We don't remove the byte if we're about to return and we're not +- // reading all of it. +- if i != 3 || shift == 4 { +- buf = buf[:l-1] +- } +- } +- ret |= uint32(b) << (8 * i) >> shift +- } +- ret &= bottom28Bits +- return ret, buf +-} +- +-// p224FromBig sets *out = *in. +-func p224FromBig(out *p224FieldElement, in *big.Int) { +- bytes := in.Bytes() +- out[0], bytes = get28BitsFromEnd(bytes, 0) +- out[1], bytes = get28BitsFromEnd(bytes, 4) +- out[2], bytes = get28BitsFromEnd(bytes, 0) +- out[3], bytes = get28BitsFromEnd(bytes, 4) +- out[4], bytes = get28BitsFromEnd(bytes, 0) +- out[5], bytes = get28BitsFromEnd(bytes, 4) +- out[6], bytes = get28BitsFromEnd(bytes, 0) +- out[7], bytes = get28BitsFromEnd(bytes, 4) +-} +- +-// p224ToBig returns in as a big.Int. +-func p224ToBig(in *p224FieldElement) *big.Int { +- var buf [28]byte +- buf[27] = byte(in[0]) +- buf[26] = byte(in[0] >> 8) +- buf[25] = byte(in[0] >> 16) +- buf[24] = byte(((in[0] >> 24) & 0x0f) | (in[1]<<4)&0xf0) +- +- buf[23] = byte(in[1] >> 4) +- buf[22] = byte(in[1] >> 12) +- buf[21] = byte(in[1] >> 20) +- +- buf[20] = byte(in[2]) +- buf[19] = byte(in[2] >> 8) +- buf[18] = byte(in[2] >> 16) +- buf[17] = byte(((in[2] >> 24) & 0x0f) | (in[3]<<4)&0xf0) +- +- buf[16] = byte(in[3] >> 4) +- buf[15] = byte(in[3] >> 12) +- buf[14] = byte(in[3] >> 20) +- +- buf[13] = byte(in[4]) +- buf[12] = byte(in[4] >> 8) +- buf[11] = byte(in[4] >> 16) +- buf[10] = byte(((in[4] >> 24) & 0x0f) | (in[5]<<4)&0xf0) +- +- buf[9] = byte(in[5] >> 4) +- buf[8] = byte(in[5] >> 12) +- buf[7] = byte(in[5] >> 20) +- +- buf[6] = byte(in[6]) +- buf[5] = byte(in[6] >> 8) +- buf[4] = byte(in[6] >> 16) +- buf[3] = byte(((in[6] >> 24) & 0x0f) | (in[7]<<4)&0xf0) +- +- buf[2] = byte(in[7] >> 4) +- buf[1] = byte(in[7] >> 12) +- buf[0] = byte(in[7] >> 20) +- +- return new(big.Int).SetBytes(buf[:]) +-} +--- libgo/go/crypto/elliptic/p224_test.go.jj 2012-11-15 18:26:57.000000000 +0100 ++++ libgo/go/crypto/elliptic/p224_test.go 2014-03-05 15:29:58.743430988 +0100 +@@ -1,47 +0,0 @@ +-// Copyright 2012 The Go Authors. All rights reserved. +-// Use of this source code is governed by a BSD-style +-// license that can be found in the LICENSE file. +- +-package elliptic +- +-import ( +- "math/big" +- "testing" +-) +- +-var toFromBigTests = []string{ +- "0", +- "1", +- "23", +- "b70e0cb46bb4bf7f321390b94a03c1d356c01122343280d6105c1d21", +- "706a46d476dcb76798e6046d89474788d164c18032d268fd10704fa6", +-} +- +-func p224AlternativeToBig(in *p224FieldElement) *big.Int { +- ret := new(big.Int) +- tmp := new(big.Int) +- +- for i := uint(0); i < 8; i++ { +- tmp.SetInt64(int64(in[i])) +- tmp.Lsh(tmp, 28*i) +- ret.Add(ret, tmp) +- } +- ret.Mod(ret, p224.P) +- return ret +-} +- +-func TestToFromBig(t *testing.T) { +- for i, test := range toFromBigTests { +- n, _ := new(big.Int).SetString(test, 16) +- var x p224FieldElement +- p224FromBig(&x, n) +- m := p224ToBig(&x) +- if n.Cmp(m) != 0 { +- t.Errorf("#%d: %x != %x", i, n, m) +- } +- q := p224AlternativeToBig(&x) +- if n.Cmp(q) != 0 { +- t.Errorf("#%d: %x != %x (alternative)", i, n, m) +- } +- } +-} +--- libgo/go/crypto/elliptic/p256.go.jj 2013-11-07 11:59:09.000000000 +0100 ++++ libgo/go/crypto/elliptic/p256.go 2014-03-05 15:34:31.910414701 +0100 +@@ -233,6 +233,8 @@ func p256ReduceCarry(inout *[p256Limbs]u + inout[7] += carry << 25 + } + ++const bottom28Bits = 0xfffffff ++ + // p256Sum sets out = in+in2. + // + // On entry, in[i]+in2[i] must not overflow a 32-bit word. +@@ -265,6 +267,7 @@ const ( + two31m2 = 1<<31 - 1<<2 + two31p24m2 = 1<<31 + 1<<24 - 1<<2 + two30m27m2 = 1<<30 - 1<<27 - 1<<2 ++ two31m3 = 1<<31 - 1<<3 + ) + + // p256Zero31 is 0 mod p. diff --git a/SOURCES/gcc5-libgomp-omp_h-multilib.patch b/SOURCES/gcc5-libgomp-omp_h-multilib.patch new file mode 100644 index 0000000..d0e98d1 --- /dev/null +++ b/SOURCES/gcc5-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/gcc5-libstdc++44-xfail.patch b/SOURCES/gcc5-libstdc++44-xfail.patch new file mode 100644 index 0000000..0a84451 --- /dev/null +++ b/SOURCES/gcc5-libstdc++44-xfail.patch @@ -0,0 +1,190 @@ +--- libstdc++-v3/testsuite/22_locale/locale/cons/40184.cc.jj 2014-04-11 14:52:06.733884798 +0200 ++++ libstdc++-v3/testsuite/22_locale/locale/cons/40184.cc 2014-05-10 12:29:51.779887325 +0200 +@@ -1,4 +1,6 @@ + // { dg-require-namedlocale "ja_JP.eucjp" } ++// pr40184 fix not backported to base (locales with broken facets) ++// { dg-do run { xfail *-*-* } } + + // Copyright (C) 2009-2014 Free Software Foundation, Inc. + // +--- libstdc++-v3/testsuite/22_locale/time_get/get_date/char/26701.cc.jj 2014-04-11 14:52:06.680885075 +0200 ++++ libstdc++-v3/testsuite/22_locale/time_get/get_date/char/26701.cc 2014-05-10 12:29:51.792886917 +0200 +@@ -1,4 +1,6 @@ + // { dg-require-namedlocale "en_GB" } ++// pr26701 fix not backported to base (parsing of en_GB date) ++// { dg-do run { xfail *-*-* } } + + // 2010-01-06 Paolo Carlini + +--- libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/26701.cc.jj 2014-04-11 14:52:06.674885106 +0200 ++++ libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/26701.cc 2014-05-10 12:29:51.792886917 +0200 +@@ -1,4 +1,6 @@ + // { dg-require-namedlocale "en_GB" } ++// pr26701 fix not backported to base (parsing of en_GB date) ++// { dg-do run { xfail *-*-* } } + + // 2010-01-06 Paolo Carlini + +--- libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/38081-1.cc.jj 2014-04-11 14:52:06.645885257 +0200 ++++ libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/38081-1.cc 2014-05-10 12:29:51.802886712 +0200 +@@ -1,4 +1,6 @@ + // { dg-require-namedlocale "ru_RU.ISO-8859-5" } ++// pr38081 fix not backported to base (parsing weekday names) ++// { dg-do run { xfail *-*-* } } + + // Copyright (C) 2010-2014 Free Software Foundation, Inc. + // +--- libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/38081-2.cc.jj 2014-04-11 14:52:06.646885252 +0200 ++++ libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/38081-2.cc 2014-05-10 12:29:51.802886712 +0200 +@@ -1,4 +1,6 @@ + // { dg-require-namedlocale "ru_RU.UTF8" } ++// pr38081 fix not backported to base (parsing weekday names) ++// { dg-do run { xfail *-*-* } } + + // 2010-01-05 Paolo Carlini + +--- libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/4.cc.jj 2014-04-11 14:52:04.949894106 +0200 ++++ libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/4.cc 2014-05-10 12:29:51.807886709 +0200 +@@ -1,4 +1,6 @@ + // { dg-require-fileio "" } ++// pr45628 fix not backported to base (seek 0 shouldn't flush) ++// { dg-do run { xfail *-*-* } } + + // Copyright (C) 2010-2014 Free Software Foundation, Inc. + // +--- libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/45628-1.cc.jj 2014-05-10 12:29:51.808886705 +0200 ++++ libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/45628-1.cc 2014-05-10 12:31:51.652261219 +0200 +@@ -1,3 +1,6 @@ ++// { dg-do run { xfail *-*-* } } ++// pr45628 fix not backported to base (seek 0 shouldn't flush) ++ + // Copyright (C) 2010-2014 Free Software Foundation, Inc. + // + // This file is part of the GNU ISO C++ Library. This library is free +--- libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/4.cc.jj 2014-04-11 14:52:04.941894148 +0200 ++++ libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/4.cc 2014-05-10 12:29:51.808886705 +0200 +@@ -1,4 +1,6 @@ + // { dg-require-fileio "" } ++// pr45628 fix not backported to base (seek 0 should not flush) ++// { dg-do run { xfail *-*-* } } + + // Copyright (C) 2010-2014 Free Software Foundation, Inc. + // +--- libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/13.cc.jj 2014-04-11 14:52:04.771895035 +0200 ++++ libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/13.cc 2014-05-10 12:29:51.819886643 +0200 +@@ -1,3 +1,6 @@ ++// { dg-do run { xfail *-*-* } } ++// dr696 fix not backported to base (handling of overflow when reading number) ++ + // 1999-04-12 bkoz + + // Copyright (C) 1999-2014 Free Software Foundation, Inc. +--- libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/dr696.cc.jj 2014-04-11 14:52:04.770895040 +0200 ++++ libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/dr696.cc 2014-05-10 12:29:51.819886643 +0200 +@@ -1,3 +1,6 @@ ++// { dg-do run { xfail *-*-* } } ++// dr696 fix not backported to base (handling of overflow when reading number) ++ + // 2009-07-15 Paolo Carlini + // + // Copyright (C) 2009-2014 Free Software Foundation, Inc. +--- libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/13.cc.jj 2014-05-10 12:29:51.829886586 +0200 ++++ libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/13.cc 2014-05-10 12:32:23.160099254 +0200 +@@ -1,3 +1,6 @@ ++// { dg-do run { xfail *-*-* } } ++// dr696 fix not backported to base (handling of overflow when reading number) ++ + // Copyright (C) 2004-2014 Free Software Foundation, Inc. + // + // This file is part of the GNU ISO C++ Library. This library is free +--- libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/dr696.cc.jj 2014-04-11 14:52:04.762895082 +0200 ++++ libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/dr696.cc 2014-05-10 12:29:51.829886586 +0200 +@@ -1,3 +1,6 @@ ++// { dg-do run { xfail *-*-* } } ++// dr696 fix not backported to base (handling of overflow when reading number) ++ + // 2009-07-15 Paolo Carlini + // + // Copyright (C) 2009-2014 Free Software Foundation, Inc. +--- libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/26211.cc.jj 2014-04-11 14:52:04.735895223 +0200 ++++ libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/26211.cc 2014-05-10 12:29:51.836886549 +0200 +@@ -1,3 +1,6 @@ ++// { dg-do run { xfail *-*-* } } ++// pr26211 fix not backported to base (tellg/seekg should construct a sentry) ++ + // 2010-11-18 Paolo Carlini + + // Copyright (C) 2010-2014 Free Software Foundation, Inc. +--- libstdc++-v3/testsuite/27_io/basic_istream/seekg/wchar_t/26211.cc.jj 2014-04-11 14:52:04.731895243 +0200 ++++ libstdc++-v3/testsuite/27_io/basic_istream/seekg/wchar_t/26211.cc 2014-05-10 12:29:51.836886549 +0200 +@@ -1,3 +1,6 @@ ++// { dg-do run { xfail *-*-* } } ++// pr26211 fix not backported to base (tellg/seekg should construct a sentry) ++ + // 2010-11-18 Paolo Carlini + + // Copyright (C) 2010-2014 Free Software Foundation, Inc. +--- libstdc++-v3/testsuite/27_io/basic_istream/tellg/char/26211.cc.jj 2014-04-11 14:52:04.779894993 +0200 ++++ libstdc++-v3/testsuite/27_io/basic_istream/tellg/char/26211.cc 2014-05-10 12:29:51.836886549 +0200 +@@ -1,3 +1,6 @@ ++// { dg-do run { xfail *-*-* } } ++// pr26211 fix not backported to base (tellg/seekg should construct a sentry) ++ + // 2010-11-18 Paolo Carlini + + // Copyright (C) 2010-2014 Free Software Foundation, Inc. +--- libstdc++-v3/testsuite/27_io/basic_istream/tellg/wchar_t/26211.cc.jj 2014-04-11 14:52:04.775895014 +0200 ++++ libstdc++-v3/testsuite/27_io/basic_istream/tellg/wchar_t/26211.cc 2014-05-10 12:29:51.837886543 +0200 +@@ -1,3 +1,6 @@ ++// { dg-do run { xfail *-*-* } } ++// pr26211 fix not backported to base (tellg/seekg should construct a sentry) ++ + // 2010-11-18 Paolo Carlini + + // Copyright (C) 2010-2014 Free Software Foundation, Inc. +--- libstdc++-v3/testsuite/27_io/objects/char/41037.cc.jj 2014-05-10 12:29:51.848886483 +0200 ++++ libstdc++-v3/testsuite/27_io/objects/char/41037.cc 2014-05-10 12:30:52.480567953 +0200 +@@ -1,3 +1,6 @@ ++// { dg-do run { xfail *-*-* } } ++// pr41037 fix not backported to base (flags on cerr) ++ + // Copyright (C) 2009-2014 Free Software Foundation, Inc. + // + // This file is part of the GNU ISO C++ Library. This library is free +--- libstdc++-v3/testsuite/27_io/objects/wchar_t/41037.cc.jj 2014-05-10 12:29:51.856886441 +0200 ++++ libstdc++-v3/testsuite/27_io/objects/wchar_t/41037.cc 2014-05-10 12:31:20.274421862 +0200 +@@ -1,3 +1,6 @@ ++// { dg-do run { xfail *-*-* } } ++// pr26211 fix not backported to base (tellg/seekg should construct a sentry) ++ + // Copyright (C) 2009-2014 Free Software Foundation, Inc. + // + // This file is part of the GNU ISO C++ Library. This library is free +--- libstdc++-v3/testsuite/abi/demangle/regression/cw-13.cc.jj 2014-04-11 14:52:05.388891816 +0200 ++++ libstdc++-v3/testsuite/abi/demangle/regression/cw-13.cc 2014-05-10 12:29:51.868886376 +0200 +@@ -1,3 +1,6 @@ ++// { dg-do run { xfail *-*-* } } ++// pr42670 fix not backported to base (partial demangling of global ctor fn) ++ + // 2003-02-26 Carlo Wood + + // Copyright (C) 2003-2014 Free Software Foundation, Inc. +--- libstdc++-v3/testsuite/abi/demangle/regression/cw-16.cc.jj 2014-04-11 14:52:05.387891821 +0200 ++++ libstdc++-v3/testsuite/abi/demangle/regression/cw-16.cc 2014-05-10 12:29:51.868886376 +0200 +@@ -1,3 +1,6 @@ ++// { dg-do run { xfail *-*-* } } ++// pr37376 fix not backported to base ((42) + 2 changed to (42)+(2)) ++ + // 2003-11-07 Carlo Wood + + // Copyright (C) 2003-2014 Free Software Foundation, Inc. +--- libstdc++-v3/testsuite/libstdc++-abi/abi.exp.jj 2014-04-11 14:52:06.793884485 +0200 ++++ libstdc++-v3/testsuite/libstdc++-abi/abi.exp 2014-05-10 12:29:51.868886376 +0200 +@@ -61,4 +61,7 @@ remote_download "target" "current_symbol + set result [${tool}_load "./abi_check" \ + [list "--check-verbose" "current_symbols.txt" \ + "baseline_symbols.txt"]] ++# This is an artifact of running the current testsuite against the old ++# system libstdc++ ++setup_xfail *-*-* + [lindex $result 0] "libstdc++-abi/abi_check" diff --git a/SOURCES/gcc5-libtool-no-rpath.patch b/SOURCES/gcc5-libtool-no-rpath.patch new file mode 100644 index 0000000..466c661 --- /dev/null +++ b/SOURCES/gcc5-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/gcc5-no-add-needed.patch b/SOURCES/gcc5-no-add-needed.patch new file mode 100644 index 0000000..4102e1c --- /dev/null +++ b/SOURCES/gcc5-no-add-needed.patch @@ -0,0 +1,50 @@ +2010-02-08 Roland McGrath + + * config/rs6000/sysv4.h (LINK_EH_SPEC): Pass --no-add-needed to the + linker. + * config/gnu-user.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.jj 2011-01-03 12:52:31.118056764 +0100 ++++ gcc/config/alpha/elf.h 2011-01-04 18:14:10.931874160 +0100 +@@ -165,5 +165,5 @@ 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 "--no-add-needed %{!static:--eh-frame-hdr} " + #endif +--- gcc/config/ia64/linux.h.jj 2011-01-03 13:02:11.462994522 +0100 ++++ gcc/config/ia64/linux.h 2011-01-04 18:14:10.931874160 +0100 +@@ -76,7 +76,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 "--no-add-needed " + + #undef TARGET_INIT_LIBFUNCS + #define TARGET_INIT_LIBFUNCS ia64_soft_fp_init_libfuncs +--- gcc/config/gnu-user.h.jj 2011-01-03 12:53:03.739057299 +0100 ++++ gcc/config/gnu-user.h 2011-01-04 18:14:10.932814884 +0100 +@@ -82,7 +82,7 @@ see the files COPYING3 and COPYING.RUNTI + #define LIB_SPEC GNU_USER_TARGET_LIB_SPEC + + #if defined(HAVE_LD_EH_FRAME_HDR) +-#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " ++#define LINK_EH_SPEC "--no-add-needed %{!static:--eh-frame-hdr} " + #endif + + #undef LINK_GCC_C_SEQUENCE_SPEC +--- gcc/config/rs6000/sysv4.h.jj 2011-01-03 13:02:18.255994215 +0100 ++++ gcc/config/rs6000/sysv4.h 2011-01-04 18:14:10.933888871 +0100 +@@ -820,7 +820,7 @@ extern int fixuplabelno; + -dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}" + + #if defined(HAVE_LD_EH_FRAME_HDR) +-# define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " ++# define LINK_EH_SPEC "--no-add-needed %{!static:--eh-frame-hdr} " + #endif + + #define CPP_OS_LINUX_SPEC "-D__unix__ -D__gnu_linux__ -D__linux__ \ diff --git a/SOURCES/gcc5-ppc32-retaddr.patch b/SOURCES/gcc5-ppc32-retaddr.patch new file mode 100644 index 0000000..7e8eeb5 --- /dev/null +++ b/SOURCES/gcc5-ppc32-retaddr.patch @@ -0,0 +1,87 @@ +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 +@@ -20970,18 +20970,22 @@ rs6000_return_addr (int count, rtx frame + if (count != 0 + || ((DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_DARWIN) && flag_pic)) + { ++ rtx x; + cfun->machine->ra_needs_full_frame = 1; + +- return +- gen_rtx_MEM +- (Pmode, +- memory_address +- (Pmode, +- plus_constant (Pmode, +- 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 (Pmode, 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/gcc5-pr65689.patch b/SOURCES/gcc5-pr65689.patch new file mode 100644 index 0000000..0dcdd5e --- /dev/null +++ b/SOURCES/gcc5-pr65689.patch @@ -0,0 +1,231 @@ +2015-04-17 Jakub Jelinek + + PR target/65689 + * genpreds.c (struct constraint_data): Add maybe_allows_reg and + maybe_allows_mem bitfields. + (maybe_allows_none_start, maybe_allows_none_end, + maybe_allows_reg_start, maybe_allows_reg_end, maybe_allows_mem_start, + maybe_allows_mem_end): New variables. + (compute_maybe_allows): New function. + (add_constraint): Use it to initialize maybe_allows_reg and + maybe_allows_mem fields. + (choose_enum_order): Sort the non-is_register/is_const_int/is_memory/ + is_address constraints such that those that allow neither mem nor + reg come first, then those that only allow reg but not mem, then + those that only allow mem but not reg, then the rest. + (write_allows_reg_mem_function): New function. + (write_tm_preds_h): Call it. + * stmt.c (parse_output_constraint, parse_input_constraint): Use + the generated insn_extra_constraint_allows_reg_mem function + instead of always setting *allows_reg = true; *allows_mem = true; + for unknown extra constraints. + + * gcc.target/aarch64/c-output-template-4.c: New test. + +--- gcc/genpreds.c.jj 2015-04-08 18:23:50.643556230 +0200 ++++ gcc/genpreds.c 2015-04-17 17:44:23.097650110 +0200 +@@ -640,12 +640,14 @@ struct constraint_data + const char *regclass; /* for register constraints */ + rtx exp; /* for other constraints */ + unsigned int lineno; /* line of definition */ +- unsigned int is_register : 1; +- unsigned int is_const_int : 1; +- unsigned int is_const_dbl : 1; +- unsigned int is_extra : 1; +- unsigned int is_memory : 1; +- unsigned int is_address : 1; ++ unsigned int is_register : 1; ++ unsigned int is_const_int : 1; ++ unsigned int is_const_dbl : 1; ++ unsigned int is_extra : 1; ++ unsigned int is_memory : 1; ++ unsigned int is_address : 1; ++ unsigned int maybe_allows_reg : 1; ++ unsigned int maybe_allows_mem : 1; + }; + + /* Overview of all constraints beginning with a given letter. */ +@@ -691,6 +693,9 @@ static unsigned int satisfied_start; + static unsigned int const_int_start, const_int_end; + static unsigned int memory_start, memory_end; + static unsigned int address_start, address_end; ++static unsigned int maybe_allows_none_start, maybe_allows_none_end; ++static unsigned int maybe_allows_reg_start, maybe_allows_reg_end; ++static unsigned int maybe_allows_mem_start, maybe_allows_mem_end; + + /* Convert NAME, which contains angle brackets and/or underscores, to + a string that can be used as part of a C identifier. The string +@@ -711,6 +716,34 @@ mangle (const char *name) + return XOBFINISH (rtl_obstack, const char *); + } + ++/* Return a bitmask, bit 1 if EXP maybe allows a REG/SUBREG, 2 if EXP ++ maybe allows a MEM. Bits should be clear only when we are sure it ++ will not allow a REG/SUBREG or a MEM. */ ++static int ++compute_maybe_allows (rtx exp) ++{ ++ switch (GET_CODE (exp)) ++ { ++ case IF_THEN_ELSE: ++ /* Conservative answer is like IOR, of the THEN and ELSE branches. */ ++ return compute_maybe_allows (XEXP (exp, 1)) ++ | compute_maybe_allows (XEXP (exp, 2)); ++ case AND: ++ return compute_maybe_allows (XEXP (exp, 0)) ++ & compute_maybe_allows (XEXP (exp, 1)); ++ case IOR: ++ return compute_maybe_allows (XEXP (exp, 0)) ++ | compute_maybe_allows (XEXP (exp, 1)); ++ case MATCH_CODE: ++ if (*XSTR (exp, 1) == '\0') ++ return (strstr (XSTR (exp, 0), "reg") != NULL ? 1 : 0) ++ | (strstr (XSTR (exp, 0), "mem") != NULL ? 2 : 0); ++ /* FALLTHRU */ ++ default: ++ return 3; ++ } ++} ++ + /* Add one constraint, of any sort, to the tables. NAME is its name; + REGCLASS is the register class, if any; EXP is the expression to + test, if any; IS_MEMORY and IS_ADDRESS indicate memory and address +@@ -866,6 +899,11 @@ add_constraint (const char *name, const + c->is_extra = !(regclass || is_const_int || is_const_dbl); + c->is_memory = is_memory; + c->is_address = is_address; ++ int maybe_allows = 3; ++ if (exp) ++ maybe_allows = compute_maybe_allows (exp); ++ c->maybe_allows_reg = (maybe_allows & 1) != 0; ++ c->maybe_allows_mem = (maybe_allows & 2) != 0; + + c->next_this_letter = *slot; + *slot = c; +@@ -940,8 +978,30 @@ choose_enum_order (void) + enum_order[next++] = c; + address_end = next; + ++ maybe_allows_none_start = next; ++ FOR_ALL_CONSTRAINTS (c) ++ if (!c->is_register && !c->is_const_int && !c->is_memory && !c->is_address ++ && !c->maybe_allows_reg && !c->maybe_allows_mem) ++ enum_order[next++] = c; ++ maybe_allows_none_end = next; ++ ++ maybe_allows_reg_start = next; ++ FOR_ALL_CONSTRAINTS (c) ++ if (!c->is_register && !c->is_const_int && !c->is_memory && !c->is_address ++ && c->maybe_allows_reg && !c->maybe_allows_mem) ++ enum_order[next++] = c; ++ maybe_allows_reg_end = next; ++ ++ maybe_allows_mem_start = next; ++ FOR_ALL_CONSTRAINTS (c) ++ if (!c->is_register && !c->is_const_int && !c->is_memory && !c->is_address ++ && !c->maybe_allows_reg && c->maybe_allows_mem) ++ enum_order[next++] = c; ++ maybe_allows_mem_end = next; ++ + FOR_ALL_CONSTRAINTS (c) +- if (!c->is_register && !c->is_const_int && !c->is_memory && !c->is_address) ++ if (!c->is_register && !c->is_const_int && !c->is_memory && !c->is_address ++ && c->maybe_allows_reg && c->maybe_allows_mem) + enum_order[next++] = c; + gcc_assert (next == num_constraints); + } +@@ -1229,6 +1289,41 @@ write_range_function (const char *name, + "}\n\n", name); + } + ++/* Write a definition for insn_extra_constraint_allows_reg_mem function. */ ++static void ++write_allows_reg_mem_function (void) ++{ ++ printf ("static inline void\n" ++ "insn_extra_constraint_allows_reg_mem (enum constraint_num c,\n" ++ "\t\t\t\t bool *allows_reg, bool *allows_mem)\n" ++ "{\n"); ++ if (maybe_allows_none_start != maybe_allows_none_end) ++ printf (" if (c >= CONSTRAINT_%s && c <= CONSTRAINT_%s)\n" ++ " return;\n", ++ enum_order[maybe_allows_none_start]->c_name, ++ enum_order[maybe_allows_none_end - 1]->c_name); ++ if (maybe_allows_reg_start != maybe_allows_reg_end) ++ printf (" if (c >= CONSTRAINT_%s && c <= CONSTRAINT_%s)\n" ++ " {\n" ++ " *allows_reg = true;\n" ++ " return;\n" ++ " }\n", ++ enum_order[maybe_allows_reg_start]->c_name, ++ enum_order[maybe_allows_reg_end - 1]->c_name); ++ if (maybe_allows_mem_start != maybe_allows_mem_end) ++ printf (" if (c >= CONSTRAINT_%s && c <= CONSTRAINT_%s)\n" ++ " {\n" ++ " *allows_mem = true;\n" ++ " return;\n" ++ " }\n", ++ enum_order[maybe_allows_mem_start]->c_name, ++ enum_order[maybe_allows_mem_end - 1]->c_name); ++ printf (" (void) c;\n" ++ " *allows_reg = true;\n" ++ " *allows_mem = true;\n" ++ "}\n\n"); ++} ++ + /* VEC is a list of key/value pairs, with the keys being lower bounds + of a range. Output a decision tree that handles the keys covered by + [VEC[START], VEC[END]), returning FALLBACK for keys lower then VEC[START]'s. +@@ -1326,6 +1421,7 @@ write_tm_preds_h (void) + memory_start, memory_end); + write_range_function ("insn_extra_address_constraint", + address_start, address_end); ++ write_allows_reg_mem_function (); + + if (constraint_max_namelen > 1) + { +--- gcc/stmt.c.jj 2015-04-08 18:23:50.660555956 +0200 ++++ gcc/stmt.c 2015-04-17 17:36:50.623044548 +0200 +@@ -342,13 +342,7 @@ parse_output_constraint (const char **co + else if (insn_extra_memory_constraint (cn)) + *allows_mem = true; + else +- { +- /* Otherwise we can't assume anything about the nature of +- the constraint except that it isn't purely registers. +- Treat it like "g" and hope for the best. */ +- *allows_reg = true; +- *allows_mem = true; +- } ++ insn_extra_constraint_allows_reg_mem (cn, allows_reg, allows_mem); + break; + } + +@@ -465,13 +459,7 @@ parse_input_constraint (const char **con + else if (insn_extra_memory_constraint (cn)) + *allows_mem = true; + else +- { +- /* Otherwise we can't assume anything about the nature of +- the constraint except that it isn't purely registers. +- Treat it like "g" and hope for the best. */ +- *allows_reg = true; +- *allows_mem = true; +- } ++ insn_extra_constraint_allows_reg_mem (cn, allows_reg, allows_mem); + break; + } + +--- gcc/testsuite/gcc.target/aarch64/c-output-template-4.c.jj 2015-04-17 17:48:27.588654584 +0200 ++++ gcc/testsuite/gcc.target/aarch64/c-output-template-4.c 2015-04-17 17:48:22.149743468 +0200 +@@ -0,0 +1,10 @@ ++/* { dg-do compile } */ ++/* { dg-options "-O0" } */ ++ ++void ++test (void) ++{ ++ __asm__ ("@ %c0" : : "S" (&test + 4)); ++} ++ ++/* { dg-final { scan-assembler "@ test\\+4" } } */ diff --git a/SOURCES/gcc5-rh330771.patch b/SOURCES/gcc5-rh330771.patch new file mode 100644 index 0000000..102730f --- /dev/null +++ b/SOURCES/gcc5-rh330771.patch @@ -0,0 +1,27 @@ +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 +@@ -550,7 +550,7 @@ libgcj_tools_la_LDFLAGS = -rpath $(toole + $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS) $(LIBJAVA_LDFLAGS_NOUNDEF) \ + $(LIBJAVA_LDFLAGS_LIBMATH) + +-libgcj_tools_la_LIBADD = libgcj.la ++libgcj_tools_la_LIBADD = -L$(here)/.libs libgcj.la + libgcj_tools_la_DEPENDENCIES = libgcj.la libgcj.spec \ + $(libgcj_tools_la_version_dep) + if BUILD_SUBLIBS +--- libjava/Makefile.in.jj 2009-05-06 08:14:49.000000000 +0200 ++++ libjava/Makefile.in 2009-05-06 10:27:18.000000000 +0200 +@@ -1110,7 +1110,7 @@ libgcj_tools_la_LDFLAGS = -rpath $(toole + $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS) $(LIBJAVA_LDFLAGS_NOUNDEF) \ + $(LIBJAVA_LDFLAGS_LIBMATH) + +-libgcj_tools_la_LIBADD = libgcj.la ++libgcj_tools_la_LIBADD = -L$(here)/.libs libgcj.la + libgcj_tools_la_DEPENDENCIES = libgcj.la libgcj.spec \ + $(libgcj_tools_la_version_dep) $(am__append_19) + libgcj_tools_la_LINK = $(LIBLINK) $(libgcj_tools_la_LDFLAGS) \ diff --git a/SOURCES/gcc5-sparc-config-detection.patch b/SOURCES/gcc5-sparc-config-detection.patch new file mode 100644 index 0000000..a37018e --- /dev/null +++ b/SOURCES/gcc5-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 +@@ -2656,7 +2656,7 @@ sparc-*-rtems*) + tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/sp-elf.h sparc/rtemself.h rtems.h newlib-stdint.h" + tmake_file="${tmake_file} sparc/t-sparc sparc/t-rtems" + ;; +-sparc-*-linux*) ++sparc-*-linux* | sparcv9-*-linux*) + tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h sparc/tso.h" + extra_options="${extra_options} sparc/long-double-switch.opt" + case ${target} in +@@ -2710,7 +2710,7 @@ sparc64-*-rtems*) + extra_options="${extra_options}" + tmake_file="${tmake_file} sparc/t-sparc sparc/t-rtems-64" + ;; +-sparc64-*-linux*) ++sparc64*-*-linux*) + tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h sparc/default-64.h sparc/linux64.h sparc/tso.h" + extra_options="${extra_options} sparc/long-double-switch.opt" + tmake_file="${tmake_file} sparc/t-sparc sparc/t-linux64" +--- libgcc/config.host.jj 2008-04-24 15:46:19.000000000 -0500 ++++ libgcc/config.host 2008-04-24 15:46:49.000000000 -0500 +@@ -1002,7 +1002,7 @@ sparc-*-elf*) + tmake_file="${tmake_file} t-fdpbit t-crtfm" + extra_parts="$extra_parts crti.o crtn.o crtfastmath.o" + ;; +-sparc-*-linux*) # SPARC's running GNU/Linux, libc6 ++sparc-*-linux* | sparcv9-*-linux*) # SPARC's running GNU/Linux, libc6 + tmake_file="${tmake_file} t-crtfm" + if test "${host_address}" = 64; then + tmake_file="$tmake_file sparc/t-linux64" +@@ -1050,7 +1050,7 @@ sparc64-*-freebsd*|ultrasparc-*-freebsd* + tmake_file="$tmake_file t-crtfm" + extra_parts="$extra_parts crtfastmath.o" + ;; +-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} t-crtfm sparc/t-linux" + if test "${host_address}" = 64; then diff --git a/SPECS/gcc-libraries.spec b/SPECS/gcc-libraries.spec new file mode 100644 index 0000000..75a6f19 --- /dev/null +++ b/SPECS/gcc-libraries.spec @@ -0,0 +1,669 @@ +%global DATE 20150716 +%global SVNREV 225895 +%global gcc_version 5.2.1 +# 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 2 +%global mpc_version 0.8.1 +%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 +%if 0%{?rhel} >= 7 +%global build_libatomic 0 +%else +%global build_libatomic 1 +%endif +%if 0%{?rhel} >= 7 +%global build_libitm 0 +%else +%global build_libitm 1 +%endif +%ifarch %{ix86} x86_64 +%global build_libcilkrts 1 +%else +%global build_libcilkrts 0 +%endif +%ifarch %{ix86} x86_64 +%global build_libmpx 1 +%else +%global build_libmpx 0 +%endif +%ifarch %{ix86} x86_64 ppc ppc64 ppc64le ppc64p7 s390 s390x %{arm} aarch64 +%global attr_ifunc 1 +%else +%global attr_ifunc 0 +%endif +Summary: GCC runtime libraries +Name: gcc-libraries +Provides: libatomic libitm libcilkrts libmpx +Obsoletes: libitm + +Version: %{gcc_version} +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 and LGPLv2+ and BSD +Group: System Environment/Libraries +# 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-5-branch@%{SVNREV} gcc-%{version}-%{DATE} +# tar cf - gcc-%{version}-%{DATE} | bzip2 -9 > gcc-%{version}-%{DATE}.tar.bz2 +Source0: gcc-%{version}-%{DATE}.tar.bz2 +Source1: http://www.multiprecision.org/mpc/download/mpc-%{mpc_version}.tar.gz +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 +BuildRequires: binutils >= 2.19.51.0.14-33 +# 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 +BuildRequires: /usr/bin/pod2man +%if 0%{?rhel} >= 7 +BuildRequires: texinfo-tex +%endif +#BuildRequires: systemtap-sdt-devel >= 1.3 +# 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.147 +BuildRequires: elfutils-libelf-devel >= 0.147 +%ifarch ppc ppc64 ppc64le ppc64p7 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 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 +Requires: binutils >= 2.19.51.0.14-33 +# Make sure gdb will understand DW_FORM_strp +Conflicts: gdb < 5.1-2 +Requires: glibc-devel >= 2.2.90-12 +%ifarch ppc ppc64 ppc64le ppc64p7 s390 s390x sparc sparcv9 alpha +# Make sure glibc supports TFmode long double +Requires: glibc >= 2.3.90-35 +%endif +Requires: libgcc >= 4.1.2-43 +Requires: libgomp >= 4.4.4-13 +BuildRequires: gmp-devel >= 4.1.2-8 +BuildRequires: mpfr-devel >= 2.2.1 +%if 0%{?rhel} >= 7 +BuildRequires: libmpc-devel >= 0.8.1 +%endif +Requires(post): /sbin/install-info +Requires(preun): /sbin/install-info +ExclusiveArch: %{ix86} x86_64 ppc ppc64 s390 s390x + +%global oformat %{nil} +%global oformat2 %{nil} +%ifarch %{ix86} +%global oformat OUTPUT_FORMAT(elf32-i386) +%endif +%ifarch x86_64 +%global oformat OUTPUT_FORMAT(elf64-x86-64) +%global oformat2 OUTPUT_FORMAT(elf32-i386) +%endif +%ifarch ppc +%global oformat OUTPUT_FORMAT(elf32-powerpc) +%global oformat2 OUTPUT_FORMAT(elf64-powerpc) +%endif +%ifarch ppc64 +%global oformat OUTPUT_FORMAT(elf64-powerpc) +%global oformat2 OUTPUT_FORMAT(elf32-powerpc) +%endif +%ifarch s390 +%global oformat OUTPUT_FORMAT(elf32-s390) +%endif +%ifarch s390x +%global oformat OUTPUT_FORMAT(elf64-s390) +%global oformat2 OUTPUT_FORMAT(elf32-s390) +%endif +%ifarch ia64 +%global oformat OUTPUT_FORMAT(elf64-ia64-little) +%endif + +Patch0: gcc5-hack.patch +Patch1: gcc5-java-nomulti.patch +Patch2: gcc5-ppc32-retaddr.patch +Patch3: gcc5-rh330771.patch +Patch4: gcc5-i386-libgomp.patch +Patch5: gcc5-sparc-config-detection.patch +Patch6: gcc5-libgomp-omp_h-multilib.patch +Patch7: gcc5-libtool-no-rpath.patch +Patch12: gcc5-no-add-needed.patch +Patch15: gcc5-pr65689.patch +Patch16: gcc5-libgo-p224.patch + +#Patch1000: gcc5-libstdc++-compat.patch +#Patch1001: gcc5-libgfortran-compat.patch +Patch1002: gcc5-alt-compat-test.patch +#Patch1003: gcc5-libquadmath-compat.patch +Patch1004: gcc5-libstdc++44-xfail.patch +Patch1100: gcc5-htm-in-asm.patch + +%if 0%{?rhel} >= 7 +%global nonsharedver 48 +%else +%global nonsharedver 44 +%endif + +%global _gnu %{nil} +%ifarch sparcv9 +%global gcc_target_platform sparc64-%{_vendor}-%{_target_os}%{?_gnu} +%endif +%ifarch ppc +%global gcc_target_platform ppc64-%{_vendor}-%{_target_os}%{?_gnu} +%endif +%ifnarch sparcv9 ppc +%global gcc_target_platform %{_target_platform} +%endif + +%description +This package contains various GCC runtime libraries, such as libatomic, +or libitm. + +%package -n libitm +Summary: The GNU Transactional Memory library +Group: System Environment/Libraries +Requires(post): /sbin/install-info +Requires(preun): /sbin/install-info + +%description -n libitm +This package contains the GNU Transactional Memory library +which is a GCC transactional memory support runtime library. + +%package -n libatomic +Summary: The GNU Atomic library +Group: System Environment/Libraries +Requires(post): /sbin/install-info +Requires(preun): /sbin/install-info + +%description -n libatomic +This package contains the GNU Atomic library +which is a GCC support runtime library for atomic operations not supported +by hardware. + +%package -n libcilkrts +Summary: The Cilk+ runtime library +Group: System Environment/Libraries +Requires(post): /sbin/install-info +Requires(preun): /sbin/install-info + +%description -n libcilkrts +This package contains the Cilk+ runtime library. + +%package -n libmpx +Summary: The Memory Protection Extensions runtime libraries +Group: System Environment/Libraries +Requires(post): /sbin/install-info +Requires(preun): /sbin/install-info + +%description -n libmpx +This package contains the Memory Protection Extensions runtime libraries +which is used for -fcheck-pointer-bounds -mmpx instrumented programs. + +%prep +%if 0%{?rhel} >= 7 +%setup -q -n gcc-%{version}-%{DATE} +%else +%setup -q -n gcc-%{version}-%{DATE} -a 1 +%endif +%patch0 -p0 -b .hack~ +%patch1 -p0 -b .java-nomulti~ +%patch2 -p0 -b .ppc32-retaddr~ +%patch3 -p0 -b .rh330771~ +%patch4 -p0 -b .i386-libgomp~ +%patch5 -p0 -b .sparc-config-detection~ +%patch6 -p0 -b .libgomp-omp_h-multilib~ +%patch7 -p0 -b .libtool-no-rpath~ +%patch12 -p0 -b .no-add-needed~ +%patch15 -p0 -b .pr65689~ +%patch16 -p0 -b .libgo-p224~ +rm -f libgo/go/crypto/elliptic/p224{,_test}.go + +# nonshared stuff not ready yet for DTS4 +#%patch1000 -p0 -b .libstdc++-compat~ +#%patch1001 -p0 -b .libgfortran-compat~ +%ifarch %{ix86} x86_64 +%if 0%{?rhel} < 7 +# On i?86/x86_64 there are some incompatibilities in _Decimal* as well as +# aggregates containing larger vector passing. +%patch1002 -p0 -b .alt-compat-test~ +%endif +%endif + +#%if 0%{?rhel} < 7 +#%patch1003 -p0 -b .libquadmath-compat~ +#%endif + +# We probably don't care about libstdc++ testsuite here. +#%if 0%{?rhel} == 6 +#%patch1004 -p0 -b .libstdc++44-xfail~ +#%endif +%patch1100 -p0 -b .gcc5-htm-in-asm~ + +%if 0%{?rhel} == 6 +# Default to -gdwarf-3 rather than -gdwarf-4 +sed -i '/UInteger Var(dwarf_version)/s/Init(4)/Init(3)/' gcc/common.opt +sed -i 's/\(may be either 2, 3 or 4; the default version is \)4\./\13./' gcc/doc/invoke.texi +%endif + +cp -a libstdc++-v3/config/cpu/i{4,3}86/atomicity.h +cp -a libstdc++-v3/config/cpu/i{4,3}86/opt + +./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 +%build + +# Undo the broken autoconf change in recent Fedora versions +export CONFIG_SITE=NONE + +rm -fr obj-%{gcc_target_platform} +mkdir obj-%{gcc_target_platform} +cd obj-%{gcc_target_platform} + + +%if 0%{?rhel} < 7 +mkdir mpc mpc-install +cd mpc +../../mpc-%{mpc_version}/configure --disable-shared \ + CFLAGS="${CFLAGS:-%optflags}" CXXFLAGS="${CXXFLAGS:-%optflags}" \ + --prefix=`cd ..; pwd`/mpc-install +make %{?_smp_mflags} +make install +cd .. +%endif + +CC=gcc +CXX=g++ +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'` +OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-mfpmath=sse/-mfpmath=sse -msse2/g'` +OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/ -pipe / /g'` +%ifarch sparc +OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-mcpu=ultrasparc/-mtune=ultrasparc/g;s/-mcpu=v[78]//g'` +%endif +%ifarch %{ix86} +OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-march=i.86//g'` +%endif +%ifarch sparc64 +cat > gcc64 <<"EOF" +#!/bin/sh +exec /usr/bin/gcc -m64 "$@" +EOF +chmod +x gcc64 +CC=`pwd`/gcc64 +cat > g++64 <<"EOF" +#!/bin/sh +exec /usr/bin/g++ -m64 "$@" +EOF +chmod +x g++64 +CXX=`pwd`/g++64 +%endif +%ifarch ppc64 ppc64le ppc64p7 +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 + cat > g++64 <<"EOF" +#!/bin/sh +exec /usr/bin/g++ -m64 "$@" +EOF + chmod +x g++64 + CXX=`pwd`/g++64 +fi +%endif +OPT_FLAGS=`echo "$OPT_FLAGS" | sed -e 's/[[:blank:]]\+/ /g'` +CC="$CC" CXX="$CXX" CFLAGS="$OPT_FLAGS" \ + CXXFLAGS="`echo " $OPT_FLAGS " | sed 's/ -Wall / /g;s/ -fexceptions / /g'`" \ + XCFLAGS="$OPT_FLAGS" TCFLAGS="$OPT_FLAGS" \ + GCJFLAGS="$OPT_FLAGS" \ + ../configure --prefix=%{_prefix} --mandir=%{_mandir} --infodir=%{_infodir} \ + --with-bugurl=http://bugzilla.redhat.com/bugzilla --disable-bootstrap \ + --enable-shared --enable-threads=posix --enable-checking=release \ + --enable-multilib \ + --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions \ + --enable-gnu-unique-object \ + --enable-linker-build-id \ + --enable-languages=c,c++,lto \ + --enable-plugin --with-linker-hash-style=gnu \ +%if 0%{?rhel} >= 7 + --enable-initfini-array \ +%else + --disable-initfini-array \ +%endif + --disable-libgcj \ +%if %{build_libmpx} + --enable-libmpx \ +%else + --disable-libmpx \ +%endif + --without-ppl --without-cloog \ +%if 0%{?rhel} < 7 + --with-mpc=`pwd`/mpc-install \ +%endif +%if 0%{?rhel} >= 7 +%if %{attr_ifunc} + --enable-gnu-indirect-function \ +%endif +%endif +%ifarch %{arm} + --disable-sjlj-exceptions \ +%endif +%ifarch ppc ppc64 ppc64le ppc64p7 + --enable-secureplt \ +%endif +%ifarch sparc sparcv9 sparc64 ppc ppc64 ppc64le ppc64p7 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 +%ifarch ppc ppc64 ppc64le ppc64p7 +%if 0%{?rhel} >= 7 + --with-cpu-32=power7 --with-tune-32=power7 --with-cpu-64=power7 --with-tune-64=power7 \ +%else + --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" + +# Copy various doc files here and there +cd .. +mkdir -p rpm.doc/libatomic rpm.doc/libitm rpm.doc/libcilkrts rpm.doc/libmpx + +%if %{build_libitm} +(cd libitm; for i in ChangeLog*; do + cp -p $i ../rpm.doc/libitm/$i.libitm +done) +%endif + +%if %{build_libatomic} +(cd libatomic; for i in ChangeLog*; do + cp -p $i ../rpm.doc/libatomic/$i.libatomic +done) +%endif + +%if %{build_libcilkrts} +(cd libcilkrts; for i in ChangeLog*; do + cp -p $i ../rpm.doc/libcilkrts/$i.libcilkrts +done) +%endif + +%if %{build_libmpx} +(cd libmpx; for i in ChangeLog*; do + cp -p $i ../rpm.doc/libmpx/$i.libmpx +done) +%endif + +rm -f rpm.doc/changelogs/gcc/ChangeLog.[1-9] +find rpm.doc -name \*ChangeLog\* | xargs bzip2 -9 + +%install +rm -fr %{buildroot} + +cd obj-%{gcc_target_platform} + +# Make sure libcilkrts can use system libgcc_s.so.1. +rm -f gcc/libgcc_s.so +echo '/* GNU ld script + Use the shared library, but some functions are only in + the static library, so try that secondarily. */ +%{oformat} +GROUP ( /%{_lib}/libgcc_s.so.1 libgcc.a )' > gcc/libgcc_s.so + +mkdir -p %{buildroot}%{_prefix}/%{_lib} +mkdir -p %{buildroot}%{_infodir} + +# Use make install DESTDIR trick to avoid bogus RPATHs. +%if %{build_libitm} +cd %{gcc_target_platform}/libitm/ +mkdir temp +make install DESTDIR=`pwd`/temp +cp -a temp/usr/%{_lib}/libitm.so.1* %{buildroot}%{_prefix}/%{_lib}/ +cp -a libitm.info %{buildroot}%{_infodir}/ +cd ../.. +%endif + +%if %{build_libatomic} +cd %{gcc_target_platform}/libatomic/ +mkdir temp +make install DESTDIR=`pwd`/temp +cp -a temp/usr/%{_lib}/libatomic.so.1* %{buildroot}%{_prefix}/%{_lib}/ +cd ../.. +%endif + +%if %{build_libcilkrts} +cd %{gcc_target_platform}/libcilkrts/ +mkdir temp +make install DESTDIR=`pwd`/temp +cp -a temp/usr/%{_lib}/libcilkrts.so.5* %{buildroot}%{_prefix}/%{_lib}/ +cd ../.. +%endif + +%if %{build_libmpx} +cd %{gcc_target_platform}/libmpx/ +mkdir temp +make install DESTDIR=`pwd`/temp +cp -a temp/usr/%{_lib}/libmpx.so.* %{buildroot}%{_prefix}/%{_lib}/ +cd ../.. +%endif + +rm -f gcc/libgcc_s.so +ln -sf libgcc_s.so.1 gcc/libgcc_s.so + +%check +cd obj-%{gcc_target_platform} + +# run the tests. +make %{?_smp_mflags} -k check-target-lib{itm,atomic} RUNTESTFLAGS="--target_board=unix/'{,-fstack-protector}'" || : +( LC_ALL=C ../contrib/test_summary -t || : ) 2>&1 | sed -n '/^cat.*EOF/,/^EOF/{/^cat.*EOF/d;/^EOF/d;/^LAST_UPDATED:/d;p;}' > testresults +echo ====================TESTING========================= +cat testresults +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} + +%post -n libitm +/sbin/ldconfig +if [ -f %{_infodir}/libitm.info.gz ]; then + /sbin/install-info \ + --info-dir=%{_infodir} %{_infodir}/libitm.info.gz || : +fi + +%post -n libatomic +/sbin/ldconfig +if [ -f %{_infodir}/libatomic.info.gz ]; then + /sbin/install-info \ + --info-dir=%{_infodir} %{_infodir}/libatomic.info.gz || : +fi + +%post -n libcilkrts +/sbin/ldconfig +if [ -f %{_infodir}/libcilkrts.info.gz ]; then + /sbin/install-info \ + --info-dir=%{_infodir} %{_infodir}/libcilkrts.info.gz || : +fi + +%preun -n libitm +if [ $1 = 0 -a -f %{_infodir}/libitm.info.gz ]; then + /sbin/install-info --delete \ + --info-dir=%{_infodir} %{_infodir}/libitm.info.gz || : +fi + +%preun -n libatomic +if [ $1 = 0 -a -f %{_infodir}/libatomic.info.gz ]; then + /sbin/install-info --delete \ + --info-dir=%{_infodir} %{_infodir}/libatomic.info.gz || : +fi + +%preun -n libcilkrts +if [ $1 = 0 -a -f %{_infodir}/libcilkrts.info.gz ]; then + /sbin/install-info --delete \ + --info-dir=%{_infodir} %{_infodir}/libcilkrts.info.gz || : +fi + +%postun -n libitm -p /sbin/ldconfig + +%postun -n libatomic -p /sbin/ldconfig + +%postun -n libcilkrts -p /sbin/ldconfig + +%post -n libmpx -p /sbin/ldconfig + +%postun -n libmpx -p /sbin/ldconfig + +%if %{build_libitm} +%files -n libitm +%defattr(-,root,root,-) +%{_prefix}/%{_lib}/libitm.so.1* +%{_infodir}/libitm.info* + +%doc gcc/COPYING3 COPYING.RUNTIME rpm.doc/libitm/* +%endif + +%if %{build_libatomic} +%files -n libatomic +%defattr(-,root,root,-) +%{_prefix}/%{_lib}/libatomic.so.1* + +%doc gcc/COPYING3 COPYING.RUNTIME rpm.doc/libatomic/* +%endif + +%if %{build_libcilkrts} +%files -n libcilkrts +%defattr(-,root,root,-) +%{_prefix}/%{_lib}/libcilkrts.so.5* + +%doc gcc/COPYING3 COPYING.RUNTIME rpm.doc/libcilkrts/* +%endif + +%if %{build_libmpx} +%files -n libmpx +%defattr(-,root,root,-) +%{_prefix}/%{_lib}/libmpx.so.* + +%doc gcc/COPYING3 COPYING.RUNTIME rpm.doc/libmpx/* +%endif + +%changelog +* Mon Jul 20 2015 Marek Polacek 5.2.1-2.1 +- don't build libatomic and libitm for RHEL7 + +* Mon Jul 20 2015 Marek Polacek 5.2.1-1.1 +- update from DTS gcc-5.2.1-1 + +* Fri Apr 10 2015 Marek Polacek 5.0.0-1.1.1 +- update from Fedora gcc-5.0.0-0.21.fc22 +- add libmpx subpackage on x86 + +* Mon Jun 02 2014 Marek Polacek 4.9.0-6.1.1 +- make sure libcilkrts can use system libgcc_s.so.1 (#1101277) +- update from DTS gcc-4.9.0-6 + +* Fri May 23 2014 Marek Polacek 4.9.0-5.2.1 +- prevent bogus RPATHs + +* Wed May 14 2014 Marek Polacek 4.9.0-5.1.1 +- update from DTS gcc-4.9.0-5 +- add libcilkrts + +* Mon Apr 28 2014 Marek Polacek 4.8.2-12.1.1 +- update from DTS gcc-4.8.2-12 + +* Wed Aug 14 2013 Marek Polacek 4.8.1-4.2.1 +- always build HTM bits in libitm (#996683, #996682) + +* Fri Jul 19 2013 Marek Polacek 4.8.1-4.1.1 +- update from DTS gcc-4.8.1-4 + +* Wed May 29 2013 Marek Polacek 4.8.0-5.1.1 +- update from DTS gcc-4.8.0-5 +- build libitm even for s390{,x} + +* Thu May 02 2013 Marek Polacek 4.8.0-3.1.1 +- new package