All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Yang <liezhi.yang@windriver.com>
To: "Cui, Dexuan" <dexuan.cui@intel.com>
Cc: "yocto@yoctoproject.org" <yocto@yoctoproject.org>
Subject: Re: iptables not building on master
Date: Tue, 6 Mar 2012 19:41:20 +0800	[thread overview]
Message-ID: <4F55F7E0.8040602@windriver.com> (raw)
In-Reply-To: <A25F549E4D43CD42B4C02DF47A1913230FCD73D8@SHSMSX102.ccr.corp.intel.com>


Hi Dexuan,

After more investigation, I found that the:

-I/path/to/sysroot/usr/include

has been treated as the  standard system include directory,

and from gcc's manual:

  -I dir
            Add the directory dir to the list of directories to be searched for 
header files.  Directories named by -I are searched
            before the standard system include directories.  If the directory 
dir is a standard system include directory, the option is
            ignored to ensure that the default search order for system 
directories and the special treatment of system headers are not
            defeated .


so whether we put the kinclude_CPPFLAGS at the front or end doesn't
change the search order, gcc will always search iptables-1.4.12.2/include/
firstly, if we want to use the those header files consistently from the
sysroot, we should remove the iptables-1.4.12.2/include/linux directly
since all the files in this directory are from kernel headers, but after
I remove the directory, the build failed at:

| In file included from libip4tc.c:118:0:
| libiptc.c:70:8: error: redefinition of 'struct xt_error_target'
| 
/buildarea/lyang1/war_8/tmp/sysroots/crownbay/usr/include/linux/netfilter/x_tables.h:69:8: 
note: originally defined here

It seems that iptables keep and use their own kernel header files.

I will send a pull request with the fix method:

#define __aligned_u64 __u64 __attribute__((aligned(8)))

// Robert

On 03/06/2012 05:47 PM, Cui, Dexuan wrote:
> Robert Yang wrote on 2012-03-06:
>> Hi Tom,
>> Thanks for the update, the root cause is that iptables offers a kernel
>> header file include/linux/types.h, but it mis-matches the kernel in
>> the sysroot, we can add this:
>> #define __aligned_u64 __u64 __attribute__((aligned(8)))
>> to:
>> iptables-1.4.12.2/include/linux/types.h
>> to fix this problem.
>>
>> Another solution is that as Dexuan suggested we change the order of
>> the include header files, but I'm afraid that may cause other
>> problems, since I think that the pkg's own header file should have a
>> higher priority than the system's, so I think that the current order is correct.
> My understanding is:
> Recently the preferred linux-libc-headers was upgraded to linux-libc-headers-yocto-3.2, that introduced a new struct tpacket_hdr_v1 in linux/if_packet.h and the new struct uses __aligned_u64 but __aligned_u64 is not defined in iptables's own linux/types.h
> Currently in iptables's makefile, its own linux/types.h comes first than that one in our sysroot in the header file search order, and I noticed iptables doesn't have a file linux/if_packet.h. So, with our sysroot's linux/if_package.h and iptables's own linux/types, we get the failure.
>
> If we define __aligned_u64 _ in iptables's own linux/types.h, we're still using our sysroot's linux/if_packet.h with iptables's linux/types.h -- I think this is not correct even if the build can pass?  I think we should use header files consistently.
>
>
> Thanks,
> -- Dexuan
>
>


  parent reply	other threads:[~2012-03-06 11:41 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-05 21:03 iptables not building on master Autif Khan
2012-03-05 21:27 ` Autif Khan
2012-03-05 22:44   ` Autif Khan
2012-03-06  5:09     ` Tom Zanussi
2012-03-06  5:35       ` Cui, Dexuan
2012-03-06  5:59         ` Robert Yang
2012-03-06  6:48           ` Tom Zanussi
2012-03-06  9:04             ` Robert Yang
2012-03-06  9:47               ` Cui, Dexuan
2012-03-06 10:05                 ` Robert Yang
2012-03-06 11:41                 ` Robert Yang [this message]
2012-03-06 14:21                   ` Bruce Ashfield
2012-03-06 15:16               ` Khem Raj
2012-03-06 15:21                 ` Robert Yang
2012-03-06 15:24                   ` Khem Raj
2012-03-06 15:27                     ` Bruce Ashfield
2012-03-06 17:28                       ` Khem Raj
2012-03-06 17:32                         ` Bruce Ashfield
2012-03-06 12:14             ` Koen Kooi
2012-03-06 16:44               ` Tom Zanussi

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=4F55F7E0.8040602@windriver.com \
    --to=liezhi.yang@windriver.com \
    --cc=dexuan.cui@intel.com \
    --cc=yocto@yoctoproject.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.