package/lldpd: fix compilation issue with kernel 7.3 on aarch64
PATCH v2 1/1 package/lldpd: fix compilation issue with kernel 7.3 on aarch64
lldpd bundles some uapi linux files for old distributions, especially the types.h one.
Since kernel commit d4bf9e08d412 ("arm64: uapi: Use __u128 instead of __uint128_t in UAPI headers"), the type __u128 is used by sigcontext.h. This type is defined in types.h, but the old version bundled by lldpd does not provide it. This lack leads to the following compilation error:
In file included from ../../../../host/aarch64-buildroot-linux-gnu/sysroot/usr/include/bits/sigcontext.h:30,
from ../../../../host/aarch64-buildroot-linux-gnu/sysroot/usr/include/signal.h:301,
from ../../../../host/aarch64-buildroot-linux-gnu/sysroot/usr/include/sys/param.h:28,
from privsep_io.c:5:
../../../../host/aarch64-buildroot-linux-gnu/sysroot/usr/include/asm/sigcontext.h:81:9: error: unknown type name '__u128'; did you mean '__u32'?
81 | __u128 vregs[32];
| ^~~~~~
| __u32The uapi linux files bundled by lldpd are the ones of kernel 4.19
(https://github.com/lldpd/lldpd/commit/a192a2e91f81), and they are prepended to the include path, so they shadow the sysroot ones.
Remove them so that lldpd uses the uapi files of the sysroot, but only when the toolchain provides kernel headers 4.19 or later. With older headers the bundled files are kept, so those configurations are left unchanged.
---
Changes v1 -> v2:
- Only remove the bundled headers for kernel headers >= 4.19
package/lldpd/lldpd.mk | 7 +++++++ 1 file changed, 7 insertions(+)
package/lldpd/lldpd.mk +7 -0
@@ -61,6 +61,13 @@ else LLDPD_CONF_OPTS += --without-readline endif +ifeq ($(BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_19),y) +define LLDPD_DROP_UAPI_FILES + rm -rf $(@D)/include/linux +endef +LLDPD_POST_PATCH_HOOKS += LLDPD_DROP_UAPI_FILES +endif + define LLDPD_INSTALL_INIT_SYSV $(INSTALL) -D -m 0755 package/lldpd/S60lldpd \ $(TARGET_DIR)/etc/init.d/S60lldpd
Signature · 6 lines
2.43.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Hi Thibaut,
Quoted 11 lines
Changes v1 -> v2:
- Only remove the bundled headers for kernel headers >= 4.19package/lldpd/lldpd.mk | 7 +++++++ 1 file changed, 7 insertions(+)package/lldpd/lldpd.mk +0
-0
package/lldpd/lldpd.mk else · line 70
Quoted 10 lines
package/lldpd/lldpd.mk +7
-0@@ -61,6 +61,13 @@ else LLDPD_CONF_OPTS += --without-readline endif +ifeq ($(BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_19),y) +define LLDPD_DROP_UAPI_FILES + rm -rf $(@D)/include/linux +endef +LLDPD_POST_PATCH_HOOKS += LLDPD_DROP_UAPI_FILES +endif +
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 21 lines · Thibaut Collet
lldpd bundles some uapi linux files for old distributions, especially the
types.hone.Since kernel commit
d4bf9e08d412("arm64: uapi: Use__u128instead of__uint128_tin UAPI headers"), the type__u128is used bysigcontext.h. This type is defined intypes.h, but the old version bundled by lldpd does not provide it. This lack leads to the following compilation error:In file included from
../../../../host/aarch64-buildroot-linux-gnu/sysroot/usr/include/bits/sigcontext.h:30,from ../../../../host/aarch64-buildroot-linux-gnu/sysroot/usr/include/signal.h:301, from ../../../../host/aarch64-buildroot-linux-gnu/sysroot/usr/include/sys/param.h:28, from privsep_io.c:5: ../../../../host/aarch64-buildroot-linux-gnu/sysroot/usr/include/asm/sigcontext.h:81:9: error: unknown type name '__u128'; did you mean '__u32'? 81 | __u128 vregs[32]; | ^~~~~~ | __u32The uapi linux files bundled by lldpd are the ones of kernel 4.19
(https://github.com/lldpd/lldpd/commit/a192a2e91f81), and they are prepended to the include path, so they shadow the sysroot ones.
Quoted 6 lines
Remove them so that lldpd uses the uapi files of the sysroot, but only when the toolchain provides kernel headers 4.19 or later. With older headers the bundled files are kept, so those configurations are left unchanged.
Signed-off-by Thibaut Collet <[email protected]>
Applied to master, thanks!
Regards,
Arnout
Quoted 28 lines
---
Changes v1 -> v2:
- Only remove the bundled headers for kernel headers >= 4.19package/lldpd/lldpd.mk | 7 +++++++ 1 file changed, 7 insertions(+)package/lldpd/lldpd.mk +7
-0@@ -61,6 +61,13 @@ else LLDPD_CONF_OPTS += --without-readline endif +ifeq ($(BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_19),y) +define LLDPD_DROP_UAPI_FILES + rm -rf $(@D)/include/linux +endef +LLDPD_POST_PATCH_HOOKS += LLDPD_DROP_UAPI_FILES +endif + define LLDPD_INSTALL_INIT_SYSV $(INSTALL) -D -m 0755 package/lldpd/S60lldpd \ $(TARGET_DIR)/etc/init.d/S60lldpdSignature · 1 line
2.43.0
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot