On 28.06.2023 13:32, Andrew Cooper wrote: > Hello, > > This wasn't a formal discussion point at XenSummit, but Oleksii pointed > out that it was still a problem, hence this thread. > > As we take on more architectures, it becomes more and more important for > things to be handled in a mostly-common way. With that comes quite a > lot of <xen/foo.h> including <asm/foo.h>, and the arch one being a stub > in simple cases. > > It would be nice to get rid of the stub files; they're irritating to > deal with, both when refactoring and simply for the file bloat they create. > > There are two options which come to mind. > > 1) Use __has_include(). This would be ideal, but would require us > bumping the minimum GCC version to 4.9.2 as a prerequisite. I'm not > aware of any way to emulate the necessary behaviour on older toolchains. > > 2) Have a stub "architecture" which is always last on the include path. > This would reduce the number of stub files from one set per arch, to > only one set.
I'd be in favor of 2, which iirc is also how Linux does it (in certain cases, iirc; or maybe things have changed yet again there). They call it asm-generic/, which I think is slightly better than anything with "stub" in its name. Jan