Skip to content

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 goto to improve error handling. First example 350d63ef
  • Move to -std=gnu11 (Needs MISRA coordination).
  • Use _Generic() for const-preserving wrappers (Needs MISRA coordination).

Cleanup

  • Logic looking at __GNUC__, {CONFIG_,}GCC_VERSION etc, including include/xen/compiler.h, include/xen/lib/x86/cpu-policy.h and common/coverage/gcov.h.
  • Logic looking at __clang_major__, CONFIG_CLANG_VERSION, including common/coverage/llvm.c, include/xen/self-tests.h.
  • Drop 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
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information