Skip to content

Use simple assignment for dpkg-architecture variables in Makefile

Make 4.4 includes a backwards-incompatible change that affects exported variables being passed to shells. From the release announcement [1]:

Previously makefile variables marked as export were not exported to commands started by the $(shell ...) function. Now, all exported variables are exported to $(shell ...). [...]

In a Makefile, variables set with '=' are recursively-evaluated at time of use. With this new change, each shell call causes previously exported variables to be evaluated again. This may involve more $(shell) calls each triggering a pyramid of $(shell) calls. The result is that we get an exponential runtime when working with an exported list of variables based on $(shell) output [2], as we are doing with dpkg-architecture variables. It's even further amplified with us recursively re-running make for targets like all_%.

Instead, use simply-expanded variables for these values as it's highly unlikely the underlying hardware could change during the build.

[1] https://lists.gnu.org/archive/html/info-gnu/2022-10/msg00008.html

[2] https://savannah.gnu.org/bugs/index.php?64746

Closes: #1091537

Merge request reports

Loading