nickdesaulniers added a comment.
Kernel patch:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=815f0ddb346c196018d4d8f8f55c12b83da1de3f
Thanks Eli and Richard, I appreciate it.
Repository:
rC Clang
https://reviews.llvm.org/D51011
nickdesaulniers added a comment.
Thanks Eli. I wholeheartedly prefer feature detection to explicit version
checks. One thing that makes this hard is the lack of __has_attribute in gcc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66970.
Repository:
rC Clang
https://reviews.llvm.org/D51011
efriedma added a comment.
I'd suggest something like this, if you really need to detect the compiler:
#if defined(__clang__)
// clang
#elif defined(__INTEL_COMPILER)
// icc
#elif defined(__GNUC__)
// gcc
#else
#error "Unknown compiler"
#endif
> Regarding the glibc headers, do
nickdesaulniers added a comment.
Richard,
Thanks for the review, context, and suggestions. I appreciate it.
> Can you instead change the kernel to require GCC >= 4.6 or some suitable
> version of Clang?
Can you help me create an accurate C preprocessor check that the compiler in
use is actual
rsmith added a comment.
Another possibility would be to add a command-line argument to set the version
of GCC that clang pretends to be. We have a similar mechanism for our MSVC
compatibility mode already.
Repository:
rC Clang
https://reviews.llvm.org/D51011
_
rsmith added a comment.
We are not fully compatible with any version of GCC later than 4.2, as we do
not implement `__builtin_va_arg_pack` / `__builtin_va_arg_pack_len`. These
builtins are used by the glibc headers if we claim to be GCC >= 4.3 (at least
according to
http://clang.llvm.org/docs/
nickdesaulniers created this revision.
nickdesaulniers added a reviewer: aaron.ballman.
Herald added a subscriber: cfe-commits.
Building the Linux kernel with clang is now broken as of commit
cafa0010cd51 ("Raise the minimum required gcc version to 4.6").
We were getting lucky that Clang previous