From patchwork Mon Aug 31 19:29:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brendan Heading X-Patchwork-Id: 512578 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 2D3D31401CD for ; Tue, 1 Sep 2015 05:29:12 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=DKyCvjLo; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 7E75595FA9; Mon, 31 Aug 2015 19:29:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PR5OQczphIGv; Mon, 31 Aug 2015 19:29:10 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 8343595F95; Mon, 31 Aug 2015 19:29:10 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id AF0FF1C0FF3 for ; Mon, 31 Aug 2015 19:29:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id AA334A371F for ; Mon, 31 Aug 2015 19:29:08 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id O_cWpJdhjKwB for ; Mon, 31 Aug 2015 19:29:07 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com [209.85.212.173]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 1D5BEA3716 for ; Mon, 31 Aug 2015 19:29:07 +0000 (UTC) Received: by wicmc4 with SMTP id mc4so10210602wic.0 for ; Mon, 31 Aug 2015 12:29:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=LMEEntQqRsid+S7wLXR2y5HjmVk/an972rfiM1cKGmY=; b=DKyCvjLolqS7KxE4HnnQ8dF/DsvWDBNKPp5KMYtNT8oiiaoKI64iAPX1R9E6tXrjMn uX5rgKWkpf4e8nyvdn3jY+30QHJf5xo+Rg7tTkFADi1idgo1hPhv0Ai41r/RxetP516f Wgb4hPInLOcN5f1OCGpwKfFkct6iCGOvo6WBbofgu9PpOPo9ZMds/XeZtwcDAiJKMz5v MKSd3CdjtS4GlP/UwoENMJ9W3ogDyQPMq9Vhxgju5XKcg4w5S7CWYlidKCKEohdnAsXH cx82uF+aGjE0K5B2nweedDilP7PTwmbsUuEHD3yjubPqJ57pD2U7qXyMvrHaISIxYpMi m+JA== X-Received: by 10.180.105.66 with SMTP id gk2mr157630wib.73.1441049345679; Mon, 31 Aug 2015 12:29:05 -0700 (PDT) Received: from bhfedora.localdomain ([82.15.84.251]) by smtp.gmail.com with ESMTPSA id cx1sm620646wib.0.2015.08.31.12.29.04 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 31 Aug 2015 12:29:04 -0700 (PDT) From: Brendan Heading To: buildroot@buildroot.org Date: Mon, 31 Aug 2015 20:29:02 +0100 Message-Id: <1441049342-12623-1-git-send-email-brendanheading@gmail.com> X-Mailer: git-send-email 2.4.3 Cc: Brendan Heading Subject: [Buildroot] [PATCH 1/1] package/iptables: fix build on musl X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Fixes: http://autobuild.buildroot.net/results/68b/68bf8830f87ab32f4fd650c9dd4a8c80592983a9/ http://autobuild.buildroot.net/results/d9b/d9bb677fb5510adf05ffb4afbc63ead83d7e18dd/ http://autobuild.buildroot.net/results/4b8/4b80b6d0131b624301a5cfcd5541897f411043c9/ .. and others. This patch includes two backported patches from iptables git, plus one pending patch not integrated yet. Signed-off-by: Brendan Heading --- .../iptables/0003-consistently-use-errno.h.patch | 92 ++++++++++++++++++++++ .../0004-include-remove-libc5-support-code.patch | 51 ++++++++++++ package/iptables/0005-fix-build-with-musl.patch | 67 ++++++++++++++++ 3 files changed, 210 insertions(+) create mode 100644 package/iptables/0003-consistently-use-errno.h.patch create mode 100644 package/iptables/0004-include-remove-libc5-support-code.patch create mode 100644 package/iptables/0005-fix-build-with-musl.patch diff --git a/package/iptables/0003-consistently-use-errno.h.patch b/package/iptables/0003-consistently-use-errno.h.patch new file mode 100644 index 0000000..0ec1e5a --- /dev/null +++ b/package/iptables/0003-consistently-use-errno.h.patch @@ -0,0 +1,92 @@ +From a9214a0b718812d823a933ad580a96a3bf5f4dc6 Mon Sep 17 00:00:00 2001 +From: Felix Janda +Date: Sat, 2 May 2015 21:51:01 +0200 +Subject: [PATCH 1/3] consistently use + +On glibc, is a synomym for . + is specified by POSIX, so use that. + +Fixes compilation error with musl libc + +Backported from : +http://git.netfilter.org/iptables/commit/?id=043e52bc42021f71b85229f6d78bf7e75b282765 + +Upstream-Status: backport +Signed-off-by: Florian Westphal +Signed-off-by: Brendan Heading +--- + iptables/ip6tables-restore.c | 2 +- + iptables/ip6tables-save.c | 2 +- + iptables/iptables-restore.c | 2 +- + iptables/iptables-save.c | 2 +- + iptables/iptables-xml.c | 2 +- + 5 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/iptables/ip6tables-restore.c b/iptables/ip6tables-restore.c +index b8b9e0d..0927e6d 100644 +--- a/iptables/ip6tables-restore.c ++++ b/iptables/ip6tables-restore.c +@@ -9,7 +9,7 @@ + */ + + #include +-#include ++#include + #include + #include + #include +diff --git a/iptables/ip6tables-save.c b/iptables/ip6tables-save.c +index d819b30..f0349d3 100644 +--- a/iptables/ip6tables-save.c ++++ b/iptables/ip6tables-save.c +@@ -6,7 +6,7 @@ + * This code is distributed under the terms of GNU GPL v2 + */ + #include +-#include ++#include + #include + #include + #include +diff --git a/iptables/iptables-restore.c b/iptables/iptables-restore.c +index 8c942ff..d00b9e7 100644 +--- a/iptables/iptables-restore.c ++++ b/iptables/iptables-restore.c +@@ -6,7 +6,7 @@ + */ + + #include +-#include ++#include + #include + #include + #include +diff --git a/iptables/iptables-save.c b/iptables/iptables-save.c +index e599fce..3fbdb77 100644 +--- a/iptables/iptables-save.c ++++ b/iptables/iptables-save.c +@@ -6,7 +6,7 @@ + * + */ + #include +-#include ++#include + #include + #include + #include +diff --git a/iptables/iptables-xml.c b/iptables/iptables-xml.c +index 9628447..695cd67 100644 +--- a/iptables/iptables-xml.c ++++ b/iptables/iptables-xml.c +@@ -7,7 +7,7 @@ + */ + + #include +-#include ++#include + #include + #include + #include +-- +2.4.3 + diff --git a/package/iptables/0004-include-remove-libc5-support-code.patch b/package/iptables/0004-include-remove-libc5-support-code.patch new file mode 100644 index 0000000..8137ece --- /dev/null +++ b/package/iptables/0004-include-remove-libc5-support-code.patch @@ -0,0 +1,51 @@ +From 401673e9d37ea1e6da0bc335b1d7a2bbf445c690 Mon Sep 17 00:00:00 2001 +From: Felix Janda +Date: Sat, 2 May 2015 21:51:38 +0200 +Subject: [PATCH 2/3] include: remove libc5 support code + +Current code makes the assumption that !defined(__GLIBC__) means libc5 +which is very unlikely the case nowadays. + +Fixes compile error because of conflict between kernel and musl headers. + +Backported from : +http://git.netfilter.org/iptables/commit/?id=0bb1859e2d6dd79a0a59c3ee65f6a78cba118b86 + +Upstream-Status: backport +Signed-off-by: Florian Westphal +Signed-off-by: Brendan Heading +--- + include/libiptc/ipt_kernel_headers.h | 12 ------------ + 1 file changed, 12 deletions(-) + +diff --git a/include/libiptc/ipt_kernel_headers.h b/include/libiptc/ipt_kernel_headers.h +index 18861fe..a5963e9 100644 +--- a/include/libiptc/ipt_kernel_headers.h ++++ b/include/libiptc/ipt_kernel_headers.h +@@ -5,7 +5,6 @@ + + #include + +-#if defined(__GLIBC__) && __GLIBC__ == 2 + #include + #include + #include +@@ -13,15 +12,4 @@ + #include + #include + #include +-#else /* libc5 */ +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#endif + #endif +-- +2.4.3 + diff --git a/package/iptables/0005-fix-build-with-musl.patch b/package/iptables/0005-fix-build-with-musl.patch new file mode 100644 index 0000000..d5e0c2e --- /dev/null +++ b/package/iptables/0005-fix-build-with-musl.patch @@ -0,0 +1,67 @@ +From 2f2fde48594ec34e93ab409cd83442efe58e10ad Mon Sep 17 00:00:00 2001 +From: Brendan Heading +Date: Mon, 31 Aug 2015 15:24:44 +0100 +Subject: [PATCH 3/3] fix build with musl + +Add needed headers they are just not needed for glibc6+ but also +for musl +Define additional TCOPTS if not there + +u_initX types are in sys/types.h be explicit about it + +Upstream-Status: Pending + +bh: this is a copy of the patch at the link below, modified to remove +the changes to include/libiptc/ipt_kernel_headers.h as these are +already integrated in the upstream tree. See : + +http://lists.openembedded.org/pipermail/openembedded-core/2015-April/103613.html + +Signed-off-by: Khem Raj +Signed-off-by: Brendan Heading +--- + extensions/libxt_TCPOPTSTRIP.c | 15 +++++++++++++++ + include/linux/netfilter_ipv4/ip_tables.h | 1 + + 2 files changed, 16 insertions(+) + +diff --git a/extensions/libxt_TCPOPTSTRIP.c b/extensions/libxt_TCPOPTSTRIP.c +index 6897857..8a170b2 100644 +--- a/extensions/libxt_TCPOPTSTRIP.c ++++ b/extensions/libxt_TCPOPTSTRIP.c +@@ -12,6 +12,21 @@ + #ifndef TCPOPT_MD5SIG + # define TCPOPT_MD5SIG 19 + #endif ++#ifndef TCPOPT_MAXSEG ++# define TCPOPT_MAXSEG 2 ++#endif ++#ifndef TCPOPT_WINDOW ++# define TCPOPT_WINDOW 3 ++#endif ++#ifndef TCPOPT_SACK_PERMITTED ++# define TCPOPT_SACK_PERMITTED 4 ++#endif ++#ifndef TCPOPT_SACK ++# define TCPOPT_SACK 5 ++#endif ++#ifndef TCPOPT_TIMESTAMP ++# define TCPOPT_TIMESTAMP 8 ++#endif + + enum { + O_STRIP_OPTION = 0, +diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h +index 57fd82a..4807246 100644 +--- a/include/linux/netfilter_ipv4/ip_tables.h ++++ b/include/linux/netfilter_ipv4/ip_tables.h +@@ -15,6 +15,7 @@ + #ifndef _IPTABLES_H + #define _IPTABLES_H + ++#include + #include + + #include +-- +2.4.3 +