summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaura Abbott <labbott@fedoraproject.org>2017-02-23 10:45:40 -0800
committerLaura Abbott <labbott@fedoraproject.org>2017-02-23 10:45:40 -0800
commit9f5adbcc1efbcb1bc35f881e8b386d1e1d69d43e (patch)
tree01cc1245d1a8e437d8c9622f974be6be7cd6c94a
parentc796f87d68dd7d9f45c4318d82a511014ec9457e (diff)
downloadkernel-9f5adbcc1efbcb1bc35f881e8b386d1e1d69d43e.tar.gz
kernel-9f5adbcc1efbcb1bc35f881e8b386d1e1d69d43e.tar.xz
kernel-9f5adbcc1efbcb1bc35f881e8b386d1e1d69d43e.zip
Bring back gcc7 workaround
Other parts of the tree are hitting the same issue as arm64 did. Bring back the workaround until they all get fixed up.
-rw-r--r--0001-Work-around-for-gcc7-and-arm64.patch62
-rw-r--r--kernel.spec4
2 files changed, 66 insertions, 0 deletions
diff --git a/0001-Work-around-for-gcc7-and-arm64.patch b/0001-Work-around-for-gcc7-and-arm64.patch
new file mode 100644
index 000000000..88f40be5d
--- /dev/null
+++ b/0001-Work-around-for-gcc7-and-arm64.patch
@@ -0,0 +1,62 @@
+From 975dcf140bd307b431aff7b6d671155c796cfe5e Mon Sep 17 00:00:00 2001
+From: Laura Abbott <labbott@redhat.com>
+Date: Sat, 28 Jan 2017 16:13:49 +0100
+Subject: [PATCH] Work around for gcc7 and arm64
+
+Originally proposed by Will Deacon <will.deacon@arm.com>
+
+http://lists.infradead.org/pipermail/linux-arm-kernel/2016-October/462224.html
+
+Signed-off-by: Laura Abbott <labbott@redhat.com>
+---
+ include/linux/log2.h | 13 ++-----------
+ 1 file changed, 2 insertions(+), 11 deletions(-)
+
+diff --git a/include/linux/log2.h b/include/linux/log2.h
+index fd7ff3d91e6a..1ab22b79681e 100644
+--- a/include/linux/log2.h
++++ b/include/linux/log2.h
+@@ -16,12 +16,6 @@
+ #include <linux/bitops.h>
+
+ /*
+- * deal with unrepresentable constant logarithms
+- */
+-extern __attribute__((const, noreturn))
+-int ____ilog2_NaN(void);
+-
+-/*
+ * non-constant log of base 2 calculators
+ * - the arch may override these in asm/bitops.h if they can be implemented
+ * more efficiently than using fls() and fls64()
+@@ -85,7 +79,7 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
+ #define ilog2(n) \
+ ( \
+ __builtin_constant_p(n) ? ( \
+- (n) < 1 ? ____ilog2_NaN() : \
++ (n) < 1 ? 0 : \
+ (n) & (1ULL << 63) ? 63 : \
+ (n) & (1ULL << 62) ? 62 : \
+ (n) & (1ULL << 61) ? 61 : \
+@@ -149,9 +143,7 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
+ (n) & (1ULL << 3) ? 3 : \
+ (n) & (1ULL << 2) ? 2 : \
+ (n) & (1ULL << 1) ? 1 : \
+- (n) & (1ULL << 0) ? 0 : \
+- ____ilog2_NaN() \
+- ) : \
++ 0 ) : \
+ (sizeof(n) <= 4) ? \
+ __ilog2_u32(n) : \
+ __ilog2_u64(n) \
+@@ -194,7 +186,6 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
+ * @n: parameter
+ *
+ * The first few values calculated by this routine:
+- * ob2(0) = 0
+ * ob2(1) = 0
+ * ob2(2) = 1
+ * ob2(3) = 2
+--
+2.11.0
+
diff --git a/kernel.spec b/kernel.spec
index d2908699d..152b83651 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -595,6 +595,10 @@ Patch849: 0001-iio-Use-event-header-from-kernel-tree.patch
# Fix build issue with armada_trace
Patch851: Armada-trace-build-fix.patch
+# Still other instances of this bug floating around
+Patch853: 0001-Work-around-for-gcc7-and-arm64.patch
+
+
# END OF PATCH DEFINITIONS
%endif