]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/u-boot-support-gcc-6.patch
kernel: update to 4.14.29
[ipfire-2.x.git] / src / patches / u-boot-support-gcc-6.patch
CommitLineData
63ba176b
MT
1diff --git a/include/linux/compiler-gcc6.h b/include/linux/compiler-gcc6.h
2new file mode 100644
3index 0000000..622117b
4--- /dev/null
5+++ b/include/linux/compiler-gcc6.h
6@@ -0,0 +1,65 @@
7+#ifndef __LINUX_COMPILER_H
8+#error "Please don't include <linux/compiler-gcc6.h> directly, include <linux/compiler.h> instead."
9+#endif
10+
11+#define __used __attribute__((__used__))
12+#define __must_check __attribute__((warn_unused_result))
13+#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
14+
15+/* Mark functions as cold. gcc will assume any path leading to a call
16+ to them will be unlikely. This means a lot of manual unlikely()s
17+ are unnecessary now for any paths leading to the usual suspects
18+ like BUG(), printk(), panic() etc. [but let's keep them for now for
19+ older compilers]
20+
21+ Early snapshots of gcc 4.3 don't support this and we can't detect this
22+ in the preprocessor, but we can live with this because they're unreleased.
23+ Maketime probing would be overkill here.
24+
25+ gcc also has a __attribute__((__hot__)) to move hot functions into
26+ a special section, but I don't see any sense in this right now in
27+ the kernel context */
28+#define __cold __attribute__((__cold__))
29+
30+#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
31+
32+#ifndef __CHECKER__
33+# define __compiletime_warning(message) __attribute__((warning(message)))
34+# define __compiletime_error(message) __attribute__((error(message)))
35+#endif /* __CHECKER__ */
36+
37+/*
38+ * Mark a position in code as unreachable. This can be used to
39+ * suppress control flow warnings after asm blocks that transfer
40+ * control elsewhere.
41+ *
42+ * Early snapshots of gcc 4.5 don't support this and we can't detect
43+ * this in the preprocessor, but we can live with this because they're
44+ * unreleased. Really, we need to have autoconf for the kernel.
45+ */
46+#define unreachable() __builtin_unreachable()
47+
48+/* Mark a function definition as prohibited from being cloned. */
49+#define __noclone __attribute__((__noclone__))
50+
51+/*
52+ * Tell the optimizer that something else uses this function or variable.
53+ */
54+#define __visible __attribute__((externally_visible))
55+
56+/*
57+ * GCC 'asm goto' miscompiles certain code sequences:
58+ *
59+ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
60+ *
61+ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
62+ *
63+ * (asm goto is automatically volatile - the naming reflects this.)
64+ */
65+#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
66+
67+#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
68+#define __HAVE_BUILTIN_BSWAP32__
69+#define __HAVE_BUILTIN_BSWAP64__
70+#define __HAVE_BUILTIN_BSWAP16__
71+#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */