diff mbox series

[meta-oe,scarthgap] lmsensors: Clean stale files for sensord to avoid incorrect GCC header dependencies

Message ID 20250414032112.3634953-1-haixiao.yan.cn@eng.windriver.com
State New
Headers show
Series [meta-oe,scarthgap] lmsensors: Clean stale files for sensord to avoid incorrect GCC header dependencies | expand

Commit Message

haixiao.yan.cn@eng.windriver.com April 14, 2025, 3:21 a.m. UTC
From: Haixiao Yan <haixiao.yan.cn@windriver.com>

After upgrading GCC—for example, from 14.1.0 to 14.2.0—building lmsensors that
was previously compiled with GCC 14.1.0 may fail with an error like:
lmsensors/3.6.0/recipe-sysroot-native/usr/lib/x86_64-wrs-linux/gcc/x86_64-wrs-linux/
14.1.0/include/stddef.h can't find, which is needed by 'prog/sensord/args.rd'.

This occurs because prog/sensord/args.rd still references stale headers from the
older GCC version.
The root cause is that stale *.rd and *.ro files under prog/sensord are not
properly cleaned during do_configure. This patch ensures those files are removed
to prevent broken dependencies when GCC is upgraded.
Also remove the same statement in do_compile.

(master rev: 86b20b84ec278cacf4975b7933d46b894d74796e)

Signed-off-by: Haixiao Yan <haixiao.yan.cn@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta-oe/recipes-bsp/lm_sensors/lmsensors_3.6.0.bb | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta-oe/recipes-bsp/lm_sensors/lmsensors_3.6.0.bb b/meta-oe/recipes-bsp/lm_sensors/lmsensors_3.6.0.bb
index aba5ab587886..e3186132c76c 100644
--- a/meta-oe/recipes-bsp/lm_sensors/lmsensors_3.6.0.bb
+++ b/meta-oe/recipes-bsp/lm_sensors/lmsensors_3.6.0.bb
@@ -50,8 +50,11 @@  EXTRA_OEMAKE = 'EXLDFLAGS="${LDFLAGS}" \
         LIBDIR=${libdir} \
         CC="${CC}" AR="${AR}"'
 
+do_configure:prepend() {
+    sed -i -e 's:^#\(PROG_EXTRA\):\1:' ${S}/Makefile
+}
+
 do_compile() {
-    sed -i -e 's:^# \(PROG_EXTRA\):\1:' ${S}/Makefile
     # Respect LDFLAGS
     sed -i -e 's/\$(LIBDIR)$/\$(LIBDIR) \$(LDFLAGS)/g' ${S}/Makefile
     sed -i -e 's/\$(LIBSHSONAME) -o/$(LIBSHSONAME) \$(LDFLAGS) -o/g' \