Error for iproute2 compile

collect2: error: ld returned 1 exit status
make[5]: *** [Makefile:34: ip] Error 1
make[5]: Leaving directory '/home/newton/Desktop/openwrt_x86_64/build_dir/target-x86_64_musl/linux-x86_64/iproute2-tc/iproute2-5.11.0/ip'
make[4]: *** [Makefile:64: all] Error 2
make[4]: Leaving directory '/home/newton/Desktop/openwrt_x86_64/build_dir/target-x86_64_musl/linux-x86_64/iproute2-tc/iproute2-5.11.0'
make[3]: *** [Makefile:210: /home/newton/Desktop/openwrt_x86_64/build_dir/target-x86_64_musl/linux-x86_64/iproute2-tc/iproute2-5.11.0/.built] Error 2
make[3]: Leaving directory '/home/newton/Desktop/openwrt_x86_64/package/network/utils/iproute2'
time: package/network/utils/iproute2/tc/compile#19.18#3.98#22.60
    ERROR: package/network/utils/iproute2 failed to build (build variant: tc).
make[2]: *** [package/Makefile:117: package/network/utils/iproute2/compile] Error 1
make[2]: Leaving directory '/home/newton/Desktop/openwrt_x86_64'
make[1]: *** [package/Makefile:108: /home/newton/Desktop/openwrt_x86_64/staging_dir/target-x86_64_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/newton/Desktop/openwrt_x86_64'
make: *** [/home/newton/Desktop/openwrt_x86_64/include/toplevel.mk:230: world] Error 2

Target: x86_64
OS: Majaro KDE
Code: latest Master branch

I have facing this problem for many times.

I need Help!

Getting the same errors when compiling for x86_64!

sh configure /home/echelon/works/openwrt/build_dir/target-x86_64_glibc/linux-x86_64/linux-5.4.106/user_headers/include
TC schedulers
 ATM    no
 IPT    using xtables
 IPSET  yes

iptables modules directory: /usr/lib/iptables
libc has setns: yes
SELinux support: no
libbpf support: no
        libbpf version 0.3.0 is too low, please update it to at least 0.1.0
        LIBBPF_FORCE=on set, but couldn't find a usable libbpf
make[4]: *** [Makefile:84: config.mk] Error 1
make[4]: Leaving directory '/home/echelon/works/openwrt/build_dir/target-x86_64_glibc/linux-x86_64/iproute2-tcfull/iproute2-5.11.0'
make[3]: *** [Makefile:237: /home/echelon/works/openwrt/build_dir/target-x86_64_glibc/linux-x86_64/iproute2-tcfull/iproute2-5.11.0/.built] Error 2
make[3]: Leaving directory '/home/echelon/works/openwrt/package/network/utils/iproute2'
time: package/network/utils/iproute2/tcfull/compile#0.69#0.09#0.70
    ERROR: package/network/utils/iproute2 failed to build (build variant: tcfull).
make[2]: *** [package/Makefile:120: package/network/utils/iproute2/compile] Error 1
make[2]: Leaving directory '/home/echelon/works/openwrt'
make[1]: *** [package/Makefile:108: /home/echelon/works/openwrt/staging_dir/target-x86_64_glibc/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/echelon/works/openwrt'
make: *** [/home/echelon/works/openwrt/include/toplevel.mk:230: world] Error 2

Does anyone knows any workaround?

Found out a sort of workaround, the iproute2 configure script doesn't have proper libbpf version number comparison logic, it only has this following check which include compiling iproute2 sample code if it's failed or problematic then failing totally :

    if ! have_libbpf_basic; then
        echo "no"
       echo "	libbpf version $LIBBPF_VERSION is too low, please update it to at least 0.1.0"
       check_force_libbpf_on
       return
    else

For my condition replacing the ../iproute2/patches/100-configure.patch file/content with the following is working fine for me.

Also somehow there is a patch to remove libbsd dependency but in my part, i need to add +libbsd in DEPENDS part of my iproute2's Makefile, for example

define Package/ip-full
$(call Package/iproute2/Default)
  TITLE:=Routing control utility (full)
  VARIANT:=ipfull
  PROVIDES:=ip
  ALTERNATIVES:=300:/sbin/ip:/usr/libexec/ip-full
  DEPENDS:=+libnl-tiny +libbpf +libbsd +(PACKAGE_devlink||PACKAGE_rdma):libmnl
endef

I'm not sure if your problem is the same one, although from the error message, it looks like it is.

This error occurs when using libintl-full and is due to iproute2 including a new check for libbpf in the configure script, where the test program in the configure script does not link against libintl. The error is not obvious, as the configure script redirects stderr to /dev/null and the output error just complains about a version number.

I have submitted a patch for this already to the openwrt-devel list. If you're impatient and want to patch it yourself, here is the patch I submitted, which still needs review

1 Like

Your work seems more proper and also working fine in here :smile:, great job imo.

@dl12345 I am having a similar problem with the E8450. I am getting this error:
ERROR: package/network/utils/iproute2 failed to build (build variant: tcfull).

2022-03-10T20:32:31.1396629Z make[4]: Entering directory '/home/runner/work/myopenwrt/myopenwrt/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/iproute2-tcfull/iproute2-5.15.0'
2022-03-10T20:32:31.1443381Z TC schedulers
2022-03-10T20:32:31.1451737Z  ATM	no
2022-03-10T20:32:31.1907686Z  IPT	using xtables
2022-03-10T20:32:31.2257580Z  IPSET  yes
2022-03-10T20:32:31.2265519Z 
2022-03-10T20:32:31.2298157Z iptables modules directory: /usr/lib/iptables
2022-03-10T20:32:31.2621822Z libc has setns: yes
2022-03-10T20:32:31.2985158Z libc has name_to_handle_at: yes
2022-03-10T20:32:31.2993807Z SELinux support: no
2022-03-10T20:32:31.3040878Z libbpf support: no
2022-03-10T20:32:31.3041593Z 	LIBBPF_FORCE=on set, but couldn't find a usable libbpf
2022-03-10T20:32:31.3054402Z make[4]: *** [Makefile:84: config] Error 1
2022-03-10T20:32:31.3055558Z make[4]: Leaving directory '/home/runner/work/myopenwrt/myopenwrt/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/iproute2-tcfull/iproute2-5.15.0'
2022-03-10T20:32:31.3056676Z make[3]: *** [Makefile:271: /home/runner/work/myopenwrt/myopenwrt/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/iproute2-tcfull/iproute2-5.15.0/.built] Error 2
2022-03-10T20:32:31.3057474Z make[3]: Leaving directory '/home/runner/work/myopenwrt/myopenwrt/openwrt/package/network/utils/iproute2'
2022-03-10T20:32:31.3065802Z time: package/network/utils/iproute2/tcfull/compile#0.49#0.20#0.63
2022-03-10T20:32:31.3070099Z     ERROR: package/network/utils/iproute2 failed to build (build variant: tcfull).
2022-03-10T20:32:31.3078888Z make[2]: *** [package/Makefile:119: package/network/utils/iproute2/compile] Error 1
2022-03-10T20:32:31.3084829Z make[2]: Leaving directory '/home/runner/work/myopenwrt/myopenwrt/openwrt'

This is my diff.config:

CONFIG_DEVEL=y
CONFIG_BUSYBOX_CUSTOM=y
CONFIG_BUILD_LOG=y
CONFIG_BUSYBOX_CONFIG_FEATURE_EDITING_SAVEHISTORY=y
CONFIG_BUSYBOX_CONFIG_FEATURE_EDITING_SAVE_ON_EXIT=y
CONFIG_BUSYBOX_CONFIG_FEATURE_LESS_FLAGS=y
CONFIG_BUSYBOX_CONFIG_FEATURE_LESS_REGEXP=y
CONFIG_BUSYBOX_CONFIG_FEATURE_LESS_WINCH=y
CONFIG_DEBUG=y
CONFIG_DROPBEAR_ECC=y
CONFIG_IMAGEOPT=y
CONFIG_INCLUDE_CONFIG=y
CONFIG_LIBCURL_COOKIES=y
CONFIG_LIBCURL_FILE=y
CONFIG_LIBCURL_FTP=y
CONFIG_LIBCURL_HTTP=y
CONFIG_LIBCURL_NGHTTP2=y
CONFIG_LIBCURL_NO_SMB="!"
CONFIG_LIBCURL_OPENSSL=y
CONFIG_LIBCURL_PROXY=y
# CONFIG_LUCI_JSMIN is not set
CONFIG_OPENSSL_ENGINE=y
CONFIG_OPENSSL_WITH_ASM=y
CONFIG_OPENSSL_WITH_CHACHA_POLY1305=y
CONFIG_OPENSSL_WITH_CMS=y
CONFIG_OPENSSL_WITH_DEPRECATED=y
CONFIG_OPENSSL_WITH_ERROR_MESSAGES=y
CONFIG_OPENSSL_WITH_PSK=y
CONFIG_OPENSSL_WITH_SRP=y
CONFIG_OPENSSL_WITH_TLS13=y
CONFIG_PACKAGE_NTFS-3G_HAS_PROBE=y
CONFIG_PACKAGE_adblock=y
CONFIG_PACKAGE_block-mount=y
CONFIG_PACKAGE_ccrypt=y
CONFIG_PACKAGE_cgi-io=y
CONFIG_PACKAGE_collectd=y
CONFIG_PACKAGE_coreutils=y
CONFIG_PACKAGE_coreutils-sort=y
CONFIG_PACKAGE_curl=y
CONFIG_PACKAGE_ddns-scripts=y
CONFIG_PACKAGE_ddns-scripts-services=y
CONFIG_PACKAGE_diffutils=y
CONFIG_PACKAGE_gdbserver=y
CONFIG_PACKAGE_hostapd-utils=y
CONFIG_PACKAGE_iptables-mod-ipopt=y
CONFIG_PACKAGE_iptables-nft=y
CONFIG_PACKAGE_kmod-crypto-arc4=y
CONFIG_PACKAGE_kmod-crypto-des=y
CONFIG_PACKAGE_kmod-crypto-ecb=y
CONFIG_PACKAGE_kmod-crypto-kpp=y
CONFIG_PACKAGE_kmod-crypto-lib-blake2s=y
CONFIG_PACKAGE_kmod-crypto-lib-chacha20=y
CONFIG_PACKAGE_kmod-crypto-lib-chacha20poly1305=y
CONFIG_PACKAGE_kmod-crypto-lib-curve25519=y
CONFIG_PACKAGE_kmod-crypto-lib-poly1305=y
CONFIG_PACKAGE_kmod-crypto-md4=y
CONFIG_PACKAGE_kmod-crypto-md5=y
CONFIG_PACKAGE_kmod-crypto-sha1=y
CONFIG_PACKAGE_kmod-crypto-sha512=y
CONFIG_PACKAGE_kmod-fs-cifs=y
CONFIG_PACKAGE_kmod-fuse=y
CONFIG_PACKAGE_kmod-gre=y
CONFIG_PACKAGE_kmod-ifb=y
CONFIG_PACKAGE_kmod-ip6tables=y
CONFIG_PACKAGE_kmod-ipt-core=y
CONFIG_PACKAGE_kmod-ipt-ipopt=y
CONFIG_PACKAGE_kmod-iptunnel=y
CONFIG_PACKAGE_kmod-iptunnel4=y
CONFIG_PACKAGE_kmod-lib-crc16=y
CONFIG_PACKAGE_kmod-mppe=y
CONFIG_PACKAGE_kmod-nf-conntrack-netlink=y
CONFIG_PACKAGE_kmod-nf-ipt=y
CONFIG_PACKAGE_kmod-nf-ipt6=y
CONFIG_PACKAGE_kmod-nft-compat=y
CONFIG_PACKAGE_kmod-pptp=y
CONFIG_PACKAGE_kmod-sched-cake=y
CONFIG_PACKAGE_kmod-sched-core=y
CONFIG_PACKAGE_kmod-scsi-core=y
CONFIG_PACKAGE_kmod-sit=y
CONFIG_PACKAGE_kmod-tun=y
CONFIG_PACKAGE_kmod-udptunnel4=y
CONFIG_PACKAGE_kmod-udptunnel6=y
CONFIG_PACKAGE_kmod-wireguard=y
CONFIG_PACKAGE_libcap-ng=y
CONFIG_PACKAGE_libcurl=y
CONFIG_PACKAGE_libiptext=y
CONFIG_PACKAGE_libiptext-nft=y
CONFIG_PACKAGE_libiptext6=y
CONFIG_PACKAGE_libiwinfo-lua=y
CONFIG_PACKAGE_libltdl=y
CONFIG_PACKAGE_liblua=y
CONFIG_PACKAGE_liblucihttp=y
CONFIG_PACKAGE_liblucihttp-lua=y
CONFIG_PACKAGE_libncurses=y
CONFIG_PACKAGE_libnghttp2=y
CONFIG_PACKAGE_libopenssl=y
CONFIG_PACKAGE_libopenssl-conf=y
CONFIG_PACKAGE_liboping=y
CONFIG_PACKAGE_libpcap=y
CONFIG_PACKAGE_libpcre=y
CONFIG_PACKAGE_librrd1=y
CONFIG_PACKAGE_librt=y
CONFIG_PACKAGE_libubus-lua=y
CONFIG_PACKAGE_libuci-lua=y
CONFIG_PACKAGE_libuuid=y
# CONFIG_PACKAGE_libwolfssl is not set
CONFIG_PACKAGE_libxtables=y
CONFIG_PACKAGE_lua=y
CONFIG_PACKAGE_miniupnpd-nftables=y
CONFIG_PACKAGE_mtr=y
CONFIG_PACKAGE_nlbwmon=y
CONFIG_PACKAGE_openssl-util=y
CONFIG_PACKAGE_patch=y
CONFIG_PACKAGE_ppp-mod-pptp=y
CONFIG_PACKAGE_resolveip=y
CONFIG_PACKAGE_rpcd=y
CONFIG_PACKAGE_rpcd-mod-file=y
CONFIG_PACKAGE_rpcd-mod-iwinfo=y
CONFIG_PACKAGE_rpcd-mod-luci=y
CONFIG_PACKAGE_rpcd-mod-rrdns=y
CONFIG_PACKAGE_rrdtool1=y
CONFIG_PACKAGE_sqm-scripts=y
CONFIG_PACKAGE_tc-mod-iptables=y
CONFIG_PACKAGE_tc-tiny=y
CONFIG_PACKAGE_tcpdump-mini=y
CONFIG_PACKAGE_terminfo=y
CONFIG_PACKAGE_tree=y
CONFIG_PACKAGE_uhttpd=y
CONFIG_PACKAGE_uhttpd-mod-ubus=y
CONFIG_PACKAGE_wget-ssl=y
CONFIG_PACKAGE_wireguard-tools=y
CONFIG_PACKAGE_zlib=y
CONFIG_PREINITOPT=y
CONFIG_TARGET_PREINIT_TIMEOUT=5
# CONFIG_WPA_WOLFSSL is not set
#
# DEVICE INFO
#
CONFIG_TARGET_mediatek=y
CONFIG_TARGET_mediatek_mt7622=y
CONFIG_TARGET_mediatek_mt7622_DEVICE_linksys_e8450-ubi=y
#
# CUSTOM PACKAGE SET
#
CONFIG_PACKAGE_nano-plus=y
CONFIG_PACKAGE_htop=y
CONFIG_PACKAGE_ncdu=y
CONFIG_PACKAGE_iperf3=y
CONFIG_PACKAGE_irqbalance=y
CONFIG_PACKAGE_auc=y
CONFIG_PACKAGE_ca-certificates=y
# CONFIG_PACKAGE_wpad-basic-wolfssl is not set
# CONFIG_PACKAGE_libustream-wolfssl is not set
# CONFIG_PACKAGE_px5g-wolfssl is not set
CONFIG_PACKAGE_wpad-openssl=y
CONFIG_PACKAGE_libustream-openssl=y
CONFIG_PACKAGE_luci=y
CONFIG_PACKAGE_luci-compat=y
CONFIG_PACKAGE_luci-mod-dashboard=y
CONFIG_PACKAGE_luci-app-attendedsysupgrade=y
CONFIG_PACKAGE_luci-app-vnstat2=y
CONFIG_PACKAGE_luci-app-nlbwmon=y
CONFIG_PACKAGE_luci-app-adblock=y
CONFIG_PACKAGE_luci-app-banip=y
CONFIG_PACKAGE_luci-app-bcp38=y
CONFIG_PACKAGE_luci-app-commands=y
CONFIG_PACKAGE_luci-app-ddns=y
CONFIG_PACKAGE_ddns-scripts-noip=y
CONFIG_PACKAGE_luci-app-openvpn=y
# CONFIG_PACKAGE_luci-ssl-openssl is not set
CONFIG_PACKAGE_luci-app-sqm=y
CONFIG_PACKAGE_luci-app-wireguard=y
CONFIG_PACKAGE_luci-app-upnp=y
CONFIG_PACKAGE_luci-app-uhttpd=y
CONFIG_PACKAGE_luci-app-statistics=y
CONFIG_PACKAGE_collectd-mod-conntrack=y
CONFIG_PACKAGE_collectd-mod-cpu=y
CONFIG_PACKAGE_collectd-mod-cpufreq=y
CONFIG_PACKAGE_collectd-mod-dhcpleases=y
CONFIG_PACKAGE_collectd-mod-entropy=y
CONFIG_PACKAGE_collectd-mod-exec=y
CONFIG_PACKAGE_collectd-mod-interface=y
CONFIG_PACKAGE_collectd-mod-iwinfo=y
CONFIG_PACKAGE_collectd-mod-load=y
CONFIG_PACKAGE_collectd-mod-memory=y
CONFIG_PACKAGE_collectd-mod-network=y
CONFIG_PACKAGE_collectd-mod-ping=y
CONFIG_PACKAGE_collectd-mod-rrdtool=y
CONFIG_PACKAGE_collectd-mod-sqm=y
CONFIG_PACKAGE_collectd-mod-thermal=y
CONFIG_PACKAGE_collectd-mod-uptime=y
CONFIG_PACKAGE_collectd-mod-wireless=y
CONFIG_PACKAGE_blockd=y
CONFIG_PACKAGE_cryptsetup=y
CONFIG_PACKAGE_e2fsprogs=y
CONFIG_PACKAGE_f2fs-tools=y
CONFIG_PACKAGE_kmod-fs-exfat=y
CONFIG_PACKAGE_kmod-fs-ext4=y
CONFIG_PACKAGE_kmod-fs-f2fs=y
CONFIG_PACKAGE_kmod-fs-hfs=y
CONFIG_PACKAGE_kmod-fs-hfsplus=y
CONFIG_PACKAGE_kmod-fs-msdos=y
CONFIG_PACKAGE_kmod-fs-nfs=y
CONFIG_PACKAGE_kmod-fs-nfs-common=y
CONFIG_PACKAGE_kmod-fs-nfs-v3=y
CONFIG_PACKAGE_kmod-fs-nfs-v4=y
CONFIG_PACKAGE_kmod-fs-vfat=y
CONFIG_PACKAGE_kmod-nls-base=y
CONFIG_PACKAGE_kmod-nls-cp1250=y
CONFIG_PACKAGE_kmod-nls-cp437=y
CONFIG_PACKAGE_kmod-nls-cp850=y
CONFIG_PACKAGE_kmod-nls-iso8859-1=y
CONFIG_PACKAGE_kmod-nls-iso8859-15=y
CONFIG_PACKAGE_kmod-nls-utf8=y
CONFIG_PACKAGE_kmod-usb-storage=y
CONFIG_PACKAGE_kmod-usb-storage-uas=y
CONFIG_PACKAGE_libblkid=y
CONFIG_PACKAGE_ntfs-3g=y
CONFIG_PACKAGE_nfs-utils=y
CONFIG_PACKAGE_ip6tables-mod-nat=y
CONFIG_PACKAGE_6in4=y
CONFIG_PACKAGE_6rd=y
CONFIG_PACKAGE_6to4=y
CONFIG_PACKAGE_ip6tables-nft=y
CONFIG_PACKAGE_luci-theme-argon=y
CONFIG_PACKAGE_luci-app-argon-config=y
CONFIG_PACKAGE_luci-lib-ipkg=y

Any idea on how to fix it?

I'm having this same error with I'm guessing it is some make file not recgonising some new changes in dependancys again.
you could try downgrading your feeds or sources for these packages impacted ?
I'm just going to wait till it is fixed.

I have been having this issue intermittently. I am building the same diffconfig file in my PC and as a github action. yesterday evening, the PC was able to complete the build without errors, while the gh action got the error.
I left the job running again in both systems —the same job, same script, same config— and then the gh action was successful while my PC failed.

At this point, I am completely lost.

I disabled iproute in menuconfig and renabled it and it compiled afterwards.
I guess some required library (likely LIBBFP) or a dependanct to compile it was not auto selected from an upstream change?

That is not the problem. It seems that it always fails the first time and works the second time. No need to use make menuconfig or defconfig.
I have created an issue to track it officially.

I believe I have found the issue. The problem was in the Makefile. This is the patch:

diff --git a/package/network/utils/iproute2/Makefile b/package/network/utils/iproute2/Makefile
index 55c00a0d6d..465f107575 100644
--- a/package/network/utils/iproute2/Makefile
+++ b/package/network/utils/iproute2/Makefile
@@ -75,7 +75,7 @@ $(call Package/iproute2/Default)
   VARIANT:=tcfull
   PROVIDES:=tc
   ALTERNATIVES:=400:/sbin/tc:/usr/libexec/tc-full
-  DEPENDS:=+kmod-sched-core +(PACKAGE_devlink||PACKAGE_rdma):libmnl +libbpf +libxtables +tc-mod-iptables
+  DEPENDS:=+kmod-sched-core +libbpf +libxtables +tc-mod-iptables +(PACKAGE_devlink||PACKAGE_rdma):libmnl
 endef
 
 define Package/tc-mod-iptables

Anyone willing to test and commit the fix? I have tested it with images for the R8450 (aarch64) and R7800 (arm).