Skip to contentSkip to conversation

Config.mk: correct gcc5 check

PATCH In review Jan Beulich 2 participants 4 messages Mar 31, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Config.mk: correct gcc5 check

Passing the -dumpversion option to gcc may only print the major version (for 4.x.y it printed major and minor, which in nowaday's scheme is then indeed just 5 for 5.x).

Fixes 40458f752550 ("Xen: Update compiler baseline checks")
Config.mk +2 -2
@@ -125,9 +125,9 @@ define cc-ver-check-closure
     endif
 endef
 
-# Require GCC v5.1 as the project global baseline
-check-$(gcc) = $(call cc-ver-check,CC,0x050100,"Xen requires at least GCC 5.1")
+# Require GCC v5 as the project global baseline
+check-$(gcc) = $(call cc-ver-check,CC,0x050000,"Xen requires at least GCC 5")
 $(eval $(check-y))
 
 ld-ver-build-id = $(shell $(1) --build-id 2>&1 | \
 					grep -q build-id && echo n || echo y)
#1 lore raw
Quoted 3 lines · Jan Beulich

Passing the -dumpversion option to gcc may only print the major version (for 4.x.y it printed major and minor, which in nowaday's scheme is then indeed just 5 for 5.x).

I meanwhile notice that my self-built compilers print 3 digits, so there really is a point to doc saying

"Depending on how the compiler has been configured it can be just a single number (major version), two numbers separated by a dot (major and minor version) or three numbers separated by dots (major, minor and patchlevel version)."

I've locally changed the above to

(my system 4.x.y printed major and minor, which in nowaday's scheme is then indeed just 5 for 5.x, which in turn is what my secondary system compiler does)

Jan

#2 lore raw
Quoted 12 lines · Jan Beulich
Quoted 3 lines · Jan Beulich

Passing the -dumpversion option to gcc may only print the major version (for 4.x.y it printed major and minor, which in nowaday's scheme is then indeed just 5 for 5.x).

I meanwhile notice that my self-built compilers print 3 digits, so there really is a point to doc saying

"Depending on how the compiler has been configured it can be just a single number (major version), two numbers separated by a dot (major and minor version) or three numbers separated by dots (major, minor and patchlevel version)."

Quoted 5 lines

I've locally changed the above to

(my system 4.x.y printed major and minor, which in nowaday's scheme is then indeed just 5 for 5.x, which in turn is what my secondary system compiler does)

Oh, that's useless.

Do all versions provide __GNUC_MINOR__ correctly?

~Andrew

#3 lore raw
Quoted 15 lines · Andrew Cooper
Quoted 14 lines · Jan Beulich
Quoted 3 lines · Jan Beulich

Passing the -dumpversion option to gcc may only print the major version (for 4.x.y it printed major and minor, which in nowaday's scheme is then indeed just 5 for 5.x).

I meanwhile notice that my self-built compilers print 3 digits, so there really is a point to doc saying

"Depending on how the compiler has been configured it can be just a single number (major version), two numbers separated by a dot (major and minor version) or three numbers separated by dots (major, minor and patchlevel version)."

I've locally changed the above to

Quoted 7 lines
Quoted 3 lines

(my system 4.x.y printed major and minor, which in nowaday's scheme is then indeed just 5 for 5.x, which in turn is what my secondary system compiler does)

Oh, that's useless.

Do all versions provide __GNUC_MINOR__ correctly?

I'm entirely sure they do.

Jan