News
Zack's Kernel News
Chronicler Zack Brown reports on compiler optimizations and compatibility.
Compiler Optimizations and Compatibility
The relationship between the Linux kernel project and the other projects it depends on – like the various C compilers, or even standards bodies themselves, like POSIX – is odd and convoluted. For starters, those projects often depend on Linux, too. In the event of a dispute, who wins? In general, that question is answered peacefully, by the Linux kernel having certain minimum version requirements for compilers and identifying specific later compiler versions as unsupported on an as-needed basis. This at least keeps the world moving smoothly.
This time the conversation didn't involve a dispute between the kernel and the compiler folks, but it did involve finding a way for the kernel to work around compiler issues.
The whole thing started when Marco Elver from Google enabled the Clang compiler's thread-safety analysis feature, which tries to track the way the kernel locks certain resources so they can be used by one process and then unlocks them when that process has finished. Thread handling is an insanely difficult thing to debug. It also needs to run really fast, because it underpins the kernel's ability to do many things at once without completely trashing all our data or making us wait seconds for the screen to update. So tools like Clang try to do as much as they can to automate testing.
[...]
Buy this article as PDF
(incl. VAT)