From 8b5be633439d1747924a94bfb6a32f47be882458 Mon Sep 17 00:00:00 2001
From: Juan RP <xtraeme@voidlinux.eu>
Date: Sat, 27 Jun 2015 07:27:45 +0200
Subject: [PATCH] gcc: update to 4.9.3.

---
 .../gcc/patches/gcc-4.8-filename-output.patch | 19 -----
 .../gcc-4.9-aarch64-local-atomic.patch        | 71 -------------------
 srcpkgs/gcc/template                          | 10 ++-
 3 files changed, 4 insertions(+), 96 deletions(-)
 delete mode 100644 srcpkgs/gcc/patches/gcc-4.8-filename-output.patch
 delete mode 100644 srcpkgs/gcc/patches/gcc-4.9-aarch64-local-atomic.patch

diff --git a/srcpkgs/gcc/patches/gcc-4.8-filename-output.patch b/srcpkgs/gcc/patches/gcc-4.8-filename-output.patch
deleted file mode 100644
index 2d97c0c84e8..00000000000
--- a/srcpkgs/gcc/patches/gcc-4.8-filename-output.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57653
-
---- gcc/c-family/c-opts.c       (revision 200330)
-+++ gcc/c-family/c-opts.c       (working copy)
-@@ -1338,10 +1338,14 @@ c_finish_options (void)
-
- /* Give CPP the next file given by -include, if any.  */
- static void
- push_command_line_include (void)
- {
-+  // This can happen if disabled by -imacros for example.
-+  if (include_cursor > deferred_count)
-+    return;
-+
-   if (!done_preinclude)
-     {
-       done_preinclude = true;
-       if (flag_hosted && std_inc && !cpp_opts->preprocessed)
-        {
diff --git a/srcpkgs/gcc/patches/gcc-4.9-aarch64-local-atomic.patch b/srcpkgs/gcc/patches/gcc-4.9-aarch64-local-atomic.patch
deleted file mode 100644
index eecb2775a2e..00000000000
--- a/srcpkgs/gcc/patches/gcc-4.9-aarch64-local-atomic.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02209.html
-via https://gcc.gnu.org/ml/gcc-patches/2014-12/msg01844.html
-
---- gcc/config/aarch64/iterators.md	2014-09-22 10:10:04.520258964 -0700
-+++ gcc/config/aarch64/iterators.md	2014-09-16 14:27:10.459050672 -0700
-@@ -349,6 +349,9 @@
- ;; Attribute to describe constants acceptable in logical operations
- (define_mode_attr lconst [(SI "K") (DI "L")])
- 
-+;; Attribute to describe constants acceptable in atomic logical operations
-+(define_mode_attr lconst_atomic [(QI "K") (HI "K") (SI "K") (DI "L")])
-+
- ;; Map a mode to a specific constraint character.
- (define_mode_attr cmode [(QI "q") (HI "h") (SI "s") (DI "d")])
- 
---- gcc/config/aarch64/atomics.md	2014-07-03 21:55:36.083476668 -0700
-+++ gcc/config/aarch64/atomics.md	2014-09-16 14:27:10.459050672 -0700
-@@ -119,7 +119,7 @@
-   [(set (match_operand:ALLI 0 "aarch64_sync_memory_operand" "+Q")
-     (unspec_volatile:ALLI
-       [(atomic_op:ALLI (match_dup 0)
-- (match_operand:ALLI 1 "<atomic_op_operand>" "rn"))
-+ (match_operand:ALLI 1 "<atomic_op_operand>" "r<lconst_atomic>"))
-        (match_operand:SI 2 "const_int_operand")]   ;; model
-       UNSPECV_ATOMIC_OP))
-        (clobber (reg:CC CC_REGNUM))
-@@ -141,7 +141,7 @@
-     (unspec_volatile:ALLI
-       [(not:ALLI
-  (and:ALLI (match_dup 0)
--   (match_operand:ALLI 1 "aarch64_logical_operand" "rn")))
-+   (match_operand:ALLI 1 "aarch64_logical_operand" "r<lconst_atomic>")))
-        (match_operand:SI 2 "const_int_operand")]   ;; model
-       UNSPECV_ATOMIC_OP))
-    (clobber (reg:CC CC_REGNUM))
-@@ -164,7 +164,7 @@
-    (set (match_dup 1)
-     (unspec_volatile:ALLI
-       [(atomic_op:ALLI (match_dup 1)
-- (match_operand:ALLI 2 "<atomic_op_operand>" "rn"))
-+ (match_operand:ALLI 2 "<atomic_op_operand>" "r<lconst_atomic>"))
-        (match_operand:SI 3 "const_int_operand")]   ;; model
-       UNSPECV_ATOMIC_OP))
-    (clobber (reg:CC CC_REGNUM))
-@@ -188,7 +188,7 @@
-     (unspec_volatile:ALLI
-       [(not:ALLI
-   (and:ALLI (match_dup 1)
--    (match_operand:ALLI 2 "aarch64_logical_operand" "rn")))
-+    (match_operand:ALLI 2 "aarch64_logical_operand" "r<lconst_atomic>")))
-        (match_operand:SI 3 "const_int_operand")]   ;; model
-       UNSPECV_ATOMIC_OP))
-    (clobber (reg:CC CC_REGNUM))
-@@ -209,7 +209,7 @@
-   [(set (match_operand:ALLI 0 "register_operand" "=&r")
-     (atomic_op:ALLI
-       (match_operand:ALLI 1 "aarch64_sync_memory_operand" "+Q")
--      (match_operand:ALLI 2 "<atomic_op_operand>" "rn")))
-+      (match_operand:ALLI 2 "<atomic_op_operand>" "r<lconst_atomic>")))
-    (set (match_dup 1)
-     (unspec_volatile:ALLI
-       [(match_dup 1) (match_dup 2)
-@@ -233,7 +233,7 @@
-     (not:ALLI
-       (and:ALLI
-  (match_operand:ALLI 1 "aarch64_sync_memory_operand" "+Q")
-- (match_operand:ALLI 2 "aarch64_logical_operand" "rn"))))
-+ (match_operand:ALLI 2 "aarch64_logical_operand" "r<lconst_atomic>"))))
-    (set (match_dup 1)
-     (unspec_volatile:ALLI
-       [(match_dup 1) (match_dup 2)
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 67d6c1d46a6..0c310472a76 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -1,14 +1,14 @@
 # Template build file for 'gcc'
 pkgname=gcc
 _majorver=4.9
-version=${_majorver}.2
-revision=8
+version=${_majorver}.3
+revision=1
 short_desc="The GNU C Compiler"
 maintainer="Juan RP <xtraeme@voidlinux.eu>"
 homepage="http://gcc.gnu.org"
 license="GFDL-1.2, GPL-3, LGPL-2.1"
 distfiles="http://ftp.gnu.org/pub/gnu/gcc/gcc-$version/gcc-$version.tar.bz2"
-checksum=2020c98295856aa13fda0f2f3a4794490757fc24bcca918d52cc8b4917b972dd
+checksum=2332b2a5a321b57508b9031354a8503af6fdfb868b8c1748d33028d100a8b67e
 
 lib32disabled=yes
 bootstrap=yes
@@ -18,8 +18,6 @@ if [ "$CHROOT_READY" ]; then
 fi
 makedepends="zlib-devel libmpc-devel cloog-devel"
 depends="binutils libgcc-${version}_${revision}"
-# mudflap is gone in 4.9
-replaces="libmudflap>=0 libmudflap-devel>=0 chroot-gcc>=0"
 
 subpackages="libgcc libgomp libgomp-devel libatomic libatomic-devel"
 subpackages+=" libitm libitm-devel libssp libssp-devel gcc-c++"
@@ -71,7 +69,7 @@ esac
 
 pre_configure() {
 	case "$XBPS_TARGET_MACHINE" in
-		*-musl) patch -Np1 -i ${FILESDIR}/gcc-${version}-musl.diff;;
+		*-musl) patch -Np1 -i ${FILESDIR}/gcc-4.9.2-musl.diff;;
 	esac
 	# _FORTIFY_SOURCE needs an optimization level.
 	sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {gcc,libiberty}/configure