mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
include/linux/compiler*.h: make compiler-*.h mutually exclusive
Commitcafa0010cd
("Raise the minimum required gcc version to 4.6") recently exposed a brittle part of the build for supporting non-gcc compilers. Both Clang and ICC define __GNUC__, __GNUC_MINOR__, and __GNUC_PATCHLEVEL__ for quick compatibility with code bases that haven't added compiler specific checks for __clang__ or __INTEL_COMPILER. This is brittle, as they happened to get compatibility by posing as a certain version of GCC. This broke when upgrading the minimal version of GCC required to build the kernel, to a version above what ICC and Clang claim to be. Rather than always including compiler-gcc.h then undefining or redefining macros in compiler-intel.h or compiler-clang.h, let's separate out the compiler specific macro definitions into mutually exclusive headers, do more proper compiler detection, and keep shared definitions in compiler_types.h. Fixes:cafa0010cd
("Raise the minimum required gcc version to 4.6") Reported-by: Masahiro Yamada <yamada.masahiro@socionext.com> Suggested-by: Eli Friedman <efriedma@codeaurora.org> Suggested-by: Joe Perches <joe@perches.com> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
899fbc33fd
commit
815f0ddb34
@@ -14,10 +14,6 @@
|
||||
/* Intel ECC compiler doesn't support gcc specific asm stmts.
|
||||
* 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()
|
||||
@@ -38,13 +34,12 @@
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef __HAVE_BUILTIN_BSWAP16__
|
||||
/* icc has this, but it's called _bswap16 */
|
||||
#define __HAVE_BUILTIN_BSWAP16__
|
||||
#define __builtin_bswap16 _bswap16
|
||||
#endif
|
||||
|
||||
/*
|
||||
* icc defines __GNUC__, but does not implement the builtin overflow checkers.
|
||||
/* The following are for compatibility with GCC, from compiler-gcc.h,
|
||||
* and may be redefined here because they should not be shared with other
|
||||
* compilers, like clang.
|
||||
*/
|
||||
#undef COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW
|
||||
#define __visible __attribute__((externally_visible))
|
||||
|
Reference in New Issue
Block a user