Xen: Update compiler baseline checks

We have checks in both xen/compiler.h, and Config.mk.  Both are incomplete.

The check in Config.mk sees $(CC) in system and cross-compiler form, so cannot
express anything more than the global baseline.  Change it to simply 5.1.

In xen/compiler.h, rewrite the expression for clarity/brevity.

Include a GCC 12.2 check for RISCV, and include a Clang 11 baseline check.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
Andrew Cooper committed 2025-03-28 08:00:53 +00:00
1 parent 4abb6cff72
commit 40458f7525
2 files changed
+16 -14

No files matched your search

+2 -2
View File
@@ -125,8 +125,8 @@ define cc-ver-check-closure
endif endif
endef endef
# Require GCC v4.1+ # Require GCC v5.1 as the project global baseline
check-$(gcc) = $(call cc-ver-check,CC,0x040100,"Xen requires at least gcc-4.1") check-$(gcc) = $(call cc-ver-check,CC,0x050100,"Xen requires at least GCC 5.1")
$(eval $(check-y)) $(eval $(check-y))
ld-ver-build-id = $(shell $(1) --build-id 2>&1 | \ ld-ver-build-id = $(shell $(1) --build-id 2>&1 | \
+14 -12
View File
@@ -1,19 +1,21 @@
#ifndef __LINUX_COMPILER_H #ifndef __LINUX_COMPILER_H
#define __LINUX_COMPILER_H #define __LINUX_COMPILER_H
#if !defined(__GNUC__) || (__GNUC__ < 4) #if CONFIG_CC_IS_GCC
#error Sorry, your compiler is too old/not recognized.
#elif CONFIG_CC_IS_GCC # if defined(CONFIG_RISCV) && CONFIG_GCC_VERSION < 120200
# if defined(CONFIG_ARM_32) && CONFIG_GCC_VERSION < 40900 # error Sorry, please use GCC >= 12.2
# error Sorry, your version of GCC is too old - please use 4.9 or newer. # elif CONFIG_GCC_VERSION < 50100
# elif defined(CONFIG_ARM_64) && CONFIG_GCC_VERSION < 50100 # error Sorry, please use GCC >= 5.1
/*
* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63293
* https://lore.kernel.org/r/20210107111841.GN1551@shell.armlinux.org.uk
*/
# error Sorry, your version of GCC is too old - please use 5.1 or newer.
# endif # endif
#endif
#elif CONFIG_CC_IS_CLANG
# if CONFIG_CLANG_VERSION < 110000
# error Sorry, please use Clang >= 11
# endif
#endif /* Compiler checks. */
#ifdef CONFIG_CC_HAS_VISIBILITY_ATTRIBUTE #ifdef CONFIG_CC_HAS_VISIBILITY_ATTRIBUTE
/* Results in more efficient PIC code (no indirections through GOT or PLT). */ /* Results in more efficient PIC code (no indirections through GOT or PLT). */
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.