All of lore.kernel.org
 help / color / mirror / Atom feed
* iproute2 compile and linking errors on Fedora 19
@ 2017-10-31 17:58 Cong Wang
  2017-10-31 18:27 ` Cong Wang
  2017-10-31 21:10 ` Stephen Hemminger
  0 siblings, 2 replies; 11+ messages in thread
From: Cong Wang @ 2017-10-31 17:58 UTC (permalink / raw)
  To: Phil Sutter, Stephen Hemminger; +Cc: Linux Kernel Network Developers

Hi,

The latest iproute2 in git fails with the following compile error on
Fedora 19 (I know it is very old!):

xfrm_state.c: In function ‘usage’:
xfrm_state.c:104:36: error: ‘IPPROTO_MH’ undeclared (first use in this function)
  fprintf(stderr, "%s", strxf_proto(IPPROTO_MH));
                                    ^
xfrm_state.c:104:36: note: each undeclared identifier is reported only
once for each function it appears in
make[1]: *** [xfrm_state.o] Error 1
make[1]: *** Waiting for unfinished jobs....
xfrm_policy.c: In function ‘usage’:
xfrm_policy.c:77:36: error: ‘IPPROTO_MH’ undeclared (first use in this function)
  fprintf(stderr, "%s", strxf_proto(IPPROTO_MH));
                                    ^
xfrm_policy.c:77:36: note: each undeclared identifier is reported only
once for each function it appears in
make[1]: *** [xfrm_policy.o] Error 1
ipxfrm.c: In function ‘xfrm_selector_print’:
ipxfrm.c:479:7: error: ‘IPPROTO_MH’ undeclared (first use in this function)
  case IPPROTO_MH:
       ^
ipxfrm.c:479:7: note: each undeclared identifier is reported only once
for each function it appears in
ipxfrm.c: In function ‘xfrm_selector_upspec_parse’:
ipxfrm.c:1345:8: error: ‘IPPROTO_MH’ undeclared (first use in this function)
   case IPPROTO_MH:
        ^


After fixing it manually by including <xtables.h> in each of these C
files, the compilation is okay but now it fails with linking errors:


xfrm_state.o: In function `xfrm_state_modify.constprop.3':
xfrm_state.c:(.text+0x2337): undefined reference to `strlcpy'
ipnetns.o: In function `netns_identify_pid':
ipnetns.c:(.text+0x10fd): undefined reference to `strlcpy'
ipxfrm.o: In function `xfrm_state_info_print':
ipxfrm.c:(.text+0x1a2a): undefined reference to `strlcat'
ipxfrm.c:(.text+0x1a3c): undefined reference to `strlcat'
ipxfrm.c:(.text+0x1eff): undefined reference to `strlcat'
ipxfrm.o: In function `xfrm_policy_info_print':
ipxfrm.c:(.text+0x2010): undefined reference to `strlcat'
ipxfrm.c:(.text+0x2022): undefined reference to `strlcat'
iproute_lwtunnel.o: In function `parse_encap_seg6':
iproute_lwtunnel.c:(.text+0xa4f): undefined reference to `strlcpy'
ipvrf.o: In function `vrf_switch':
ipvrf.c:(.text+0x7be): undefined reference to `strlcpy'
ipvrf.o: In function `vrf_identify.constprop.2':
ipvrf.c:(.text+0xdbd): undefined reference to `strlcpy'
../lib/libutil.a(bpf.o): In function `bpf_find_mntpt.constprop.10':
bpf.c:(.text+0x64e): undefined reference to `strlcpy'
../lib/libutil.a(bpf.o): In function `bpf_get_work_dir':
bpf.c:(.text+0x99f): undefined reference to `strlcpy'
../lib/libutil.a(fs.o):fs.c:(.text+0x3df): more undefined references
to `strlcpy' follow
collect2: error: ld returned 1 exit status
make[1]: *** [ip] Error 1
make[1]: Leaving directory `/root/iproute2/ip'
make: *** [all] Error 2

This is the GCC on Fedora 19:

# gcc -v
Using built-in specs.
COLLECT_GCC=/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.3/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info
--with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap
--enable-shared --enable-threads=posix --enable-checking=release
--with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-gnu-unique-object
--enable-linker-build-id --with-linker-hash-style=gnu
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto
--enable-plugin --enable-initfini-array --enable-java-awt=gtk
--disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre
--enable-libgcj-multifile --enable-java-maintainer-mode
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar
--disable-libjava-multilib
--with-isl=/builddir/build/BUILD/gcc-4.8.3-20140911/obj-x86_64-redhat-linux/isl-install
--with-cloog=/builddir/build/BUILD/gcc-4.8.3-20140911/obj-x86_64-redhat-linux/cloog-install
--with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.3 20140911 (Red Hat 4.8.3-7) (GCC)


I don't know if people still care about it. I think iproute2 should
compile with older kernels/distros. I can dig this deeper when I have
time.


Thanks.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: iproute2 compile and linking errors on Fedora 19
  2017-10-31 17:58 iproute2 compile and linking errors on Fedora 19 Cong Wang
@ 2017-10-31 18:27 ` Cong Wang
  2017-10-31 18:59   ` Eric Dumazet
  2017-10-31 21:10 ` Stephen Hemminger
  1 sibling, 1 reply; 11+ messages in thread
From: Cong Wang @ 2017-10-31 18:27 UTC (permalink / raw)
  To: Phil Sutter, Stephen Hemminger; +Cc: Linux Kernel Network Developers

On Tue, Oct 31, 2017 at 10:58 AM, Cong Wang <xiyou.wangcong@gmail.com> wrote:
> Hi,
>
> The latest iproute2 in git fails with the following compile error on
> Fedora 19 (I know it is very old!):

v4.11.0 compiles and links fine.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: iproute2 compile and linking errors on Fedora 19
  2017-10-31 18:27 ` Cong Wang
@ 2017-10-31 18:59   ` Eric Dumazet
  2017-10-31 19:16     ` Roman Mashak
  0 siblings, 1 reply; 11+ messages in thread
From: Eric Dumazet @ 2017-10-31 18:59 UTC (permalink / raw)
  To: Cong Wang; +Cc: Phil Sutter, Stephen Hemminger, Linux Kernel Network Developers

On Tue, 2017-10-31 at 11:27 -0700, Cong Wang wrote:
> On Tue, Oct 31, 2017 at 10:58 AM, Cong Wang <xiyou.wangcong@gmail.com> wrote:
> > Hi,
> >
> > The latest iproute2 in git fails with the following compile error on
> > Fedora 19 (I know it is very old!):
> 
> v4.11.0 compiles and links fine.

Same problem here, using Ubuntu trusty

root@edumazet-glaptop3:/usr/src/iproute2# make clean >/dev/null
root@edumazet-glaptop3:/usr/src/iproute2# make

lib
make[1]: Entering directory `/usr/src/iproute2/lib'
    CC       libgenl.o
    CC       ll_map.o
    CC       libnetlink.o
libnetlink.c:118:2: warning: #warning "libmnl required for error
support" [-Wcpp]
 #warning "libmnl required for error support"
  ^
    AR       libnetlink.a
    CC       utils.o
    CC       rt_names.o
    CC       ll_types.o
    CC       ll_proto.o
    CC       ll_addr.o
    CC       inet_proto.o
    CC       namespace.o
    CC       json_writer.o
    CC       json_print.o
    CC       names.o
    CC       color.o
    CC       bpf.o
    CC       exec.o
    CC       fs.o
    CC       dnet_ntop.o
    CC       dnet_pton.o
    CC       ipx_ntop.o
    CC       ipx_pton.o
    CC       mpls_ntop.o
    CC       mpls_pton.o
    AR       libutil.a
make[1]: Leaving directory `/usr/src/iproute2/lib'

ip
make[1]: Entering directory `/usr/src/iproute2/ip'
    CC       ip.o
    CC       ipaddress.o
    CC       ipaddrlabel.o
    CC       iproute.o
    CC       iprule.o
    CC       ipnetns.o
    CC       rtm_map.o
    CC       iptunnel.o
    CC       ip6tunnel.o
    CC       tunnel.o
    CC       ipneigh.o
    CC       ipntable.o
    CC       iplink.o
    CC       ipmaddr.o
    CC       ipmonitor.o
    CC       ipmroute.o
    CC       ipprefix.o
    CC       iptuntap.o
    CC       iptoken.o
    CC       ipxfrm.o
    CC       xfrm_state.o
    CC       xfrm_policy.o
    CC       xfrm_monitor.o
    CC       iplink_dummy.o
    CC       iplink_ifb.o
    CC       iplink_nlmon.o
    CC       iplink_team.o
    CC       iplink_vcan.o
    CC       iplink_vxcan.o
    CC       iplink_vlan.o
    CC       link_veth.o
    CC       link_gre.o
    CC       iplink_can.o
    CC       iplink_xdp.o
    CC       iplink_macvlan.o
    CC       ipl2tp.o
    CC       link_vti.o
    CC       link_vti6.o
    CC       iplink_vxlan.o
    CC       tcp_metrics.o
    CC       iplink_ipoib.o
    CC       ipnetconf.o
    CC       link_ip6tnl.o
    CC       link_iptnl.o
    CC       link_gre6.o
    CC       iplink_bond.o
    CC       iplink_bond_slave.o
    CC       iplink_hsr.o
    CC       iplink_bridge.o
    CC       iplink_bridge_slave.o
    CC       ipfou.o
    CC       iplink_ipvlan.o
    CC       iplink_geneve.o
    CC       iplink_vrf.o
    CC       iproute_lwtunnel.o
    CC       ipmacsec.o
    CC       ipila.o
    CC       ipvrf.o
    CC       iplink_xstats.o
    CC       ipseg6.o
    LINK     ip
xfrm_state.o: In function `xfrm_state_modify.constprop.3':
xfrm_state.c:(.text+0x2458): undefined reference to `strlcpy'
ipnetns.o: In function `netns_identify_pid':
ipnetns.c:(.text+0x12e0): undefined reference to `strlcpy'
ipxfrm.o: In function `xfrm_state_info_print':
ipxfrm.c:(.text+0x1c3b): undefined reference to `strlcat'
ipxfrm.c:(.text+0x1c4d): undefined reference to `strlcat'
ipxfrm.c:(.text+0x215f): undefined reference to `strlcat'
ipxfrm.o: In function `xfrm_policy_info_print':
ipxfrm.c:(.text+0x2299): undefined reference to `strlcat'
ipxfrm.c:(.text+0x22ab): undefined reference to `strlcat'
iproute_lwtunnel.o: In function `parse_encap_seg6':
iproute_lwtunnel.c:(.text+0xa8f): undefined reference to `strlcpy'
ipvrf.o: In function `vrf_switch':
ipvrf.c:(.text+0x87d): undefined reference to `strlcpy'
ipvrf.o: In function `vrf_identify.constprop.2':
ipvrf.c:(.text+0xe4d): undefined reference to `strlcpy'
../lib/libutil.a(bpf.o): In function `bpf_find_mntpt.constprop.10':
bpf.c:(.text+0x766): undefined reference to `strlcpy'
../lib/libutil.a(bpf.o): In function `bpf_get_work_dir':
bpf.c:(.text+0xb07): undefined reference to `strlcpy'
../lib/libutil.a(fs.o):fs.c:(.text+0x44f): more undefined references to
`strlcpy' follow
collect2: error: ld returned 1 exit status
make[1]: *** [ip] Error 1
make[1]: Leaving directory `/usr/src/iproute2/ip'
make: *** [all] Error 2

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: iproute2 compile and linking errors on Fedora 19
  2017-10-31 18:59   ` Eric Dumazet
@ 2017-10-31 19:16     ` Roman Mashak
  2017-10-31 19:25       ` Eric Dumazet
  0 siblings, 1 reply; 11+ messages in thread
From: Roman Mashak @ 2017-10-31 19:16 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Cong Wang, Phil Sutter, Stephen Hemminger,
	Linux Kernel Network Developers

Eric Dumazet <eric.dumazet@gmail.com> writes:


[...]

>     CC       iplink_xstats.o
>     CC       ipseg6.o
>     LINK     ip
> xfrm_state.o: In function `xfrm_state_modify.constprop.3':
> xfrm_state.c:(.text+0x2458): undefined reference to `strlcpy'
> ipnetns.o: In function `netns_identify_pid':
> ipnetns.c:(.text+0x12e0): undefined reference to `strlcpy'
> ipxfrm.o: In function `xfrm_state_info_print':
> ipxfrm.c:(.text+0x1c3b): undefined reference to `strlcat'
> ipxfrm.c:(.text+0x1c4d): undefined reference to `strlcat'
> ipxfrm.c:(.text+0x215f): undefined reference to `strlcat'
> ipxfrm.o: In function `xfrm_policy_info_print':
> ipxfrm.c:(.text+0x2299): undefined reference to `strlcat'
> ipxfrm.c:(.text+0x22ab): undefined reference to `strlcat'
> iproute_lwtunnel.o: In function `parse_encap_seg6':
> iproute_lwtunnel.c:(.text+0xa8f): undefined reference to `strlcpy'
> ipvrf.o: In function `vrf_switch':
> ipvrf.c:(.text+0x87d): undefined reference to `strlcpy'
> ipvrf.o: In function `vrf_identify.constprop.2':
> ipvrf.c:(.text+0xe4d): undefined reference to `strlcpy'
> ../lib/libutil.a(bpf.o): In function `bpf_find_mntpt.constprop.10':
> bpf.c:(.text+0x766): undefined reference to `strlcpy'
> ../lib/libutil.a(bpf.o): In function `bpf_get_work_dir':
> bpf.c:(.text+0xb07): undefined reference to `strlcpy'
> ../lib/libutil.a(fs.o):fs.c:(.text+0x44f): more undefined references to
> `strlcpy' follow
> collect2: error: ld returned 1 exit status
> make[1]: *** [ip] Error 1
> make[1]: Leaving directory `/usr/src/iproute2/ip'
> make: *** [all] Error 2

Latest iproute2 has config.mk instead of Config, where a new kludge
-DNEED_STRLCPY has been added.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: iproute2 compile and linking errors on Fedora 19
  2017-10-31 19:16     ` Roman Mashak
@ 2017-10-31 19:25       ` Eric Dumazet
  2017-10-31 21:06         ` Stephen Hemminger
  0 siblings, 1 reply; 11+ messages in thread
From: Eric Dumazet @ 2017-10-31 19:25 UTC (permalink / raw)
  To: Roman Mashak
  Cc: Cong Wang, Phil Sutter, Stephen Hemminger,
	Linux Kernel Network Developers

On Tue, 2017-10-31 at 15:16 -0400, Roman Mashak wrote:
> Eric Dumazet <eric.dumazet@gmail.com> writes:
> 
> 
> [...]
> 
> >     CC       iplink_xstats.o
> >     CC       ipseg6.o
> >     LINK     ip
> > xfrm_state.o: In function `xfrm_state_modify.constprop.3':
> > xfrm_state.c:(.text+0x2458): undefined reference to `strlcpy'
> > ipnetns.o: In function `netns_identify_pid':
> > ipnetns.c:(.text+0x12e0): undefined reference to `strlcpy'
> > ipxfrm.o: In function `xfrm_state_info_print':
> > ipxfrm.c:(.text+0x1c3b): undefined reference to `strlcat'
> > ipxfrm.c:(.text+0x1c4d): undefined reference to `strlcat'
> > ipxfrm.c:(.text+0x215f): undefined reference to `strlcat'
> > ipxfrm.o: In function `xfrm_policy_info_print':
> > ipxfrm.c:(.text+0x2299): undefined reference to `strlcat'
> > ipxfrm.c:(.text+0x22ab): undefined reference to `strlcat'
> > iproute_lwtunnel.o: In function `parse_encap_seg6':
> > iproute_lwtunnel.c:(.text+0xa8f): undefined reference to `strlcpy'
> > ipvrf.o: In function `vrf_switch':
> > ipvrf.c:(.text+0x87d): undefined reference to `strlcpy'
> > ipvrf.o: In function `vrf_identify.constprop.2':
> > ipvrf.c:(.text+0xe4d): undefined reference to `strlcpy'
> > ../lib/libutil.a(bpf.o): In function `bpf_find_mntpt.constprop.10':
> > bpf.c:(.text+0x766): undefined reference to `strlcpy'
> > ../lib/libutil.a(bpf.o): In function `bpf_get_work_dir':
> > bpf.c:(.text+0xb07): undefined reference to `strlcpy'
> > ../lib/libutil.a(fs.o):fs.c:(.text+0x44f): more undefined references to
> > `strlcpy' follow
> > collect2: error: ld returned 1 exit status
> > make[1]: *** [ip] Error 1
> > make[1]: Leaving directory `/usr/src/iproute2/ip'
> > make: *** [all] Error 2
> 
> Latest iproute2 has config.mk instead of Config, where a new kludge
> -DNEED_STRLCPY has been added.

Oh right, I only was missing a ./configure run to generate things
properly.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: iproute2 compile and linking errors on Fedora 19
  2017-10-31 19:25       ` Eric Dumazet
@ 2017-10-31 21:06         ` Stephen Hemminger
  0 siblings, 0 replies; 11+ messages in thread
From: Stephen Hemminger @ 2017-10-31 21:06 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Roman Mashak, Cong Wang, Phil Sutter, Linux Kernel Network Developers

On Tue, 31 Oct 2017 12:25:15 -0700
Eric Dumazet <eric.dumazet@gmail.com> wrote:

> On Tue, 2017-10-31 at 15:16 -0400, Roman Mashak wrote:
> > Eric Dumazet <eric.dumazet@gmail.com> writes:
> > 
> > 
> > [...]
> >   
> > >     CC       iplink_xstats.o
> > >     CC       ipseg6.o
> > >     LINK     ip
> > > xfrm_state.o: In function `xfrm_state_modify.constprop.3':
> > > xfrm_state.c:(.text+0x2458): undefined reference to `strlcpy'
> > > ipnetns.o: In function `netns_identify_pid':
> > > ipnetns.c:(.text+0x12e0): undefined reference to `strlcpy'
> > > ipxfrm.o: In function `xfrm_state_info_print':
> > > ipxfrm.c:(.text+0x1c3b): undefined reference to `strlcat'
> > > ipxfrm.c:(.text+0x1c4d): undefined reference to `strlcat'
> > > ipxfrm.c:(.text+0x215f): undefined reference to `strlcat'
> > > ipxfrm.o: In function `xfrm_policy_info_print':
> > > ipxfrm.c:(.text+0x2299): undefined reference to `strlcat'
> > > ipxfrm.c:(.text+0x22ab): undefined reference to `strlcat'
> > > iproute_lwtunnel.o: In function `parse_encap_seg6':
> > > iproute_lwtunnel.c:(.text+0xa8f): undefined reference to `strlcpy'
> > > ipvrf.o: In function `vrf_switch':
> > > ipvrf.c:(.text+0x87d): undefined reference to `strlcpy'
> > > ipvrf.o: In function `vrf_identify.constprop.2':
> > > ipvrf.c:(.text+0xe4d): undefined reference to `strlcpy'
> > > ../lib/libutil.a(bpf.o): In function `bpf_find_mntpt.constprop.10':
> > > bpf.c:(.text+0x766): undefined reference to `strlcpy'
> > > ../lib/libutil.a(bpf.o): In function `bpf_get_work_dir':
> > > bpf.c:(.text+0xb07): undefined reference to `strlcpy'
> > > ../lib/libutil.a(fs.o):fs.c:(.text+0x44f): more undefined references to
> > > `strlcpy' follow
> > > collect2: error: ld returned 1 exit status
> > > make[1]: *** [ip] Error 1
> > > make[1]: Leaving directory `/usr/src/iproute2/ip'
> > > make: *** [all] Error 2  
> > 
> > Latest iproute2 has config.mk instead of Config, where a new kludge
> > -DNEED_STRLCPY has been added.  
> 
> Oh right, I only was missing a ./configure run to generate things
> properly.
> 
> 
> 
> 
> 

If you do a
	$ make distclean
then
	$ make

It should take care of it.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: iproute2 compile and linking errors on Fedora 19
  2017-10-31 17:58 iproute2 compile and linking errors on Fedora 19 Cong Wang
  2017-10-31 18:27 ` Cong Wang
@ 2017-10-31 21:10 ` Stephen Hemminger
  2017-10-31 23:28   ` Cong Wang
  1 sibling, 1 reply; 11+ messages in thread
From: Stephen Hemminger @ 2017-10-31 21:10 UTC (permalink / raw)
  To: Cong Wang; +Cc: Phil Sutter, Linux Kernel Network Developers

On Tue, 31 Oct 2017 10:58:46 -0700
Cong Wang <xiyou.wangcong@gmail.com> wrote:

> Hi,
> 
> The latest iproute2 in git fails with the following compile error on
> Fedora 19 (I know it is very old!):
> 
> xfrm_state.c: In function ‘usage’:
> xfrm_state.c:104:36: error: ‘IPPROTO_MH’ undeclared (first use in this function)
>   fprintf(stderr, "%s", strxf_proto(IPPROTO_MH));
>                                     ^
> xfrm_state.c:104:36: note: each undeclared identifier is reported only
> once for each function it appears in
> make[1]: *** [xfrm_state.o] Error 1
> make[1]: *** Waiting for unfinished jobs....
> xfrm_policy.c: In function ‘usage’:
> xfrm_policy.c:77:36: error: ‘IPPROTO_MH’ undeclared (first use in this function)
>   fprintf(stderr, "%s", strxf_proto(IPPROTO_MH));
>                                     ^
> xfrm_policy.c:77:36: note: each undeclared identifier is reported only
> once for each function it appears in
> make[1]: *** [xfrm_policy.o] Error 1
> ipxfrm.c: In function ‘xfrm_selector_print’:
> ipxfrm.c:479:7: error: ‘IPPROTO_MH’ undeclared (first use in this function)
>   case IPPROTO_MH:
>        ^
> ipxfrm.c:479:7: note: each undeclared identifier is reported only once
> for each function it appears in
> ipxfrm.c: In function ‘xfrm_selector_upspec_parse’:
> ipxfrm.c:1345:8: error: ‘IPPROTO_MH’ undeclared (first use in this function)
>    case IPPROTO_MH:
>         ^
> 
> 
> After fixing it manually by including <xtables.h> in each of these C
> files, the compilation is okay but now it fails with linking errors:
> 
> 
> xfrm_state.o: In function `xfrm_state_modify.constprop.3':
> xfrm_state.c:(.text+0x2337): undefined reference to `strlcpy'
> ipnetns.o: In function `netns_identify_pid':
> ipnetns.c:(.text+0x10fd): undefined reference to `strlcpy'
> ipxfrm.o: In function `xfrm_state_info_print':
> ipxfrm.c:(.text+0x1a2a): undefined reference to `strlcat'
> ipxfrm.c:(.text+0x1a3c): undefined reference to `strlcat'
> ipxfrm.c:(.text+0x1eff): undefined reference to `strlcat'
> ipxfrm.o: In function `xfrm_policy_info_print':
> ipxfrm.c:(.text+0x2010): undefined reference to `strlcat'
> ipxfrm.c:(.text+0x2022): undefined reference to `strlcat'
> iproute_lwtunnel.o: In function `parse_encap_seg6':
> iproute_lwtunnel.c:(.text+0xa4f): undefined reference to `strlcpy'
> ipvrf.o: In function `vrf_switch':
> ipvrf.c:(.text+0x7be): undefined reference to `strlcpy'
> ipvrf.o: In function `vrf_identify.constprop.2':
> ipvrf.c:(.text+0xdbd): undefined reference to `strlcpy'
> ../lib/libutil.a(bpf.o): In function `bpf_find_mntpt.constprop.10':
> bpf.c:(.text+0x64e): undefined reference to `strlcpy'
> ../lib/libutil.a(bpf.o): In function `bpf_get_work_dir':
> bpf.c:(.text+0x99f): undefined reference to `strlcpy'
> ../lib/libutil.a(fs.o):fs.c:(.text+0x3df): more undefined references
> to `strlcpy' follow
> collect2: error: ld returned 1 exit status
> make[1]: *** [ip] Error 1
> make[1]: Leaving directory `/root/iproute2/ip'
> make: *** [all] Error 2
> 
> This is the GCC on Fedora 19:
> 
> # gcc -v
> Using built-in specs.
> COLLECT_GCC=/bin/gcc
> COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.3/lto-wrapper
> Target: x86_64-redhat-linux
> Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
> --infodir=/usr/share/info
> --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap
> --enable-shared --enable-threads=posix --enable-checking=release
> --with-system-zlib --enable-__cxa_atexit
> --disable-libunwind-exceptions --enable-gnu-unique-object
> --enable-linker-build-id --with-linker-hash-style=gnu
> --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto
> --enable-plugin --enable-initfini-array --enable-java-awt=gtk
> --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre
> --enable-libgcj-multifile --enable-java-maintainer-mode
> --with-ecj-jar=/usr/share/java/eclipse-ecj.jar
> --disable-libjava-multilib
> --with-isl=/builddir/build/BUILD/gcc-4.8.3-20140911/obj-x86_64-redhat-linux/isl-install
> --with-cloog=/builddir/build/BUILD/gcc-4.8.3-20140911/obj-x86_64-redhat-linux/cloog-install
> --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
> Thread model: posix
> gcc version 4.8.3 20140911 (Red Hat 4.8.3-7) (GCC)
> 
> 
> I don't know if people still care about it. I think iproute2 should
> compile with older kernels/distros. I can dig this deeper when I have
> time.
> 
> 
> Thanks.

IPPROTO_MH comes from include/uapi/linux/in6.h
Maybe it is trying to use old kernel headers from libc.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: iproute2 compile and linking errors on Fedora 19
  2017-10-31 21:10 ` Stephen Hemminger
@ 2017-10-31 23:28   ` Cong Wang
  2017-11-01  6:52     ` Stephen Hemminger
  2018-11-27  0:06     ` Stephen Hemminger
  0 siblings, 2 replies; 11+ messages in thread
From: Cong Wang @ 2017-10-31 23:28 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Phil Sutter, Linux Kernel Network Developers

On Tue, Oct 31, 2017 at 2:10 PM, Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> IPPROTO_MH comes from include/uapi/linux/in6.h
> Maybe it is trying to use old kernel headers from libc.

So newer iproute2 is not supposed to work with older
kernel header??

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: iproute2 compile and linking errors on Fedora 19
  2017-10-31 23:28   ` Cong Wang
@ 2017-11-01  6:52     ` Stephen Hemminger
  2018-11-27  0:06     ` Stephen Hemminger
  1 sibling, 0 replies; 11+ messages in thread
From: Stephen Hemminger @ 2017-11-01  6:52 UTC (permalink / raw)
  To: Cong Wang; +Cc: Phil Sutter, Linux Kernel Network Developers

On Tue, 31 Oct 2017 16:28:20 -0700
Cong Wang <xiyou.wangcong@gmail.com> wrote:

> On Tue, Oct 31, 2017 at 2:10 PM, Stephen Hemminger
> <stephen@networkplumber.org> wrote:
> >
> > IPPROTO_MH comes from include/uapi/linux/in6.h
> > Maybe it is trying to use old kernel headers from libc.  
> 
> So newer iproute2 is not supposed to work with older
> kernel header??

Iproute2 has always supplied it's own sanitized kernel headers.
This allows it to be built on older systems where newer definitions in kernel
headers are missing. If you point the kernel header for either kernel package
or glibc, it can't build.

This was done to avoid having to have source full of #ifdef XXX.
Kernel user API is stable enough that newer versions of iproute2 fine.
If a new feature is requested on old kernel it is reported as an error or ignored.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: iproute2 compile and linking errors on Fedora 19
  2017-10-31 23:28   ` Cong Wang
  2017-11-01  6:52     ` Stephen Hemminger
@ 2018-11-27  0:06     ` Stephen Hemminger
  2018-11-27 11:58       ` Phil Sutter
  1 sibling, 1 reply; 11+ messages in thread
From: Stephen Hemminger @ 2018-11-27  0:06 UTC (permalink / raw)
  To: Cong Wang; +Cc: Phil Sutter, Linux Kernel Network Developers

On Tue, 31 Oct 2017 16:28:20 -0700
Cong Wang <xiyou.wangcong@gmail.com> wrote:

> On Tue, Oct 31, 2017 at 2:10 PM, Stephen Hemminger
> <stephen@networkplumber.org> wrote:
> >
> > IPPROTO_MH comes from include/uapi/linux/in6.h
> > Maybe it is trying to use old kernel headers from libc.  
> 
> So newer iproute2 is not supposed to work with older
> kernel header??

iproute2 is supposed to be completely self contained with its own sanitized kernel
headers. It should not be using kernel headers directly (or through /usr).

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: iproute2 compile and linking errors on Fedora 19
  2018-11-27  0:06     ` Stephen Hemminger
@ 2018-11-27 11:58       ` Phil Sutter
  0 siblings, 0 replies; 11+ messages in thread
From: Phil Sutter @ 2018-11-27 11:58 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Cong Wang, Linux Kernel Network Developers

Hi,

On Mon, Nov 26, 2018 at 04:06:27PM -0800, Stephen Hemminger wrote:
> On Tue, 31 Oct 2017 16:28:20 -0700
> Cong Wang <xiyou.wangcong@gmail.com> wrote:
> 
> > On Tue, Oct 31, 2017 at 2:10 PM, Stephen Hemminger
> > <stephen@networkplumber.org> wrote:
> > >
> > > IPPROTO_MH comes from include/uapi/linux/in6.h
> > > Maybe it is trying to use old kernel headers from libc.  

That header defines it only if __UAPI_DEF_IPPROTO_V6 is defined to a
non-zero value. When compiling upstream iproute2 on my system, this is
not the case. I also see why:

- ip/xfrm_policy.c includes <netdb.h>
  - netdb.h includes <netinet/in.h>
    - netinet/in.h defines _NETINET_IN_H
- ip/xfrm_policy.c then includes "xfrm.h"
  - ip/xfrm.h includes <linux/xfrm.h>
    - linux/xfrm.h includes <linux/in6.h>
      - linux/in6.h includes <linux/libc-compat.h>
        - linux/libc-compat.h defines __UAPI_DEF_IPPROTO_V6 to 0 if
	  _NETINET_IN_H is defined.

Note that I didn't follow all includes so the above is not necessarily
what exactly happens. But either way, ip/xfrm_policy.c doesn't get
IPPROTO_MH define from include/uapi/linux/in6.h.

Cheers, Phil

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-11-27 22:56 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-31 17:58 iproute2 compile and linking errors on Fedora 19 Cong Wang
2017-10-31 18:27 ` Cong Wang
2017-10-31 18:59   ` Eric Dumazet
2017-10-31 19:16     ` Roman Mashak
2017-10-31 19:25       ` Eric Dumazet
2017-10-31 21:06         ` Stephen Hemminger
2017-10-31 21:10 ` Stephen Hemminger
2017-10-31 23:28   ` Cong Wang
2017-11-01  6:52     ` Stephen Hemminger
2018-11-27  0:06     ` Stephen Hemminger
2018-11-27 11:58       ` Phil Sutter

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.