package/lirc-tools: fix build with GCC 14.x
PATCH 1/1 package/lirc-tools: fix build with GCC 14.x
Since glibc 2.28, <sys/sysmacros.h> is no longer implicitly included by <sys/types.h>, which means major() is only defined is you include <sys/sysmacros.h>.
This wasn't really visible for a while in loadable plugins built by lirc-tools as they could happily be built with undefined symbols... except they would fail to load at runtime.
But then GCC 14.x brought more strict checking of having the function prototype around, which now detects this issue at build time.
So the actual issue has been around since we switched to glibc 2.28, but it only started failing to build since gcc 14.x. The first failure is on August 2024, so this patch should be backported to our stable branches.
The fix is backport from an upstream commit, post 0.10.2.
Fixes:
https://autobuild.buildroot.net/results/2f64accd430d9467add3f1195f3f59eff8e99a4d/
Minimal reproducer:
BR2_arm=y
BR2_cortex_a9=y
BR2_ARM_ENABLE_VFP=y
BR2_TOOLCHAIN_EXTERNAL=y BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_ARMV7_EABIHF_GLIBC_STABLE=y BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
# BR2_PACKAGE_BUSYBOX is not set BR2_PACKAGE_LIRC_TOOLS=y
# BR2_TARGET_ROOTFS_TAR is not set
--- ...03-Fix-default.so-plugin-not-loading.patch | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 package/lirc-tools/0003-Fix-default.so-plugin-not-loading.patch
package/lirc-tools/0003-Fix-default.so-plugin-not-loading.patch new file +39 -0
@@ -0,0 +1,39 @@ +From 515325a90a9007fa12737c93c5c47ffaf6fea983 Mon Sep 17 00:00:00 2001 +From: Milan Vit <[email protected]> +Date: Fri, 24 May 2024 18:34:26 +0900 +Subject: [PATCH] Fix default.so plugin not loading + +Upstream: 5d9e0f17436a98aedd0da885bd0096e147e54423 +Signed-off-by: Thomas Petazzoni <[email protected]> +--- + lib/drv_enum.c | 1 + + plugins/default.c | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/lib/drv_enum.c b/lib/drv_enum.c +index 5fd74d0c..45abaa19 100644 +--- a/lib/drv_enum.c ++++ b/lib/drv_enum.c +@@ -14,6 +14,7 @@ + #include <stdbool.h> + #include <sys/stat.h> + #include <sys/types.h> ++#include <sys/sysmacros.h> + #include <dirent.h> + #include <errno.h> + +diff --git a/plugins/default.c b/plugins/default.c +index 79c942d6..37cba788 100644 +--- a/plugins/default.c ++++ b/plugins/default.c +@@ -26,6 +26,7 @@ + #include <stdint.h> + #include <stdlib.h> + #include <sys/stat.h> ++#include <sys/sysmacros.h> + #include <sys/types.h> + #include <sys/ioctl.h> + #include <sys/socket.h> +-- +2.50.1 +
Signature · 6 lines
2.50.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni via buildroot <[email protected]> writes:
Since glibc 2.28, <
sys/sysmacros.h> is no longer implicitly included by <sys/types.h>, which meansmajor()is only defined is you include
s/is you/if you/
Committed with that fixed, thanks.
Signature · 5 lines
Bye, Peter Korsgaard _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot