LWN: Comments on "The UAPI header file split" https://lwn.net/Articles/507794/ This is a special feed containing comments posted to the individual LWN article titled "The UAPI header file split". en-us Tue, 23 Sep 2025 21:39:16 +0000 Tue, 23 Sep 2025 21:39:16 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net The UAPI header file split https://lwn.net/Articles/781193/ https://lwn.net/Articles/781193/ anuj1560 <div class="FormattedComment"> In file uapi/linux/i2c.h , it includes linux/types.h. Is this right ? I think it should include uapi/linux/types.h.<br> </div> Mon, 04 Mar 2019 14:08:31 +0000 The UAPI header file split https://lwn.net/Articles/509561/ https://lwn.net/Articles/509561/ marcH <div class="FormattedComment"> <font class="QuotedText">&gt; Sometimes, however, the sheer size of the code base means that refactoring becomes a formidable task—one that verges on being impossible if attempted manually. At that point, an enterprising kernel hacker may well turn to writing code that refactors the [kernel] code. </font><br> <p> For Java such code has been written already: (at least) Eclipse does this on a routine basis.<br> <p> Of course this is a much easier problem since Java has no pre-processor. I'm still impressed seeing it in action.<br> <p> </div> Fri, 03 Aug 2012 13:15:15 +0000 The UAPI header file split https://lwn.net/Articles/508700/ https://lwn.net/Articles/508700/ jake <div class="FormattedComment"> :)<br> <p> fixed now ...<br> <p> jake<br> </div> Sun, 29 Jul 2012 16:40:02 +0000 The UAPI header file split https://lwn.net/Articles/508581/ https://lwn.net/Articles/508581/ ranmachan <div class="FormattedComment"> Typo: "[Users-pace definitions]" slowed down for users who can't keep up with Kernels-pace. :)<br> </div> Sat, 28 Jul 2012 17:39:01 +0000 Checking same object files produced https://lwn.net/Articles/508383/ https://lwn.net/Articles/508383/ nix <div class="FormattedComment"> Given that the only #defines this code should be altering are those related to multiple-inclusion guards, I think we could describe any such ordering changes as a compiler bug. That is not to say that no such bugs exist, but it is likely that they'd also lead to inconsistent code generation when faced with identical output, and cause failures in GCC bootstrap comparison. (This has happened before, e.g. with optimizations depending on the ordering of pieces of compiler state in hash tables -- the infamous 'hashing by <br> address' bug class -- and that sort of thing.)<br> </div> Fri, 27 Jul 2012 11:17:43 +0000 The UAPI header file split https://lwn.net/Articles/508357/ https://lwn.net/Articles/508357/ dlang <div class="FormattedComment"> sounds like a good topic for discussion at the kernel summit.<br> </div> Fri, 27 Jul 2012 04:32:36 +0000 The UAPI header file split https://lwn.net/Articles/508296/ https://lwn.net/Articles/508296/ dhowells <div class="FormattedComment"> This patch series is just step 1...<br> </div> Thu, 26 Jul 2012 20:30:08 +0000 The UAPI header file split https://lwn.net/Articles/508289/ https://lwn.net/Articles/508289/ krisis <div class="FormattedComment"> What I was getting at, was that you could use this refactoring to get rid of some implicit includes and reduce the compile time.<br> <p> After thinking about it, I've realized that it would be a massive undertaking, added to the already massive undertaking that this patch series is.<br> <p> <p> </div> Thu, 26 Jul 2012 20:03:28 +0000 The UAPI header file split https://lwn.net/Articles/508230/ https://lwn.net/Articles/508230/ dhowells <div class="FormattedComment"> <font class="QuotedText">&gt; The UAPI files seem to include the kernel headers. </font><br> <p> Yes. That is so - *if* you're using them for a kernel build. If you're using them for a userspace build, they only see each other.<br> <p> It actually mirrors the way things work now. Just think of the way such kernel header files are usually constructed: a bunch of #includes that get put into the userspace header, then some userspace defs, then the __KERNEL__ guard, then the kernel space stuff.<br> <p> With what I've constructed, it ends up being pretty much the same - except that the UAPI part of it is in a separate file.<br> <p> <font class="QuotedText">&gt; ...</font><br> <font class="QuotedText">&gt; This seems unnecessary</font><br> <p> Unfortunately, if I use uapi/ in the UAPI header files' #includes they will need processing to remove it on installation. The alternative would require the KAPI headers have different names in some way (either named something different or with different directory components) - they would have to be distinguished by cpp, right?<br> <p> <font class="QuotedText">&gt; and would make it possible to depend on declarations that are implicitly</font><br> <font class="QuotedText">&gt; defined through the kernel versions of the header.</font><br> <p> I'm not sure what you're getting at. #including a kernel header after the split must give you at least what you got from it before the split, even if some of those bits are obtained indirectly. I don't think there are any cases where you get anything more than you got before the split.<br> <p> </div> Thu, 26 Jul 2012 15:19:55 +0000 Checking same object files produced https://lwn.net/Articles/508205/ https://lwn.net/Articles/508205/ ms <div class="FormattedComment"> Take the generated assembly before and after and prove it's equivalent? Yes, I'll fetch my coat...<br> </div> Thu, 26 Jul 2012 12:28:18 +0000 The UAPI header file split https://lwn.net/Articles/508203/ https://lwn.net/Articles/508203/ krisis <div class="FormattedComment"> I took a quick look at this patch set, and I've found some weirdness that I'm not sure what to make of.<br> <p> The UAPI files seem to include the kernel headers. <br> For example: the include/uapi/linux/eventpoll.h file includes &lt;linux/fcntl.h&gt;.<br> <p> The include stack would then look like this for a kernel compile:<br> <p> linux/eventpoll.h<br> uapi/linux/eventpoll.h<br> linux/fcntl.h<br> uapi/linux/fcntl.h<br> ...<br> etc.<br> <p> This seems unnecessary and would make it possible to depend on declarations that are implicitly defined through the kernel versions of the header.<br> <p> Unless I'm mistaken. Which is a very likely possibility.<br> </div> Thu, 26 Jul 2012 12:09:48 +0000 Checking same object files produced https://lwn.net/Articles/508199/ https://lwn.net/Articles/508199/ NRArnot <div class="FormattedComment"> That's assuming the compiler is perfectly well-behaved. It might be that the different ordering of #define statements changes the internal state of the compiler, leading to a change in the ordering of entities which are present in the generated code. The binary code would then be functionally identical but not byte-for-byte identical.<br> </div> Thu, 26 Jul 2012 11:39:21 +0000 Checking same object files produced https://lwn.net/Articles/508197/ https://lwn.net/Articles/508197/ epa <div class="FormattedComment"> I imagine that rearranging some header files will not change the generated code. So the correctness check can be making sure that the resulting kernel image is byte-for-byte identical (for various sets of config flags). The review process then isn't to check correctness of each line of patch, but to approve the general idea.<br> </div> Thu, 26 Jul 2012 10:59:02 +0000