mbox series

[meta-oe,0/2] cpufrequtils: fix latent do_install build failure

Message ID 20260814-cpufrequtils-v1-0-5ac5e77bf5ff@gmail.com
Headers show
Series cpufrequtils: fix latent do_install build failure | expand

Message

Alex Kiernan Aug. 14, 2026, 2:29 p.m. UTC
do_install runs make with -e, and install: depends on all:, so anything out
of date at install time gets recompiled under -e. -e makes the environment
beat the makefile's own assignments, and every CPPFLAGS and CFLAGS use in
this makefile is +=, seeded from the environment. bitbake exports CPPFLAGS
(empty by default), so the makefile's

  CPPFLAGS += -DVERSION=\"$(VERSION)\" -DPACKAGE=\"$(PACKAGE)\" \
              -DPACKAGE_BUGREPORT=\"$(PACKAGE_BUGREPORT)\" -D_GNU_SOURCE

is discarded. print_header() in utils/info.c and utils/set.c uses PACKAGE and
VERSION unconditionally, so the recompile fails:

  utils/info.c:447:16: error: 'PACKAGE' undeclared (first use in this function)
  utils/set.c:38:16: error: 'PACKAGE' undeclared (first use in this function)
  make: *** [Makefile:166: cpufreq-info] Error 1

A from-scratch build does not hit this: do_compile leaves everything up to
date, so all: has nothing to redo and nothing is compiled under -e. It bites
only when something is newer than the binaries by the time do_install runs,
which is why it survived this long. To reproduce on an unpatched tree:

  bitbake cpufrequtils -c compile
  touch .../cpufrequtils-008/utils/info.c
  bitbake cpufrequtils -c install

Dropping -e fixes it, and also makes do_install compile with the same flags
do_compile used - the install-time relink was otherwise losing -pipe and
$(WARNINGS) too.

-e is also why 0001-dont-unset-cflags.patch exists: it was there to override
the makefile's CC/LD/AR/STRIP/RANLIB assignments. CC is the only one the
makefile ever references, so passing it on the make command line replaces
the patch entirely.

Patch 1 is source provenance and whitespace only; patch 2 is the fix above,
plus NLS as a PACKAGECONFIG.

Verified with clean cleansstate builds for a 32-bit Arm target, and the
reproducer above no longer fails.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
---
Alex Kiernan (2):
      cpufrequtils: fetch from git.kernel.org, mark PV as post-release
      cpufrequtils: fix do_install, drop the toolchain patch, add nls PACKAGECONFIG

 .../cpufrequtils/0001-dont-unset-cflags.patch      | 32 ----------------------
 .../recipes-bsp/cpufrequtils/cpufrequtils_008.bb   | 27 ++++++++----------
 2 files changed, 12 insertions(+), 47 deletions(-)
---
base-commit: 58dbc84826947c9436d4b527a4569fdd1ce5ea19
change-id: 20260814-cpufrequtils-0a49f332a1c2

Best regards,
--  
Alex Kiernan <alex.kiernan@gmail.com>