• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/board/roseapplepi/patches/linux/0005-compiler-gcc-integrate-the-various-compiler-gcc-345-.patch
Peter KorsgaardPeter Korsgaard committed dc30db3cf1f20 Jun 2017
Raw file
Source viewDiff to previous
xxxxxxxxxx
-#error "Please don't include <linux/compiler-gcc3.h> directly, include <linux/compiler.h> instead."
 
1
From 21be6b635320321216dde9201fa57a3aed60ee12 Mon Sep 17 00:00:00 2001
2
From: Joe Perches <joe@perches.com>
3
Date: Thu, 25 Jun 2015 15:01:02 -0700
4
Subject: [PATCH] compiler-gcc: integrate the various compiler-gcc[345].h files
5
​
6
As gcc major version numbers are going to advance rather rapidly in the
7
future, there's no real value in separate files for each compiler
8
version.
9
​
10
Deduplicate some of the macros #defined in each file too.
11
​
12
Neaten comments using normal kernel commenting style.
13
​
14
Signed-off-by: Joe Perches <joe@perches.com>
15
Cc: Andi Kleen <andi@firstfloor.org>
16
Cc: Michal Marek <mmarek@suse.cz>
17
Cc: Segher Boessenkool <segher@kernel.crashing.org>
18
Cc: Sasha Levin <levinsasha928@gmail.com>
19
Cc: Anton Blanchard <anton@samba.org>
20
Cc: Alan Modra <amodra@gmail.com>
21
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
22
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
23
(cherry picked from commit cb984d101b30eb7478d32df56a0023e4603cba7f)
24
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
25
---
26
 include/linux/compiler-gcc.h  | 120 ++++++++++++++++++++++++++++++++++++++++--
27
 include/linux/compiler-gcc3.h |  23 --------
28
 include/linux/compiler-gcc4.h |  88 -------------------------------
29
 include/linux/compiler-gcc5.h |  66 -----------------------
30
 4 files changed, 116 insertions(+), 181 deletions(-)
31
 delete mode 100644 include/linux/compiler-gcc3.h
32
 delete mode 100644 include/linux/compiler-gcc4.h
33
 delete mode 100644 include/linux/compiler-gcc5.h
34
​
35
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
36
index 24545cd90a25..0c5d746850c2 100644
37
--- a/include/linux/compiler-gcc.h
38
+++ b/include/linux/compiler-gcc.h
39
@@ -97,10 +97,122 @@
40
 #define __maybe_unused         __attribute__((unused))
41
 #define __always_unused            __attribute__((unused))
42
 
43
-#define __gcc_header(x) #x
44
-#define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h)
45
-#define gcc_header(x) _gcc_header(x)
46
-#include gcc_header(__GNUC__)
47
+/* gcc version specific checks */
48
+
49
+#if GCC_VERSION < 30200
50
+# error Sorry, your compiler is too old - please upgrade it.
51
+#endif
52
+
53
+#if GCC_VERSION < 30300
54
+# define __used            __attribute__((__unused__))
55
+#else
56
+# define __used            __attribute__((__used__))
57
+#endif
58
+
59
+#ifdef CONFIG_GCOV_KERNEL
60
+# if GCC_VERSION < 30400
61
+#   error "GCOV profiling support for gcc versions below 3.4 not included"
62
+# endif /* __GNUC_MINOR__ */
63
+#endif /* CONFIG_GCOV_KERNEL */
64
+
65
+#if GCC_VERSION >= 30400
66
+#define __must_check       __attribute__((warn_unused_result))
67
+#endif
68
+
69
+#if GCC_VERSION >= 40000
70
+
71
+/* GCC 4.1.[01] miscompiles __weak */
72
+#ifdef __KERNEL__
73
+# if GCC_VERSION >= 40100 &&  GCC_VERSION <= 40101
74
+#  error Your version of gcc miscompiles the __weak directive
75
+# endif
76
+#endif
77
+
78
+#define __used         __attribute__((__used__))
79
+#define __compiler_offsetof(a, b)                  \
80
+   __builtin_offsetof(a, b)
81
+
82
+#if GCC_VERSION >= 40100 && GCC_VERSION < 40600
83
+# define __compiletime_object_size(obj) __builtin_object_size(obj, 0)
84
+#endif
85
+
86
+#if GCC_VERSION >= 40300
87
+/* Mark functions as cold. gcc will assume any path leading to a call
88
+ * to them will be unlikely.  This means a lot of manual unlikely()s
89
+ * are unnecessary now for any paths leading to the usual suspects
90
+ * like BUG(), printk(), panic() etc. [but let's keep them for now for
91
+ * older compilers]
92
+ *
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.