Back with some findings.

Could you please take a look at this Makefile ?
https://github.com/openwrt/packages/blob/master/net/openvswitch/Makefile

This is our package file that wraps the OpenWRT build system around
OpenVSwitch.
Starting at line 127, there's the Build/Compile make rule that's used to
compile the entire OVS package (top-to-bottom).

If I replace the KCFLAGS var [which I added there] with EXTRA_CFLAGS it
causes some build errors:
========================================================================================================================
In file included from include/linux/kernel.h:7:0,
                 from
/home/sandu/work/openwrt/build_dir/target-x86_64_uClibc-0.9.33.2/openvswitch-2.3.0/datapath/linux/compat/include/linux/kernel.h:4,
                 from include/linux/skbuff.h:17,
                 from
/home/sandu/work/openwrt/build_dir/target-x86_64_uClibc-0.9.33.2/openvswitch-2.3.0/datapath/linux/compat/include/linux/skbuff.h:4,
                 from
/home/sandu/work/openwrt/build_dir/target-x86_64_uClibc-0.9.33.2/openvswitch-2.3.0/datapath/linux/actions.c:21:
/home/sandu/work/openwrt/build_dir/target-x86_64_uClibc-0.9.33.2/openvswitch-2.3.0/datapath/linux/compat/include/linux/stddef.h:10:2:
error: redeclaration of enumerator 'false'
  false   = 0,

/* There's more build errs */
========================================================================================================================

I guess, overriding the EXTRA_CFLAGS also erases some other CFLAGS vars.
The KCFLAGS var that I added, was mostly just to solve the
"-Wno-error=date-time"  build error that OVS is experiencing with GCC 4.9.
I figured that the name "KCFLAGS" would not collide with other build vars,
and we could set it at the top-level build rule.
Also, in the OpenWRT Makefile I have to enable "-Wno-error=date-time" only
for GCC 4.9, since GCC 4.8 will complain it does not know about that option.

At the moment, we carry a patch in the OVS package folder.
This one:
https://github.com/openwrt/packages/blob/master/net/openvswitch/patches/0004-datapath-linux-add-KCFLAGS-var-to-modules-Makefile.m.patch

Long-term-wise if the "-Wno-error=date-time" error gets fixed on GCC 4.9,
there would be no build error, and the KCFLAGS build var would be unused.
Don't know what the plan for OVS is regarding that build error.

========================================================================================================================
To conclude:
- seems the EXTRA_CFLAGS approach does not suit our needs; maybe we would
need to change some build rules in order for the EXTRA_CFLAGS approach to
work; at the moment I like the way the Build/Compile rule is setup for OVS
on OpenWRT (though I did not write the Makefile initially, I am the current
maintainer)
- we don't need the KCFLAGS patch pushed into the OVS trunk; so if it gets
rejected, that's fine; at the moment we're fine with keeping it as a patch
in our OVS package folder; I thought of proposing it to you guys, since it
may be useful
- eventually GCC 4.9 will become popular enough that the build error gets
fixed within the OVS build rules, so we don't have to use that patch for
OVS on OpenWRT

Thanks
Alex


On Tue, Nov 25, 2014 at 6:28 PM, Alexandru Ardelean <[email protected]>
wrote:

> It's been a while since I made that patch.
> I'll have to check.
> I'll be back in a while with a few findings.
>
> Thanks
>
> On Tue, Nov 25, 2014 at 6:10 PM, Thomas Graf <[email protected]>
> wrote:
>
>> On 11/25/14 at 07:47am, Ben Pfaff wrote:
>> > On Tue, Oct 28, 2014 at 07:51:16AM -0700, Ben Pfaff wrote:
>> > > From: Alexandru Ardelean <[email protected]>
>> > >
>> > > This is mostly required because of GCC 4.9 which seems
>> > > to error out with:
>> > >   openvswitch/datapath/linux/datapath.c:2108:10:
>> > >        error: macro "DATE" might prevent reproducible builds
>> > >
>> > > We would have wanted to add '-Wno-error=date-time' directly
>> > > but that would be too specific, so we decided to add
>> > > a generic make flag and configure it with what we need.
>> > >
>> > > Signed-off-by: Alexandru Ardelean <[email protected]>
>> > > ---
>> > > This is from https://github.com/openvswitch/ovs/pull/18.  I'm
>> posting it
>> > > here for review because I'm not the right person to review it and I'm
>> not
>> > > sure that the OVS kernel maintainers are subscribed to the github
>> issues
>> > > tracker.
>> >
>> > Pravin or Jesse, would you mind take a look at this?
>>
>> Alexandru,
>>
>> You can already pass in additional build flags through the Kbuild
>> EXTRA_CFLAGS:
>>
>> $ ./configure --with-linux=...
>> $ cd datapath && make EXTRA_CFLAGS=-Wno-error=date-time
>>
>> Does that suit your needs?
>>
>
>
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to