diff --git a/patches/gcc/4.8.0/010-libgo-do-not-redefine-CPU_COUNT.patch b/patches/gcc/4.8.0/010-libgo-do-not-redefine-CPU_COUNT.patch
new file mode 100644
index 0000000..dc9817e
--- /dev/null
+++ b/patches/gcc/4.8.0/010-libgo-do-not-redefine-CPU_COUNT.patch
@@ -0,0 +1,32 @@
+From fe9d1f9b730f653039868515000a02cbb73e8941 Mon Sep 17 00:00:00 2001
+From: Bryan Hundven <bryanhundven@gmail.com>
+Date: Thu, 25 Sep 2014 18:54:06 -0700
+Subject: [PATCH] libgo/runtime: Only define CPU_COUNT if not already defined
+
+Modern LIBCs #define CPU_COUNT and CPU_COUNT_S in sched.h.
+Rather then checking the version or brand of LIBC, just check if
+CPU_COUNT is defined before redefining it.
+
+Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
+---
+ libgo/runtime/getncpu-linux.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libgo/runtime/getncpu-linux.c b/libgo/runtime/getncpu-linux.c
+index 0122b77..4aab58f 100644
+--- a/libgo/runtime/getncpu-linux.c
++++ b/libgo/runtime/getncpu-linux.c
+@@ -5,8 +5,8 @@
+ #include <features.h>
+ #include <sched.h>
+ 
+-// CPU_COUNT is only provided by glibc 2.6 or higher
+-#if !defined(__GLIBC_PREREQ) || !__GLIBC_PREREQ(2, 6)
++// Define CPU_COUNT if it isn't already.
++#if !defined(CPU_COUNT)
+ #define CPU_COUNT(set) _CPU_COUNT((unsigned int *)(set), sizeof(*(set))/sizeof(unsigned int))
+ static int _CPU_COUNT(unsigned int *set, size_t len) {
+ 	int cnt;
+-- 
+2.1.1
+
diff --git a/patches/gcc/4.8.1/010-libgo-do-not-redefine-CPU_COUNT.patch b/patches/gcc/4.8.1/010-libgo-do-not-redefine-CPU_COUNT.patch
new file mode 100644
index 0000000..dc9817e
--- /dev/null
+++ b/patches/gcc/4.8.1/010-libgo-do-not-redefine-CPU_COUNT.patch
@@ -0,0 +1,32 @@
+From fe9d1f9b730f653039868515000a02cbb73e8941 Mon Sep 17 00:00:00 2001
+From: Bryan Hundven <bryanhundven@gmail.com>
+Date: Thu, 25 Sep 2014 18:54:06 -0700
+Subject: [PATCH] libgo/runtime: Only define CPU_COUNT if not already defined
+
+Modern LIBCs #define CPU_COUNT and CPU_COUNT_S in sched.h.
+Rather then checking the version or brand of LIBC, just check if
+CPU_COUNT is defined before redefining it.
+
+Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
+---
+ libgo/runtime/getncpu-linux.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libgo/runtime/getncpu-linux.c b/libgo/runtime/getncpu-linux.c
+index 0122b77..4aab58f 100644
+--- a/libgo/runtime/getncpu-linux.c
++++ b/libgo/runtime/getncpu-linux.c
+@@ -5,8 +5,8 @@
+ #include <features.h>
+ #include <sched.h>
+ 
+-// CPU_COUNT is only provided by glibc 2.6 or higher
+-#if !defined(__GLIBC_PREREQ) || !__GLIBC_PREREQ(2, 6)
++// Define CPU_COUNT if it isn't already.
++#if !defined(CPU_COUNT)
+ #define CPU_COUNT(set) _CPU_COUNT((unsigned int *)(set), sizeof(*(set))/sizeof(unsigned int))
+ static int _CPU_COUNT(unsigned int *set, size_t len) {
+ 	int cnt;
+-- 
+2.1.1
+
diff --git a/patches/gcc/4.8.2/010-libgo-do-not-redefine-CPU_COUNT.patch b/patches/gcc/4.8.2/010-libgo-do-not-redefine-CPU_COUNT.patch
new file mode 100644
index 0000000..dc9817e
--- /dev/null
+++ b/patches/gcc/4.8.2/010-libgo-do-not-redefine-CPU_COUNT.patch
@@ -0,0 +1,32 @@
+From fe9d1f9b730f653039868515000a02cbb73e8941 Mon Sep 17 00:00:00 2001
+From: Bryan Hundven <bryanhundven@gmail.com>
+Date: Thu, 25 Sep 2014 18:54:06 -0700
+Subject: [PATCH] libgo/runtime: Only define CPU_COUNT if not already defined
+
+Modern LIBCs #define CPU_COUNT and CPU_COUNT_S in sched.h.
+Rather then checking the version or brand of LIBC, just check if
+CPU_COUNT is defined before redefining it.
+
+Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
+---
+ libgo/runtime/getncpu-linux.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libgo/runtime/getncpu-linux.c b/libgo/runtime/getncpu-linux.c
+index 0122b77..4aab58f 100644
+--- a/libgo/runtime/getncpu-linux.c
++++ b/libgo/runtime/getncpu-linux.c
+@@ -5,8 +5,8 @@
+ #include <features.h>
+ #include <sched.h>
+ 
+-// CPU_COUNT is only provided by glibc 2.6 or higher
+-#if !defined(__GLIBC_PREREQ) || !__GLIBC_PREREQ(2, 6)
++// Define CPU_COUNT if it isn't already.
++#if !defined(CPU_COUNT)
+ #define CPU_COUNT(set) _CPU_COUNT((unsigned int *)(set), sizeof(*(set))/sizeof(unsigned int))
+ static int _CPU_COUNT(unsigned int *set, size_t len) {
+ 	int cnt;
+-- 
+2.1.1
+
diff --git a/patches/gcc/4.8.3/010-libgo-do-not-redefine-CPU_COUNT.patch b/patches/gcc/4.8.3/010-libgo-do-not-redefine-CPU_COUNT.patch
new file mode 100644
index 0000000..dc9817e
--- /dev/null
+++ b/patches/gcc/4.8.3/010-libgo-do-not-redefine-CPU_COUNT.patch
@@ -0,0 +1,32 @@
+From fe9d1f9b730f653039868515000a02cbb73e8941 Mon Sep 17 00:00:00 2001
+From: Bryan Hundven <bryanhundven@gmail.com>
+Date: Thu, 25 Sep 2014 18:54:06 -0700
+Subject: [PATCH] libgo/runtime: Only define CPU_COUNT if not already defined
+
+Modern LIBCs #define CPU_COUNT and CPU_COUNT_S in sched.h.
+Rather then checking the version or brand of LIBC, just check if
+CPU_COUNT is defined before redefining it.
+
+Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
+---
+ libgo/runtime/getncpu-linux.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libgo/runtime/getncpu-linux.c b/libgo/runtime/getncpu-linux.c
+index 0122b77..4aab58f 100644
+--- a/libgo/runtime/getncpu-linux.c
++++ b/libgo/runtime/getncpu-linux.c
+@@ -5,8 +5,8 @@
+ #include <features.h>
+ #include <sched.h>
+ 
+-// CPU_COUNT is only provided by glibc 2.6 or higher
+-#if !defined(__GLIBC_PREREQ) || !__GLIBC_PREREQ(2, 6)
++// Define CPU_COUNT if it isn't already.
++#if !defined(CPU_COUNT)
+ #define CPU_COUNT(set) _CPU_COUNT((unsigned int *)(set), sizeof(*(set))/sizeof(unsigned int))
+ static int _CPU_COUNT(unsigned int *set, size_t len) {
+ 	int cnt;
+-- 
+2.1.1
+
diff --git a/patches/gcc/4.9.0/010-libgo-do-not-redefine-CPU_COUNT.patch b/patches/gcc/4.9.0/010-libgo-do-not-redefine-CPU_COUNT.patch
new file mode 100644
index 0000000..dc9817e
--- /dev/null
+++ b/patches/gcc/4.9.0/010-libgo-do-not-redefine-CPU_COUNT.patch
@@ -0,0 +1,32 @@
+From fe9d1f9b730f653039868515000a02cbb73e8941 Mon Sep 17 00:00:00 2001
+From: Bryan Hundven <bryanhundven@gmail.com>
+Date: Thu, 25 Sep 2014 18:54:06 -0700
+Subject: [PATCH] libgo/runtime: Only define CPU_COUNT if not already defined
+
+Modern LIBCs #define CPU_COUNT and CPU_COUNT_S in sched.h.
+Rather then checking the version or brand of LIBC, just check if
+CPU_COUNT is defined before redefining it.
+
+Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
+---
+ libgo/runtime/getncpu-linux.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libgo/runtime/getncpu-linux.c b/libgo/runtime/getncpu-linux.c
+index 0122b77..4aab58f 100644
+--- a/libgo/runtime/getncpu-linux.c
++++ b/libgo/runtime/getncpu-linux.c
+@@ -5,8 +5,8 @@
+ #include <features.h>
+ #include <sched.h>
+ 
+-// CPU_COUNT is only provided by glibc 2.6 or higher
+-#if !defined(__GLIBC_PREREQ) || !__GLIBC_PREREQ(2, 6)
++// Define CPU_COUNT if it isn't already.
++#if !defined(CPU_COUNT)
+ #define CPU_COUNT(set) _CPU_COUNT((unsigned int *)(set), sizeof(*(set))/sizeof(unsigned int))
+ static int _CPU_COUNT(unsigned int *set, size_t len) {
+ 	int cnt;
+-- 
+2.1.1
+
diff --git a/patches/gcc/4.9.1/010-libgo-do-not-redefine-CPU_COUNT.patch b/patches/gcc/4.9.1/010-libgo-do-not-redefine-CPU_COUNT.patch
new file mode 100644
index 0000000..dc9817e
--- /dev/null
+++ b/patches/gcc/4.9.1/010-libgo-do-not-redefine-CPU_COUNT.patch
@@ -0,0 +1,32 @@
+From fe9d1f9b730f653039868515000a02cbb73e8941 Mon Sep 17 00:00:00 2001
+From: Bryan Hundven <bryanhundven@gmail.com>
+Date: Thu, 25 Sep 2014 18:54:06 -0700
+Subject: [PATCH] libgo/runtime: Only define CPU_COUNT if not already defined
+
+Modern LIBCs #define CPU_COUNT and CPU_COUNT_S in sched.h.
+Rather then checking the version or brand of LIBC, just check if
+CPU_COUNT is defined before redefining it.
+
+Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
+---
+ libgo/runtime/getncpu-linux.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libgo/runtime/getncpu-linux.c b/libgo/runtime/getncpu-linux.c
+index 0122b77..4aab58f 100644
+--- a/libgo/runtime/getncpu-linux.c
++++ b/libgo/runtime/getncpu-linux.c
+@@ -5,8 +5,8 @@
+ #include <features.h>
+ #include <sched.h>
+ 
+-// CPU_COUNT is only provided by glibc 2.6 or higher
+-#if !defined(__GLIBC_PREREQ) || !__GLIBC_PREREQ(2, 6)
++// Define CPU_COUNT if it isn't already.
++#if !defined(CPU_COUNT)
+ #define CPU_COUNT(set) _CPU_COUNT((unsigned int *)(set), sizeof(*(set))/sizeof(unsigned int))
+ static int _CPU_COUNT(unsigned int *set, size_t len) {
+ 	int cnt;
+-- 
+2.1.1
+
