Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 565cbdc2 authored by Mark Charlebois's avatar Mark Charlebois Committed by Behan Webster
Browse files

LLVMLinux: Add support for clang to compiler.h and new compiler-clang.h



Add a compiler-clang.h file to add specific macros needed for compiling the
kernel with clang.

Initially the only override required is the macro for silencing the
compiler for a purposefully uninintialized variable.

Author: Mark Charlebois <charlebm@gmail.com>
Signed-off-by: default avatarMark Charlebois <charlebm@gmail.com>
Signed-off-by: default avatarBehan Webster <behanw@converseincode.com>
parent aa93685a
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
#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
+7 −0
Original line number Diff line number Diff line
@@ -63,6 +63,13 @@ extern void __chk_io_ptr(const volatile void __iomem *);
# include <linux/compiler-intel.h>
#endif

/* Clang compiler defines __GNUC__. So we will overwrite implementations
 * coming from above header files here
 */
#ifdef __clang__
#include <linux/compiler-clang.h>
#endif

/*
 * Generic compiler-dependent macros required for kernel
 * build go below this comment. Actual compiler/compiler version