From 474f35eb544b6ffe64fb5f2c1e086fcd2f1a431b Mon Sep 17 00:00:00 2001 From: Fabrice Fontaine Date: Sat, 11 Dec 2021 22:12:34 +0100 Subject: [PATCH] package/rp-pppoe: fix musl build Fix the following musl build failure raised since bump of pppd to version 2.4.9 in commit 075b01f2f7b5a9241b4bfe76db8f14af0284060c: In file included from pppoe.h:133, from debug.c:19: /home/giuliobenetti/autobuild/run/instance-0/output-1/host/riscv64-buildroot-linux-musl/sysroot/usr/include/netinet/if_ether.h:116:8: error: redefinition of 'struct ethhdr' 116 | struct ethhdr { | ^~~~~~ In file included from pppoe.h:121, from debug.c:19: /home/giuliobenetti/autobuild/run/instance-0/output-1/host/riscv64-buildroot-linux-musl/sysroot/usr/include/linux/if_ether.h:163:8: note: originally defined here 163 | struct ethhdr { | ^~~~~~ Fixes: - http://autobuild.buildroot.org/results/ccca18fcbcde65cb6784f5559eac68ca17ab14a3 Signed-off-by: Fabrice Fontaine Signed-off-by: Arnout Vandecappelle (Essensium/Mind) --- ...src-pppoe.h-fix-build-with-musl-libc.patch | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 package/rp-pppoe/0002-src-pppoe.h-fix-build-with-musl-libc.patch diff --git a/package/rp-pppoe/0002-src-pppoe.h-fix-build-with-musl-libc.patch b/package/rp-pppoe/0002-src-pppoe.h-fix-build-with-musl-libc.patch new file mode 100644 index 0000000000..29ba72be4f --- /dev/null +++ b/package/rp-pppoe/0002-src-pppoe.h-fix-build-with-musl-libc.patch @@ -0,0 +1,60 @@ +From bbf5b2759cff0c65b47fd6dbe5fe7341f205ad03 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Sat, 11 Dec 2021 22:03:16 +0100 +Subject: [PATCH] src/pppoe.h: fix build with musl libc + +musl libc defines its own struct ethhdr that conflicts with the kernel +define one. The kernel headers provide a way to suppress its struct +ethhdr. For that to work the libc headers must precede the kernel. Move +the kernel linux/if_ether.h include below libc netinet/if_ether.h. That +fixes the following build failure: + +In file included from pppoe.h:133, + from debug.c:19: +/home/giuliobenetti/autobuild/run/instance-0/output-1/host/riscv64-buildroot-linux-musl/sysroot/usr/include/netinet/if_ether.h:116:8: error: redefinition of 'struct ethhdr' + 116 | struct ethhdr { + | ^~~~~~ +In file included from pppoe.h:121, + from debug.c:19: +/home/giuliobenetti/autobuild/run/instance-0/output-1/host/riscv64-buildroot-linux-musl/sysroot/usr/include/linux/if_ether.h:163:8: note: originally defined here + 163 | struct ethhdr { + | ^~~~~~ + +Fixes: + - http://autobuild.buildroot.org/results/ccca18fcbcde65cb6784f5559eac68ca17ab14a3 + +Signed-off-by: Fabrice Fontaine +[Upstream status: https://github.com/dfskoll/rp-pppoe/pull/4] +--- + src/pppoe.h | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/pppoe.h b/src/pppoe.h +index 4780092..2b08111 100644 +--- a/src/pppoe.h ++++ b/src/pppoe.h +@@ -117,10 +117,6 @@ typedef unsigned long UINT32_t; + #error Could not find a 32-bit integer type + #endif + +-#ifdef HAVE_LINUX_IF_ETHER_H +-#include +-#endif +- + #include + + #ifdef HAVE_NETINET_IF_ETHER_H +@@ -134,6 +130,10 @@ typedef unsigned long UINT32_t; + #endif + #endif + ++#ifdef HAVE_LINUX_IF_ETHER_H ++#include ++#endif ++ + + + /* Ethernet frame types according to RFC 2516 */ +-- +2.33.0 +