Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keepalived 1.4.3 build error with linux kernel 4.9.90 #835

Closed
michael2009 opened this issue Apr 11, 2018 · 5 comments
Closed

keepalived 1.4.3 build error with linux kernel 4.9.90 #835

michael2009 opened this issue Apr 11, 2018 · 5 comments

Comments

@michael2009
Copy link

esult -iremap/trunk/build_dir/target-x86_64_glibc/keepalived-1.4.3:keepalived-1.4.3 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -D_GNU_SOURCE -MT vrrp.o -MD -MP -MF .deps/vrrp.Tpo -c -o vrrp.o vrrp.c
In file included from ./../include/vrrp_if.h:28:0,
from ./../include/vrrp_ipaddress.h:39,
from ./../include/vrrp_arp.h:33,
from vrrp.c:29:
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/linux/if.h:79:2: error: redeclaration of enumerator 'IFF_UP'
IFF_UP = 1<<0, /* sysfs /
^
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/net/if.h:44:5: note: previous definition of 'IFF_UP' was here
IFF_UP = 0x1, /
Interface is up. /
^
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/linux/if.h:80:2: error: redeclaration of enumerator 'IFF_BROADCAST'
IFF_BROADCAST = 1<<1, /
volatile /
^
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/net/if.h:46:5: note: previous definition of 'IFF_BROADCAST' was here
IFF_BROADCAST = 0x2, /
Broadcast address valid. /
^
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/linux/if.h:81:2: error: redeclaration of enumerator 'IFF_DEBUG'
IFF_DEBUG = 1<<2, /
sysfs /
^
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/net/if.h:48:5: note: previous definition of 'IFF_DEBUG' was here
IFF_DEBUG = 0x4, /
Turn on debugging. /
^
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/linux/if.h:82:2: error: redeclaration of enumerator 'IFF_LOOPBACK'
IFF_LOOPBACK = 1<<3, /
volatile /
^
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/net/if.h:50:5: note: previous definition of 'IFF_LOOPBACK' was here
IFF_LOOPBACK = 0x8, /
Is a loopback net. /
^
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/linux/if.h:83:2: error: redeclaration of enumerator 'IFF_POINTOPOINT'
IFF_POINTOPOINT = 1<<4, /
volatile /
^
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/net/if.h:52:5: note: previous definition of 'IFF_POINTOPOINT' was here
IFF_POINTOPOINT = 0x10, /
Interface is point-to-point link. /
^
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/linux/if.h:84:2: error: redeclaration of enumerator 'IFF_NOTRAILERS'
IFF_NOTRAILERS = 1<<5, /
sysfs /
^
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/net/if.h:54:5: note: previous definition of 'IFF_NOTRAILERS' was here
IFF_NOTRAILERS = 0x20, /
Avoid use of trailers. /
^
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/linux/if.h:85:2: error: redeclaration of enumerator 'IFF_RUNNING'
IFF_RUNNING = 1<<6, /
volatile /
^
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/net/if.h:56:5: note: previous definition of 'IFF_RUNNING' was here
IFF_RUNNING = 0x40, /
Resources allocated. /
^
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/linux/if.h:86:2: error: redeclaration of enumerator 'IFF_NOARP'
IFF_NOARP = 1<<7, /
sysfs /
^
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/net/if.h:58:5: note: previous definition of 'IFF_NOARP' was here
IFF_NOARP = 0x80, /
No address resolution protocol. /
^
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/linux/if.h:87:2: error: redeclaration of enumerator 'IFF_PROMISC'
IFF_PROMISC = 1<<8, /
sysfs /
^
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/net/if.h:60:5: note: previous definition of 'IFF_PROMISC' was here
IFF_PROMISC = 0x100, /
Receive all packets. /
^
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/linux/if.h:88:2: error: redeclaration of enumerator 'IFF_ALLMULTI'
IFF_ALLMULTI = 1<<9, /
sysfs /
^
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/net/if.h:64:5: note: previous definition of 'IFF_ALLMULTI' was here
IFF_ALLMULTI = 0x200, /
Receive all multicast packets. /
^
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/linux/if.h:89:2: error: redeclaration of enumerator 'IFF_MASTER'
IFF_MASTER = 1<<10, /
volatile /
^
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/net/if.h:67:5: note: previous definition of 'IFF_MASTER' was here
IFF_MASTER = 0x400, /
Master of a load balancer. /
^
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/linux/if.h:90:2: error: redeclaration of enumerator 'IFF_SLAVE'
IFF_SLAVE = 1<<11, /
volatile /
^
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/net/if.h:69:5: note: previous definition of 'IFF_SLAVE' was here
IFF_SLAVE = 0x800, /
Slave of a load balancer. /
^
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/linux/if.h:91:2: error: redeclaration of enumerator 'IFF_MULTICAST'
IFF_MULTICAST = 1<<12, /
sysfs /
^
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/net/if.h:72:5: note: previous definition of 'IFF_MULTICAST' was here
IFF_MULTICAST = 0x1000, /
Supports multicast. /
^
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/linux/if.h:92:2: error: redeclaration of enumerator 'IFF_PORTSEL'
IFF_PORTSEL = 1<<13, /
sysfs /
^
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/net/if.h:75:5: note: previous definition of 'IFF_PORTSEL' was here
IFF_PORTSEL = 0x2000, /
Can set media type. /
^
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/linux/if.h:93:2: error: redeclaration of enumerator 'IFF_AUTOMEDIA'
IFF_AUTOMEDIA = 1<<14, /
sysfs /
^
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/net/if.h:77:5: note: previous definition of 'IFF_AUTOMEDIA' was here
IFF_AUTOMEDIA = 0x4000, /
Auto media select active. /
^
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/linux/if.h:94:2: error: redeclaration of enumerator 'IFF_DYNAMIC'
IFF_DYNAMIC = 1<<15, /
sysfs /
^
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/net/if.h:79:5: note: previous definition of 'IFF_DYNAMIC' was here
IFF_DYNAMIC = 0x8000 /
Dialup device with changing addresses. */
^
In file included from /trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/linux/netdevice.h:28:0,
from ./../include/vrrp_if.h:36,
from ./../include/vrrp_ipaddress.h:39,
from ./../include/vrrp_arp.h:33,
from vrrp.c:29:
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/linux/if.h:189:8: error: redefinition of 'struct ifmap'
struct ifmap {
^
In file included from ./../include/vrrp_if.h:28:0,
from ./../include/vrrp_ipaddress.h:39,
from ./../include/vrrp_arp.h:33,
from vrrp.c:29:
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/net/if.h:111:8: note: originally defined here
struct ifmap
^
In file included from /trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/linux/netdevice.h:28:0,
from ./../include/vrrp_if.h:36,
from ./../include/vrrp_ipaddress.h:39,
from ./../include/vrrp_arp.h:33,
from vrrp.c:29:
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/linux/if.h:226:8: error: redefinition of 'struct ifreq'
struct ifreq {
^
In file included from ./../include/vrrp_if.h:28:0,
from ./../include/vrrp_ipaddress.h:39,
from ./../include/vrrp_arp.h:33,
from vrrp.c:29:
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/net/if.h:126:8: note: originally defined here
struct ifreq
^
In file included from /trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/linux/netdevice.h:28:0,
from ./../include/vrrp_if.h:36,
from ./../include/vrrp_ipaddress.h:39,
from ./../include/vrrp_arp.h:33,
from vrrp.c:29:
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/linux/if.h:278:8: error: redefinition of 'struct ifconf'
struct ifconf {
^
In file included from ./../include/vrrp_if.h:28:0,
from ./../include/vrrp_ipaddress.h:39,
from ./../include/vrrp_arp.h:33,
from vrrp.c:29:
/trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/net/if.h:176:8: note: originally defined here
struct ifconf

@pqarmitage
Copy link
Collaborator

Conflict between glibc and linux header files is a nightmare, although the Linux header files are moving to a position of being able to be included after glibc header files without causing conflicts.

I note that you are using a somewhat old version of gcc. Can you please provide the version of the glibc header files that you are using, and also the version of the kernel header files installed in /trunk/staging_dir/toolchain-x86_64_gcc-5.5.0_glibc/include/linux.

It would also be helpful if you could advise whether _HAVE_NET_LINUX_IF_H_COLLISION_ is defined in file lib/config.h.

@pqarmitage
Copy link
Collaborator

Closing due to no update for over 3 weeks. If there is a further update, the issue can be reopened.

@feckert
Copy link
Contributor

feckert commented May 8, 2018

@pqarmitage I have a similar problem to build the new keepalived 1.4.3 against the current openwrt master!
I get the following output

ormat-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -D_GNU_SOURCE -MT keepalived_netlink.o -MD -MP -MF .deps/keepalived_netlink.Tpo -c -o keepalived_netlink.o keepalived_netlink.c
In file included from /home/feckert/workspace/lede/LDM-master/build/openwrt/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/include/net/ethernet.h:10:0,
from ./../include/vrrp_vmac.h:32,
from keepalived_netlink.c:50:
/home/feckert/workspace/lede/LDM-master/build/openwrt/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/include/netinet/if_ether.h:104:8: error: redefinition of 'struct ethhdr'
struct ethhdr {
^~~~~~
In file included from /home/feckert/workspace/lede/LDM-master/build/openwrt/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/include/linux/netdevice.h:29:0,
from ./../include/vrrp_if.h:36,
from ./../include/keepalived_netlink.h:43,
from keepalived_netlink.c:48:
/home/feckert/workspace/lede/LDM-master/build/openwrt/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/include/linux/if_ether.h:143:8: note: originally defined here
struct ethhdr {
^~~~~~
Makefile:368: recipe for target 'keepalived_netlink.o' failed

The output of lib/config.h for HAVE_NET_LINUX_IF_H_COLLISION

/* Define to 1 if <net/if.h> and <netlink/route/link.h> namespace collision /
/
#undef HAVE_IF_H_LINK_H_COLLISION */

@pqarmitage
Copy link
Collaborator

@feckert Commit afc4508 along wity 58ae2ba fixed this problem, I believe. Can you try pulling the latest code from the master branch and see if that builds OK.

@pqarmitage pqarmitage reopened this May 8, 2018
@feckert
Copy link
Contributor

feckert commented May 8, 2018

@pqarmitage thank you very much for the help it is now compiling :-)
I have added the two patches to the openwrt packages feed on the next PR when update the keepalived version.
The next step is to test it
Thanks

feckert added a commit to TDT-AG/packages that referenced this issue May 8, 2018
bump PKG_VERSION to 1.4.3

To Fix compilation issue cherry-pick two commits from keepalived master tree:
acassen/keepalived@afc4508
acassen/keepalived@58ae2ba

This was discussed on:
acassen/keepalived#835

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
feckert added a commit to TDT-AG/packages that referenced this issue May 8, 2018
bump PKG_VERSION to 1.4.3

To Fix compilation issue cherry-pick two commits from keepalived master tree:
acassen/keepalived@afc4508
acassen/keepalived@58ae2ba

This was discussed on:
acassen/keepalived#835

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
lynxis pushed a commit to lynxis/packages that referenced this issue Jan 3, 2019
bump PKG_VERSION to 1.4.3

To Fix compilation issue cherry-pick two commits from keepalived master tree:
acassen/keepalived@afc4508
acassen/keepalived@58ae2ba

This was discussed on:
acassen/keepalived#835

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants