Cleanup following toolchain baseline upgrade
As of aa78a7d1, Xen now has a minimum baseline of GCC 5.1 / Binutils 2.25, and Clang 11. This allows for the use of new features, and for cleaning up compatibility logic.
This is an incomplete list of areas to look at. Please coordinate with @andyhhp.
Potential New Features
- Use
__has_include()to improve asm-generic. First example 08d03e12 - Use
asm gototo improve error handling. First example 350d63ef - Use
autoper C23. First example 6238c97e (Needs MISRA coordination). - Move to
-std=gnu11(Needs MISRA coordination). - Use
_Generic()for const-preserving wrappers (Needs MISRA coordination).
Cleanup
- Logic looking at
__GNUC__,{CONFIG_,}GCC_VERSIONetc, includinginclude/xen/compiler.h,include/xen/lib/x86/cpu-policy.handcommon/coverage/gcov.h. - Logic looking at
__clang_major__,CONFIG_CLANG_VERSION, includingcommon/coverage/llvm.c,include/xen/self-tests.h. -
DropWrongly diagnosed; not a toolchain bug and needs to stay.INVALID_{MFN,GFN}_INITIALIZER. Workaround for GCC < 5. - Audit all
-DHAVE_AS_*options. Some can definitely be dropped, simplifying the Xen code which uses them. - Audit all
cc-option*variations. Some can definitely become plain CFLAGS now. - Clean up EFI build. Lots of build-time capability checking can be simplified.
Edited by Andrew Cooper