build: fix exporting for make 3.82
authorJan Beulich <jbeulich@suse.com>
Wed, 15 Jun 2022 08:23:16 +0000 (10:23 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 15 Jun 2022 08:23:16 +0000 (10:23 +0200)
commit95b0d7bbddfbd797f37f7a09f0586c4bbd22291b
treea40fab66a0e6b1aa9e392fa5f10b72a1c9125630
parente8e6e42279a5723239c5c40ba4c7f579a979465d
build: fix exporting for make 3.82

GNU make 3.82 apparently has a quirk where exporting an undefined
variable prevents its value from subsequently being updated. This
situation can arise due to our adding of -rR to MAKEFLAGS, which takes
effect also on make simply re-invoking itself. Once these flags are in
effect, CC (in particular) is empty (undefined), and would be defined
only via Config.mk including StdGNU.mk or alike. With the quirk, CC
remains empty, yet with an empty CC the compiler minimum version check
fails, breaking the build.

Move the exporting of the various tool stack component variables past
where they gain their (final) values.

See also be63d9d47f57 ("build: tweak variable exporting for make 3.82").

Fixes: 15a0578ca4b0 ("build: shuffle main Makefile")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
xen/Makefile