mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Alexander Aring <aar@pengutronix.de>
To: ptxdist@pengutronix.de
Subject: Re: [ptxdist] iproute2 build errors when updating to 4.6
Date: Tue, 24 May 2016 17:24:36 +0200	[thread overview]
Message-ID: <44f85c5d-0697-06b1-2e8b-334ac67fa0b8@pengutronix.de> (raw)
In-Reply-To: <20160524130143.GA3162@archie.localdomain>


Hi,

On 05/24/2016 03:01 PM, Clemens Gruber wrote:
> Hi Alex, Hi Michael,
> 
> On Tue, May 24, 2016 at 09:30:41AM +0200, Alexander Aring wrote:
>> Maybe to add KERNEL_INCLUDE=${KERNEL_HEADERS_DIR) in IPROUTE2_MAKE_OPT is
>> enough here, or leave it empty to use maybe the fallback?
>>
>> I think to updating to use KERNEL_INCLUDE=${KERNEL_HEADERS_DIR) would be
>> nice in ptxdist, if this solves your issue.
>>
> 
> Thank you for your help!
> 
> I tried adding KERNEL_INCLUDE=$(KERNEL_HEADERS_DIR) to the MAKE_OPTS but
> that alone did not fix the problem. It still used the toolchain headers.
> 
> Including net/if.h before linux/if.h fixes the redefinition errors, but now I
> get: fatal error: xtables-version.h: No such file or directory
> Although the iptables dependency should be optional.
> 
> Is this a bug in the hand-crafted configure script of iproute2 and can
> you reproduce this on your machines?
> 

I think somebody breaks the "TC_CONFIG_XT:=n" and TC_CONFIG_XT_OLD:=n and
TC_CONFIG_XT_OLD_H:=n upstream.

You can see these settings and what will be build here [0]. In our case
and what's worked before it is:

TCMODULES += m_ipt.o

this is where lot of errors occurs.

These errors are mainly two errors:

1. redefinition erros.

2. compile doesn't know about "struct iptables_target".

---

I fixed 1 as by some workaround and tried to get the "why" in "2.". Then
I found [1], which completely removes "struct iptables_target" from the
internal iptables headers of iproute2 (I think they need to update
m_ipt.c or add a second iptables header here and somebody don't did that,
depends if iptables just move this struct or deleted it).

I need to look in iptables source for that to be sure.

Nevertheless I tried several configs by some "iptables" replacement
modules for m_ipt.o, see [0] (I hope you don't need that) and figured out the
following works for me, but I think we need a dependency on IPTABLES then.

---

diff --git a/rules/iproute2.in b/rules/iproute2.in
index dadad03..20cc83d 100644
--- a/rules/iproute2.in
+++ b/rules/iproute2.in
@@ -3,6 +3,7 @@
 menuconfig IPROUTE2
        tristate
        prompt "iproute2                      "
+       select IPTABLES
        select DB if IPROUTE2_ARPD
        select LIBC_DL
        select LIBC_M
diff --git a/rules/iproute2.make b/rules/iproute2.make
index 34f93f4..01936eb 100644
--- a/rules/iproute2.make
+++ b/rules/iproute2.make
@@ -17,8 +17,8 @@ PACKAGES-$(PTXCONF_IPROUTE2) += iproute2
 #
 # Paths and names
 #
-IPROUTE2_VERSION       := 4.4.0
-IPROUTE2_MD5           := d762653ec3e1ab0d4a9689e169ca184f
+IPROUTE2_VERSION       := 4.6.0
+IPROUTE2_MD5           := d015e437e4f744d51d3a1a53341826d5
 IPROUTE2               := iproute2-$(IPROUTE2_VERSION)
 IPROUTE2_SUFFIX                := tar.xz
 IPROUTE2_URL           := $(call ptx/mirror, KERNEL, utils/net/iproute2/$(IPROUTE2).$(IPROUTE2_SUFFIX))
@@ -38,7 +38,7 @@ $(STATEDIR)/iproute2.prepare:
        @$(call world/prepare, IPROUTE2)
 # overwrite options we don't want, or may be misdetected
        @echo 'TC_CONFIG_ATM:=n'        >> $(IPROUTE2_DIR)/Config
-       @echo 'TC_CONFIG_XT:=n'         >> $(IPROUTE2_DIR)/Config
+       @echo 'TC_CONFIG_XT:=y'         >> $(IPROUTE2_DIR)/Config
        @echo 'IPT_LIB_DIR:=/usr/lib'   >> $(IPROUTE2_DIR)/Config
        @echo 'TC_CONFIG_ELF:=n'        >> $(IPROUTE2_DIR)/Config
 ifndef PTXCONF_GLOBAL_SELINUX
@@ -53,7 +53,8 @@ endif
 IPROUTE2_MAKE_OPT := \
        DESTDIR=$(SYSROOT) \
        LDFLAGS='-rdynamic' \
-       WFLAGS="-Wall"
+       WFLAGS="-Wall" \
+       KERNEL_INCLUDE="${KERNEL_HEADERS_DIR}/include/"
 
 # ----------------------------------------------------------------------------
 # Target-Install

---

For the TC_CONFIG_XT:=y, maybe it's worth to look into buildroot file, they
also replace some $(SED) "s/-DIPT/-DXT/" $(IPROUTE2_DIR)/tc/Makefile,
see [2], but either buildroot doesn't has support for 4.6.0 iproute2.

According to the buildfail of "m_ipt.o", this should be fixed mainline
somehow and can't working with the iptables include files which are
copied into include dir of iproute2. :-/

- Alex

[0] http://git.kernel.org/cgit/linux/kernel/git/shemminger/iproute2.git/tree/tc/Makefile#n82
[1] http://git.kernel.org/cgit/linux/kernel/git/shemminger/iproute2.git/diff/?id=5cd1adba79d33644debd4ba498bb262c5bebcfba
[2] https://git.buildroot.net/buildroot/tree/package/iproute2/iproute2.mk

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

  reply	other threads:[~2016-05-24 15:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-21 23:55 Clemens Gruber
2016-05-24  7:20 ` Alexander Aring
2016-05-24  7:30   ` Alexander Aring
2016-05-24 13:01     ` Clemens Gruber
2016-05-24 15:24       ` Alexander Aring [this message]
2016-05-24 18:08         ` Alexander Aring
2016-05-25 17:42           ` Clemens Gruber
2016-05-29 18:31             ` Alexander Aring
2016-05-30 19:59               ` Clemens Gruber
2016-06-15 18:37                 ` Alexander Aring
2016-06-16 16:19                   ` Clemens Gruber
2016-05-24 10:04 ` Michael Olbrich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44f85c5d-0697-06b1-2e8b-334ac67fa0b8@pengutronix.de \
    --to=aar@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox