News for hackers. Stuff that matters.
Re:Building the Linux kernel with clang by taeric on Thursday September 21, 2017 @10:00AM (#15303446)
Is there a list of checks and analysis that you can't do from a gcc pipeline?
Re:Building the Linux kernel with clang by melkiaur on Thursday September 21, 2017 @11:56AM (#15304732)
the static analyzer, along with all the other checks available from clang-tidy: https://clang.llvm.org/extra/clang-tidy/checks/list.html
Re:Building the Linux kernel with clang by taeric on Thursday September 21, 2017 @07:13PM (#15308105)
I'm surprised there is a static analyzer available for clang that isn't somewhat equivalently offered in gcc toolchains. I guess I'm assuming folks would be using something like Coverity for major static analysis.

Specifically, this sounds like it is just preferring the other toolchain. Are there literally things that don't have equivalents?

Re:Building the Linux kernel with clang by kevindqc on Thursday September 21, 2017 @10:16AM (#15303618)
Maybe he's talking about the sanitizers? eg: https://clang.llvm.org/docs/AddressSanitizer.html
Re:Building the Linux kernel with clang by pksadiq on Thursday September 21, 2017 @10:32AM (#15303783)
Those sanitizers are present in gcc too[0].

[0] https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.h...

Re:Building the Linux kernel with clang by ndesaulniers on Thursday September 21, 2017 @12:05PM (#15304841)
Present != Equal, feature wise. Not by a long shot. At the same conf, one of my friends who develops the sanitizers said it's easier to develop for LLVM, so that's where Dev work is done.
Re:Building the Linux kernel with clang by pksadiq on Thursday September 21, 2017 @12:19PM (#15304992)
> Present != Equal, feature wise.

It is developed by google[0] afaik. The link says it is present in LLVM and gcc. I don't know what makes the difference (may be License?). On the contrary I have felt gcc better for my work. I have been following a clang bug[1] for long and have seen no fix so far.

[0] https://github.com/google/sanitizers/wiki/AddressSanitizer

[1] https://bugs.llvm.org/show_bug.cgi?id=23910

Re:Building the Linux kernel with clang by pebers on Thursday September 21, 2017 @01:12PM (#15305502)
Clang has better support for plugins and calling it as a library; that sort of thing was resisted by GCC. Google has a bunch of large-scale tooling based on the Clang frontend which AFAIK wouldn't be possible with GCC.
Re:Building the Linux kernel with clang by jcelerier on Thursday September 21, 2017 @02:39PM (#15306253)
sure sure, but today (and even two years ago) you can add -fsanitize={address,undefined,etc} on both clang and gcc. So this does not answer the question.
Re:Building the Linux kernel with clang by kevindqc on Thursday September 21, 2017 @10:58AM (#15304068)
ah! thanks
Re:Building the Linux kernel with clang by albinofrenchy on Thursday September 21, 2017 @11:16AM (#15304261)
Sanitizers are run-time tools; I'd be surprised if any of them worked out of the box with the kernel.

Address sanitizer was "ported" to the kernel a while ago; not sure if UBSAN is or will be in the future.

Re:Building the Linux kernel with clang by ndesaulniers on Thursday September 21, 2017 @12:06PM (#15304849)
There are kernel versions. KASAN, KUBSAN, KMSAN.
Re:Building the Linux kernel with clang by sanxiyn on Thursday September 21, 2017 @10:35AM (#15303819)
All sanitizers are also available in GCC, so no.
Re:Building the Linux kernel with clang by bitcharmer on Thursday September 21, 2017 @12:02PM (#15304803)
Are you sure? Last time I checked the ones llvm had and gcc did not were:

Dynamic alloca overflow detection

Symbol size changing for global variables

Adaptive global redzone sizes

Invalid pointer pairs detection

Support for no_sanitize attribute

Support for dead stripping of globals on Linux

I might be out of date on some or even all, so please correct me where I'm wrong. Thank you in advance.

Re:Building the Linux kernel with clang by ndesaulniers on Thursday September 21, 2017 @12:06PM (#15304853)
Wrong. Not all kernel versions.