From e74d4fc4932df4ea42381acb44d616241275b79a Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Fri, 26 Aug 2016 22:08:14 +0200 Subject: [PATCH] norm: add patch to fix musl build Fixes: http://autobuild.buildroot.net/results/9c7130d5b5aad218c5c576761d495a3f403fdc5b/ Signed-off-by: Thomas Petazzoni --- ...move-kernel-headers-include-musl-fix.patch | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 package/norm/0003-remove-kernel-headers-include-musl-fix.patch diff --git a/package/norm/0003-remove-kernel-headers-include-musl-fix.patch b/package/norm/0003-remove-kernel-headers-include-musl-fix.patch new file mode 100644 index 0000000000..7581c10b79 --- /dev/null +++ b/package/norm/0003-remove-kernel-headers-include-musl-fix.patch @@ -0,0 +1,55 @@ +Remove kernel header includes causing issues with musl + +Include the kernel headers from netfilter causes a conflict with the + way of defining the IPPROTO_* constants, resulting in +the following build failure: + +In file included from /home/peko/autobuild/instance-0/output/host/usr/arm-buildroot-linux-musleabihf/sysroot/usr/include/netdb.h:9:0, + from /home/peko/autobuild/instance-0/output/build/norm-1.5r6/protolib/include/protoAddress.h:13, + from /home/peko/autobuild/instance-0/output/build/norm-1.5r6/protolib/include/protoDetour.h:5, + from ../protolib/src/linux/linuxDetour.cpp:3: +/home/peko/autobuild/instance-0/output/host/usr/arm-buildroot-linux-musleabihf/sysroot/usr/include/linux/in.h:28:3: error: expected identifier before numeric constant + IPPROTO_IP = 0, /* Dummy protocol for TCP */ + ^ +/home/peko/autobuild/instance-0/output/host/usr/arm-buildroot-linux-musleabihf/sysroot/usr/include/linux/in.h:28:3: error: expected '}' before numeric constant +/home/peko/autobuild/instance-0/output/host/usr/arm-buildroot-linux-musleabihf/sysroot/usr/include/linux/in.h:28:3: error: expected unqualified-id before numeric constant +In file included from /home/peko/autobuild/instance-0/output/host/usr/arm-buildroot-linux-musleabihf/sysroot/usr/include/linux/netfilter.h:7:0, + from /home/peko/autobuild/instance-0/output/host/usr/arm-buildroot-linux-musleabihf/sysroot/usr/include/linux/netfilter_ipv4.h:8, + from ../protolib/src/linux/linuxDetour.cpp:10: +/home/peko/autobuild/instance-0/output/host/usr/arm-buildroot-linux-musleabihf/sysroot/usr/include/linux/in.h:79:1: error: expected declaration before '}' token + }; + ^ + +Since from musl's developers perspective including kernel headers is +seen as being unsafe, we simply duplicate the necessary netfilter +definitions (there are just a few) instead of including some kernel +headers. + +Signed-off-by: Thomas Petazzoni + +Index: b/protolib/src/linux/linuxDetour.cpp +=================================================================== +--- a/protolib/src/linux/linuxDetour.cpp ++++ b/protolib/src/linux/linuxDetour.cpp +@@ -7,15 +7,18 @@ + #include // for atoi(), getenv() + #include + #include // for close() +-#include // for NF_IP_LOCAL_OUT, etc +-#include // for NF_IP6_LOCAL_OUT, etc +-#include // for NF_ACCEPT, etc + #include + + #include // for fcntl(), etc + #include // for ETH_P_IP + #include // for ARPHRD_ETHER + ++/* From netfilter kernel headers */ ++#define NF_IP_LOCAL_OUT 3 ++ ++#define NF_DROP 0 ++#define NF_ACCEPT 1 ++ + /** NOTES: + * + * 1) This newer implementation of LinuxDetour uses netfilter_queue -- 2.30.2