Kaynağa Gözat

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 if 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

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Thomas Petazzoni 4 ay önce
ebeveyn
işleme
2313c23242

+ 39 - 0
package/lirc-tools/0003-Fix-default.so-plugin-not-loading.patch

@@ -0,0 +1,39 @@
+From 515325a90a9007fa12737c93c5c47ffaf6fea983 Mon Sep 17 00:00:00 2001
+From: Milan Vit <milanvit@milanvit.net>
+Date: Fri, 24 May 2024 18:34:26 +0900
+Subject: [PATCH] Fix default.so plugin not loading
+
+Upstream: 5d9e0f17436a98aedd0da885bd0096e147e54423
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
+---
+ 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
+