Skip to contentSkip to conversation

build: update compiler*.h to newest versions

PATCH Applied Alexey Galakhov 2 participants 2 messages Jul 6, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 build: update compiler*.h to newest versions

This adds the support for gcc 5.x and clang.

---
 include/linux/compiler-clang.h |  12 +++
 include/linux/compiler-gcc.h   | 227 +++++++++++++++++++++++++++++++++++------
 include/linux/compiler-gcc3.h  |  31 ------
 include/linux/compiler-gcc4.h  |  61 -----------
 include/linux/compiler-intel.h |  16 ++-
 include/linux/compiler.h       |  99 ++++++++++++++++--
 6 files changed, 315 insertions(+), 131 deletions(-)
 create mode 100644 include/linux/compiler-clang.h
 delete mode 100644 include/linux/compiler-gcc3.h
 delete mode 100644 include/linux/compiler-gcc4.h
include/linux/compiler-clang.h new file +12 -0
new file mode 100644
index 0000000..d1e49d5
@@ -0,0 +1,12 @@
+#ifndef __LINUX_COMPILER_H
+#error "Please don't include <linux/compiler-clang.h> directly, include <linux/compiler.h> instead."
+#endif
+
+/* Some compiler specific definitions are overwritten here
+ * for Clang compiler
+ */
+
+#ifdef uninitialized_var
+#undef uninitialized_var
+#define uninitialized_var(x) x = *(&(x))
+#endif
include/linux/compiler-gcc.h +195 -32

260 lines not on this page · raw message

include/linux/compiler-gcc3.h deleted +0 -31
deleted file mode 100644
index b721129..0000000
@@ -1,31 +0,0 @@
-#ifndef __LINUX_COMPILER_H
-#error "Please don't include <linux/compiler-gcc3.h> directly, include <linux/compiler.h> instead."
-#endif
-
-#if __GNUC_MINOR__ < 2
-# error Sorry, your compiler is too old - please upgrade it.
-#endif
-
-#if __GNUC_MINOR__ >= 3
-# define __used			__attribute__((__used__))
-#else
-# define __used			__attribute__((__unused__))
-#endif
-
-#if __GNUC_MINOR__ >= 4
-#define __must_check		__attribute__((warn_unused_result))
-#endif
-
-#ifdef CONFIG_GCOV_KERNEL
-# if __GNUC_MINOR__ < 4
-#   error "GCOV profiling support for gcc versions below 3.4 not included"
-# endif /* __GNUC_MINOR__ */
-#endif /* CONFIG_GCOV_KERNEL */
-
-/*
- * A trick to suppress uninitialized variable warning without generating any
- * code
- */
-#define uninitialized_var(x) x = x
-
-#define __always_inline		inline __attribute__((always_inline))
include/linux/compiler-gcc4.h deleted +0 -61

61 lines not on this page · raw message

include/linux/compiler-intel.h +15 -1
index d8e636e..d4c7113 100644
@@ -14,18 +14,32 @@
  * It uses intrinsics to do the equivalent things.
  */
 #undef barrier
+#undef barrier_data
 #undef RELOC_HIDE
+#undef OPTIMIZER_HIDE_VAR
 
 #define barrier() __memory_barrier()
+#define barrier_data(ptr) barrier()
 
 #define RELOC_HIDE(ptr, off)					\
   ({ unsigned long __ptr;					\
      __ptr = (unsigned long) (ptr);				\
     (typeof(ptr)) (__ptr + (off)); })
 
+/* This should act as an optimization barrier on var.
+ * Given that this compiler does not have inline assembly, a compiler barrier
+ * is the best we can do.
+ */
+#define OPTIMIZER_HIDE_VAR(var) barrier()
+
 /* Intel ECC compiler doesn't support __builtin_types_compatible_p() */
 #define __must_be_array(a) 0
 
 #endif
 
-#define uninitialized_var(x) x
+#ifndef __HAVE_BUILTIN_BSWAP16__
+/* icc has this, but it's called _bswap16 */
+#define __HAVE_BUILTIN_BSWAP16__
+#define __builtin_bswap16 _bswap16
+#endif
+
include/linux/compiler.h +93 -6

166 lines not on this page · raw message

Signature · 7 lines
2.4.5


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#1 lore raw
Quoted 14 lines · Alexey Galakhov

This adds the support for gcc 5.x and clang.

---
 include/linux/compiler-clang.h |  12 +++
 include/linux/compiler-gcc.h   | 227 +++++++++++++++++++++++++++++++++++------
 include/linux/compiler-gcc3.h  |  31 ------
 include/linux/compiler-gcc4.h  |  61 -----------
 include/linux/compiler-intel.h |  16 ++-
 include/linux/compiler.h       |  99 ++++++++++++++++--
 6 files changed, 315 insertions(+), 131 deletions(-)
 create mode 100644 include/linux/compiler-clang.h
 delete mode 100644 include/linux/compiler-gcc3.h
 delete mode 100644 include/linux/compiler-gcc4.h

Applied, thanks

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox