[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171031221006.13cf9be8@shemminger-XPS-13-9360>
Date: Tue, 31 Oct 2017 22:10:06 +0100
From: Stephen Hemminger <stephen@...workplumber.org>
To: Cong Wang <xiyou.wangcong@...il.com>
Cc: Phil Sutter <phil@....cc>,
Linux Kernel Network Developers <netdev@...r.kernel.org>
Subject: Re: iproute2 compile and linking errors on Fedora 19
On Tue, 31 Oct 2017 10:58:46 -0700
Cong Wang <xiyou.wangcong@...il.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.
Powered by blists - more mailing lists