include/linux/compiler*.h: make compiler-*.h mutually exclusive
Commit cafa0010 ("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: cafa0010 ("Raise the minimum required gcc version to 4.6") Reported-by...
Showing
- arch/arm/kernel/asm-offsets.c 1 addition, 12 deletionsarch/arm/kernel/asm-offsets.c
- drivers/gpu/drm/i915/i915_utils.h 1 addition, 1 deletiondrivers/gpu/drm/i915/i915_utils.h
- drivers/watchdog/kempld_wdt.c 0 additions, 5 deletionsdrivers/watchdog/kempld_wdt.c
- include/linux/compiler-clang.h 9 additions, 11 deletionsinclude/linux/compiler-clang.h
- include/linux/compiler-gcc.h 0 additions, 88 deletionsinclude/linux/compiler-gcc.h
- include/linux/compiler-intel.h 4 additions, 9 deletionsinclude/linux/compiler-intel.h
- include/linux/compiler_types.h 114 additions, 124 deletionsinclude/linux/compiler_types.h
- mm/ksm.c 2 additions, 2 deletionsmm/ksm.c
- mm/migrate.c 2 additions, 1 deletionmm/migrate.c
Please register or sign in to comment