OpenWrt Forum Archive

Topic: Unable to compile U-Boot

The content of this topic has been archived on 22 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

After U-Boot upgrade to 2014.10 I am unable to compile it.

make[4]: Entering directory `/home/openwrt/openwrt/trunk/build_dir/host/u-boot-2014.10'
  CHK     include/config/uboot.release
  CHK     include/generated/version_autogenerated.h
  CHK     include/generated/timestamp_autogenerated.h
  UPD     include/generated/timestamp_autogenerated.h
  HOSTCC  tools/dumpimage.o
  HOSTCC  tools/image-host.o
  HOSTCC  tools/mkenvimage.o
  HOSTCC  tools/mkimage.o
  HOSTLD  tools/mkenvimage
  HOSTLD  tools/dumpimage
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libcrypto.a(c_zlib.o): In function `bio_zlib_free':
(.text+0x4d): undefined reference to `inflateEnd'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libcrypto.a(c_zlib.o): In function `bio_zlib_free':
(.text+0x6b): undefined reference to `deflateEnd'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libcrypto.a(c_zlib.o): In function `bio_zlib_ctrl':
(.text+0x284): undefined reference to `deflate'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libcrypto.a(c_zlib.o): In function `bio_zlib_ctrl':
(.text+0x342): undefined reference to `zError'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libcrypto.a(c_zlib.o): In function `zlib_stateful_expand_block':
(.text+0x411): undefined reference to `inflate'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libcrypto.a(c_zlib.o): In function `zlib_stateful_compress_block':
(.text+0x4ca): undefined reference to `deflate'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libcrypto.a(c_zlib.o): In function `zlib_stateful_finish':
(.text+0x51f): undefined reference to `inflateEnd'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libcrypto.a(c_zlib.o): In function `zlib_stateful_finish':
(.text+0x528): undefined reference to `deflateEnd'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libcrypto.a(c_zlib.o): In function `zlib_stateful_init':
(.text+0x5d7): undefined reference to `inflateInit_'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libcrypto.a(c_zlib.o): In function `zlib_stateful_init':
(.text+0x659): undefined reference to `deflateInit_'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libcrypto.a(c_zlib.o): In function `bio_zlib_read':
(.text+0x893): undefined reference to `inflate'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libcrypto.a(c_zlib.o): In function `bio_zlib_read':
(.text+0x90d): undefined reference to `zError'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libcrypto.a(c_zlib.o): In function `bio_zlib_read':
(.text+0x97c): undefined reference to `inflateInit_'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libcrypto.a(c_zlib.o): In function `bio_zlib_write':
(.text+0xaab): undefined reference to `deflate'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libcrypto.a(c_zlib.o): In function `bio_zlib_write':
(.text+0xb3d): undefined reference to `zError'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libcrypto.a(c_zlib.o): In function `bio_zlib_write':
(.text+0xbcd): undefined reference to `deflateInit_'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup':
(.text+0x19): undefined reference to `dlopen'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup':
(.text+0x2c): undefined reference to `dlsym'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup':
(.text+0x37): undefined reference to `dlclose'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_func':
(.text+0x354): undefined reference to `dlsym'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_func':
(.text+0x3fb): undefined reference to `dlerror'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_var':
(.text+0x474): undefined reference to `dlsym'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_var':
(.text+0x52e): undefined reference to `dlerror'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_load':
(.text+0x5a2): undefined reference to `dlopen'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_load':
(.text+0x60b): undefined reference to `dlclose'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_load':
(.text+0x638): undefined reference to `dlerror'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_pathbyaddr':
(.text+0x6cd): undefined reference to `dladdr'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_pathbyaddr':
(.text+0x729): undefined reference to `dlerror'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_unload':
(.text+0x78a): undefined reference to `dlclose'
collect2: error: ld returned 1 exit status
make[5]: *** [tools/dumpimage] Error 1
make[4]: *** [tools-only] Error 2
make[4]: Leaving directory `/home/openwrt/openwrt/trunk/build_dir/host/u-boot-2014.10' 

My system is Debian 7.7 (amd64). I know it must be something missing somewhere, but I am unable to find what. sad
Nearly identical bug is already reported here.

You're using the wrong libcrypto.  The u-boot code is trying to call library functions which don't exist in the library.

Can you provide the output of "scripts/diffconfig.sh" ?

Did you run your config from a clean checkout ?

I was trying to run a normal compile in a Debian 7 VM (cat /etc/debian_version prints 7.7)
and it compiles fine.

Background:
The host/u-boot.... is compiled by tools/mkimage and that is normally NOT cleaned up with a simple "make clean"

I've performed make dirclean several times. I've even deleted everything in staging_dir and build_dir manually.
What do you mean "clean checkout"? I am compiling from trunk, rev. 43797 right now (but this error is several weeks old).

DiffConfig output:

CONFIG_TARGET_brcm47xx=y
CONFIG_TARGET_brcm47xx_generic=y
CONFIG_TARGET_brcm47xx_generic_Broadcom-b43=y
CONFIG_DEVEL=y
CONFIG_TOOLCHAINOPTS=y
CONFIG_B43_FW_SQUASH_COREREVS="5,6,7,8,9,10,11,13,15,16,29"
CONFIG_BUILD_STATIC_TOOLS=y
# CONFIG_GDB is not set
CONFIG_GNUTLS_ALPN=y
CONFIG_GNUTLS_ANON=y
CONFIG_GNUTLS_DTLS_SRTP=y
CONFIG_GNUTLS_HEARTBEAT=y
CONFIG_GNUTLS_OCSP=y
CONFIG_GNUTLS_PSK=y
CONFIG_IMAGEOPT=y
# CONFIG_KERNEL_DEBUG_INFO is not set
# CONFIG_KERNEL_DEBUG_KERNEL is not set
# CONFIG_KERNEL_KALLSYMS is not set
CONFIG_OPENSSL_WITH_EC=y
CONFIG_OPENVPN_nossl_ENABLE_DEF_AUTH=y
CONFIG_OPENVPN_nossl_ENABLE_FRAGMENT=y
CONFIG_OPENVPN_nossl_ENABLE_HTTP=y
CONFIG_OPENVPN_nossl_ENABLE_IPROUTE2=y
CONFIG_OPENVPN_nossl_ENABLE_LZO=y
CONFIG_OPENVPN_nossl_ENABLE_MULTIHOME=y
CONFIG_OPENVPN_nossl_ENABLE_PF=y
CONFIG_OPENVPN_nossl_ENABLE_PORT_SHARE=y
CONFIG_OPENVPN_nossl_ENABLE_SERVER=y
CONFIG_OPENVPN_nossl_ENABLE_SMALL=y
CONFIG_OPENVPN_nossl_ENABLE_SOCKS=y
CONFIG_OPENVPN_openssl_ENABLE_DEF_AUTH=y
CONFIG_OPENVPN_openssl_ENABLE_FRAGMENT=y
CONFIG_OPENVPN_openssl_ENABLE_HTTP=y
CONFIG_OPENVPN_openssl_ENABLE_IPROUTE2=y
CONFIG_OPENVPN_openssl_ENABLE_LZO=y
CONFIG_OPENVPN_openssl_ENABLE_MULTIHOME=y
CONFIG_OPENVPN_openssl_ENABLE_PF=y
CONFIG_OPENVPN_openssl_ENABLE_PORT_SHARE=y
CONFIG_OPENVPN_openssl_ENABLE_SERVER=y
CONFIG_OPENVPN_openssl_ENABLE_SMALL=y
CONFIG_OPENVPN_openssl_ENABLE_SOCKS=y
CONFIG_OPENVPN_openssl_ENABLE_X509_ALT_USERNAME=y
CONFIG_PACKAGE_6in4=m
CONFIG_PACKAGE_6rd=m
CONFIG_PACKAGE_6to4=m
CONFIG_PACKAGE_6tunnel=m
CONFIG_PACKAGE_at=m
CONFIG_PACKAGE_bash=m
CONFIG_PACKAGE_blkid=y
CONFIG_PACKAGE_block-mount=y
CONFIG_PACKAGE_boxbackup=m
CONFIG_PACKAGE_collectd=y
CONFIG_PACKAGE_collectd-mod-interface=y
CONFIG_PACKAGE_collectd-mod-iwinfo=y
CONFIG_PACKAGE_collectd-mod-load=y
CONFIG_PACKAGE_collectd-mod-network=y
CONFIG_PACKAGE_collectd-mod-rrdtool=y
CONFIG_PACKAGE_ddns-scripts=y
CONFIG_PACKAGE_dhcp6-client=m
CONFIG_PACKAGE_dhcp6-server=m
CONFIG_PACKAGE_dosfsck=m
CONFIG_PACKAGE_e2fsprogs=m
CONFIG_PACKAGE_ebtables=m
CONFIG_PACKAGE_etherwake=y
CONFIG_PACKAGE_fetchmail=m
CONFIG_PACKAGE_fetchmail-nossl=m
CONFIG_PACKAGE_hostapd=m
CONFIG_PACKAGE_iconv=m
CONFIG_PACKAGE_imapfilter=y
CONFIG_PACKAGE_ip=y
CONFIG_PACKAGE_ip6tables=m
CONFIG_PACKAGE_iptables-mod-condition=m
CONFIG_PACKAGE_iptables-mod-conntrack-extra=m
CONFIG_PACKAGE_iptables-mod-filter=m
CONFIG_PACKAGE_iptables-mod-ipopt=m
CONFIG_PACKAGE_iptables-mod-led=m
CONFIG_PACKAGE_iptables-mod-lua=m
CONFIG_PACKAGE_iptables-mod-nat-extra=m
CONFIG_PACKAGE_iptables-mod-ulog=y
CONFIG_PACKAGE_iputils-traceroute6=m
CONFIG_PACKAGE_iwcap=m
CONFIG_PACKAGE_iwinfo=m
# CONFIG_PACKAGE_kmod-b43legacy is not set
# CONFIG_PACKAGE_kmod-bgmac is not set
CONFIG_PACKAGE_kmod-block2mtd=m
CONFIG_PACKAGE_kmod-bridge=m
CONFIG_PACKAGE_kmod-button-hotplug=y
CONFIG_PACKAGE_kmod-crypto-authenc=m
CONFIG_PACKAGE_kmod-crypto-cbc=m
CONFIG_PACKAGE_kmod-crypto-crc32c=m
CONFIG_PACKAGE_kmod-crypto-deflate=m
CONFIG_PACKAGE_kmod-crypto-des=m
CONFIG_PACKAGE_kmod-crypto-ecb=y
CONFIG_PACKAGE_kmod-crypto-hash=y
CONFIG_PACKAGE_kmod-crypto-hmac=m
CONFIG_PACKAGE_kmod-crypto-hw-geode=m
CONFIG_PACKAGE_kmod-crypto-hw-hifn-795x=m
CONFIG_PACKAGE_kmod-crypto-hw-padlock=m
CONFIG_PACKAGE_kmod-crypto-iv=m
CONFIG_PACKAGE_kmod-crypto-manager=y
CONFIG_PACKAGE_kmod-crypto-md4=m
CONFIG_PACKAGE_kmod-crypto-md5=m
CONFIG_PACKAGE_kmod-crypto-michael-mic=m
CONFIG_PACKAGE_kmod-crypto-misc=m
CONFIG_PACKAGE_kmod-crypto-null=m
CONFIG_PACKAGE_kmod-crypto-pcompress=y
CONFIG_PACKAGE_kmod-crypto-rng=m
CONFIG_PACKAGE_kmod-crypto-sha1=y
CONFIG_PACKAGE_kmod-crypto-sha256=m
CONFIG_PACKAGE_kmod-crypto-test=m
CONFIG_PACKAGE_kmod-crypto-user=m
CONFIG_PACKAGE_kmod-crypto-wq=m
CONFIG_PACKAGE_kmod-ebtables=m
CONFIG_PACKAGE_kmod-fs-autofs4=m
CONFIG_PACKAGE_kmod-fs-exportfs=m
CONFIG_PACKAGE_kmod-fs-ntfs=m
CONFIG_PACKAGE_kmod-fs-vfat=y
CONFIG_PACKAGE_kmod-fs-xfs=m
CONFIG_PACKAGE_kmod-fuse=m
CONFIG_PACKAGE_kmod-gpio-button-hotplug=m
CONFIG_PACKAGE_kmod-gpio-dev=m
# CONFIG_PACKAGE_kmod-hwmon-core is not set
CONFIG_PACKAGE_kmod-ifb=m
CONFIG_PACKAGE_kmod-input-core=y
CONFIG_PACKAGE_kmod-input-polldev=m
CONFIG_PACKAGE_kmod-ip6tables=m
CONFIG_PACKAGE_kmod-ipt-condition=m
CONFIG_PACKAGE_kmod-ipt-conntrack-extra=m
CONFIG_PACKAGE_kmod-ipt-filter=m
CONFIG_PACKAGE_kmod-ipt-ipopt=m
CONFIG_PACKAGE_kmod-ipt-led=m
CONFIG_PACKAGE_kmod-ipt-lua=m
CONFIG_PACKAGE_kmod-ipt-nat-extra=m
CONFIG_PACKAGE_kmod-ipt-ulog=y
CONFIG_PACKAGE_kmod-iptunnel=m
CONFIG_PACKAGE_kmod-iptunnel4=m
CONFIG_PACKAGE_kmod-iptunnel6=m
CONFIG_PACKAGE_kmod-ipv6=m
CONFIG_PACKAGE_kmod-leds-gpio=m
CONFIG_PACKAGE_kmod-ledtrig-default-on=m
CONFIG_PACKAGE_kmod-ledtrig-gpio=m
CONFIG_PACKAGE_kmod-ledtrig-heartbeat=m
CONFIG_PACKAGE_kmod-ledtrig-morse=m
CONFIG_PACKAGE_kmod-ledtrig-netdev=m
CONFIG_PACKAGE_kmod-ledtrig-netfilter=m
CONFIG_PACKAGE_kmod-ledtrig-timer=m
CONFIG_PACKAGE_kmod-ledtrig-usbdev=m
CONFIG_PACKAGE_kmod-lib-crc32c=m
CONFIG_PACKAGE_kmod-lib-textsearch=y
CONFIG_PACKAGE_kmod-lib-zlib=m
CONFIG_PACKAGE_kmod-llc=m
CONFIG_PACKAGE_kmod-loop=m
CONFIG_PACKAGE_kmod-nf-conntrack6=m
CONFIG_PACKAGE_kmod-nf-ipt6=m
CONFIG_PACKAGE_kmod-nls-base=y
CONFIG_PACKAGE_kmod-nls-cp1250=m
CONFIG_PACKAGE_kmod-nls-cp437=y
CONFIG_PACKAGE_kmod-nls-cp850=m
CONFIG_PACKAGE_kmod-nls-cp852=m
CONFIG_PACKAGE_kmod-nls-iso8859-1=y
CONFIG_PACKAGE_kmod-nls-iso8859-2=m
CONFIG_PACKAGE_kmod-nls-utf8=m
# CONFIG_PACKAGE_kmod-ppp is not set
# CONFIG_PACKAGE_kmod-pps is not set
# CONFIG_PACKAGE_kmod-ptp is not set
CONFIG_PACKAGE_kmod-random-core=m
CONFIG_PACKAGE_kmod-scsi-core=y
CONFIG_PACKAGE_kmod-scsi-generic=m
CONFIG_PACKAGE_kmod-sit=m
CONFIG_PACKAGE_kmod-stp=m
# CONFIG_PACKAGE_kmod-tg3 is not set
CONFIG_PACKAGE_kmod-tun=y
CONFIG_PACKAGE_kmod-usb-brcm47xx=y
CONFIG_PACKAGE_kmod-usb-core=y
CONFIG_PACKAGE_kmod-usb-ohci=y
CONFIG_PACKAGE_kmod-usb-storage=y
CONFIG_PACKAGE_kmod-usb-storage-extras=m
CONFIG_PACKAGE_kmod-usb-uhci=y
CONFIG_PACKAGE_kmod-usb2=y
CONFIG_PACKAGE_libblkid=y
CONFIG_PACKAGE_libcap=m
CONFIG_PACKAGE_libcharset=m
CONFIG_PACKAGE_libelf1=m
CONFIG_PACKAGE_libext2fs=m
CONFIG_PACKAGE_libgmp=y
CONFIG_PACKAGE_libgnutls=y
CONFIG_PACKAGE_libgnutls-openssl=y
CONFIG_PACKAGE_libiconv-full=m
CONFIG_PACKAGE_libintl-full=m
CONFIG_PACKAGE_libiwinfo-lua=y
CONFIG_PACKAGE_libjson=y
CONFIG_PACKAGE_libltdl=y
CONFIG_PACKAGE_liblua=y
CONFIG_PACKAGE_liblzo=y
CONFIG_PACKAGE_libmnl=m
CONFIG_PACKAGE_libncurses=y
CONFIG_PACKAGE_libncursesw=y
CONFIG_PACKAGE_libnettle=y
CONFIG_PACKAGE_libnfnetlink=m
CONFIG_PACKAGE_libopenssl=y
CONFIG_PACKAGE_libpcap=y
CONFIG_PACKAGE_libpcre=y
CONFIG_PACKAGE_libpthread=y
CONFIG_PACKAGE_libreadline=m
CONFIG_PACKAGE_librpc=m
CONFIG_PACKAGE_librrd1=y
CONFIG_PACKAGE_librt=y
CONFIG_PACKAGE_libstdcpp=m
CONFIG_PACKAGE_libsysfs=m
CONFIG_PACKAGE_libubus-lua=y
CONFIG_PACKAGE_libuci-lua=y
CONFIG_PACKAGE_libuuid=y
CONFIG_PACKAGE_lsof=m
CONFIG_PACKAGE_lua=y
CONFIG_PACKAGE_luasocket=m
CONFIG_PACKAGE_luci=y
CONFIG_PACKAGE_luci-app-ddns=y
CONFIG_PACKAGE_luci-app-firewall=y
CONFIG_PACKAGE_luci-app-ntpc=y
CONFIG_PACKAGE_luci-app-statistics=y
CONFIG_PACKAGE_luci-app-watchcat=y
CONFIG_PACKAGE_luci-app-wol=y
CONFIG_PACKAGE_luci-base=y
CONFIG_PACKAGE_luci-i18n-english=y
CONFIG_PACKAGE_luci-lib-httpclient=m
CONFIG_PACKAGE_luci-lib-json=m
CONFIG_PACKAGE_luci-lib-nixio=y
CONFIG_PACKAGE_luci-mod-admin-full=y
CONFIG_PACKAGE_luci-mod-failsafe=m
CONFIG_PACKAGE_luci-proto-ipv6=m
CONFIG_PACKAGE_luci-proto-ppp=y
CONFIG_PACKAGE_luci-proto-relay=m
CONFIG_PACKAGE_luci-theme-bootstrap=y
CONFIG_PACKAGE_luci-theme-openwrt=y
CONFIG_PACKAGE_mountd=m
CONFIG_PACKAGE_msmtp=m
CONFIG_PACKAGE_msmtp-nossl=m
CONFIG_PACKAGE_msmtp-queue=m
CONFIG_PACKAGE_mtd-utils=m
CONFIG_PACKAGE_mtd-utils-doc-loadbios=m
CONFIG_PACKAGE_mtd-utils-docfdisk=m
CONFIG_PACKAGE_mtd-utils-flash-erase=m
CONFIG_PACKAGE_mtd-utils-flash-eraseall=m
CONFIG_PACKAGE_mtd-utils-flash-lock=m
CONFIG_PACKAGE_mtd-utils-flash-otp-dump=m
CONFIG_PACKAGE_mtd-utils-flash-otp-lock=m
CONFIG_PACKAGE_mtd-utils-flash-otp-write=m
CONFIG_PACKAGE_mtd-utils-flash-unlock=m
CONFIG_PACKAGE_mtd-utils-flashcp=m
CONFIG_PACKAGE_mtd-utils-ftl-check=m
CONFIG_PACKAGE_mtd-utils-ftl-format=m
CONFIG_PACKAGE_mtd-utils-jffs2dump=m
CONFIG_PACKAGE_mtd-utils-jffs2reader=m
CONFIG_PACKAGE_mtd-utils-mkfs.jffs2=m
CONFIG_PACKAGE_mtd-utils-mkfs.ubifs=m
CONFIG_PACKAGE_mtd-utils-mtd-debug=m
CONFIG_PACKAGE_mtd-utils-mtdinfo=m
CONFIG_PACKAGE_mtd-utils-nanddump=m
CONFIG_PACKAGE_mtd-utils-nandtest=m
CONFIG_PACKAGE_mtd-utils-nandwrite=m
CONFIG_PACKAGE_mtd-utils-nftl-format=m
CONFIG_PACKAGE_mtd-utils-nftldump=m
CONFIG_PACKAGE_mtd-utils-recv-image=m
CONFIG_PACKAGE_mtd-utils-rfddump=m
CONFIG_PACKAGE_mtd-utils-rfdformat=m
CONFIG_PACKAGE_mtd-utils-serve-image=m
CONFIG_PACKAGE_mtd-utils-sumtool=m
CONFIG_PACKAGE_mtd-utils-ubiattach=m
CONFIG_PACKAGE_mtd-utils-ubicrc32=m
CONFIG_PACKAGE_mtd-utils-ubidetach=m
CONFIG_PACKAGE_mtd-utils-ubiformat=m
CONFIG_PACKAGE_mtd-utils-ubimkvol=m
CONFIG_PACKAGE_mtd-utils-ubinfo=m
CONFIG_PACKAGE_mtd-utils-ubinize=m
CONFIG_PACKAGE_mtd-utils-ubirename=m
CONFIG_PACKAGE_mtd-utils-ubirmvol=m
CONFIG_PACKAGE_mtd-utils-ubirsvol=m
CONFIG_PACKAGE_mtd-utils-ubiupdatevol=m
CONFIG_PACKAGE_mutt=y
CONFIG_PACKAGE_ncat=m
CONFIG_PACKAGE_ncat-ssl=m
CONFIG_PACKAGE_ntpclient=y
CONFIG_PACKAGE_ntpd=m
CONFIG_PACKAGE_odhcp6c=m
# CONFIG_PACKAGE_odhcpd is not set
CONFIG_PACKAGE_openvpn-nossl=m
CONFIG_PACKAGE_openvpn-openssl=y
# CONFIG_PACKAGE_ppp is not set
CONFIG_PACKAGE_relayd=m
CONFIG_PACKAGE_resolveip=y
CONFIG_PACKAGE_rrdtool1=y
CONFIG_PACKAGE_ssmtp=y
CONFIG_PACKAGE_swap-utils=y
CONFIG_PACKAGE_terminfo=y
CONFIG_PACKAGE_uclibcxx=m
CONFIG_PACKAGE_udev=m
CONFIG_PACKAGE_uhttpd=y
CONFIG_PACKAGE_uhttpd-mod-ubus=y
CONFIG_PACKAGE_ulogd=m
CONFIG_PACKAGE_ulogd-mod-pcap=m
CONFIG_PACKAGE_vsftpd=y
CONFIG_PACKAGE_vsftpd-tls=m
CONFIG_PACKAGE_watchcat=y
CONFIG_PACKAGE_wget=m
CONFIG_PACKAGE_wget-nossl=y
CONFIG_PACKAGE_wide-dhcpv6-client=m
CONFIG_PACKAGE_wide-dhcpv6-control=m
CONFIG_PACKAGE_wide-dhcpv6-relay=m
CONFIG_PACKAGE_wide-dhcpv6-server=m
CONFIG_PACKAGE_wifitoggle=m
CONFIG_PACKAGE_wireless-tools=y
CONFIG_PACKAGE_zip=m
CONFIG_PACKAGE_zlib=y
CONFIG_PACKAGE_zoneinfo-core=m
CONFIG_PACKAGE_zoneinfo-europe=m
# CONFIG_PER_FEED_REPO is not set
CONFIG_STRIP_KERNEL_EXPORTS=y
CONFIG_UDEV_EXTRA_accelerometer=y
CONFIG_UDEV_EXTRA_ata_id=y
CONFIG_UDEV_EXTRA_cdrom_id=y
CONFIG_UDEV_EXTRA_input_id=y
CONFIG_UDEV_EXTRA_mtd_probe=y
CONFIG_UDEV_EXTRA_path_id=y
CONFIG_UDEV_EXTRA_qemu=y
CONFIG_UDEV_EXTRA_rule_generator=y
CONFIG_UDEV_EXTRA_scsi_id=y
CONFIG_UDEV_EXTRA_usb_id=y
CONFIG_UDEV_EXTRA_v4l_id=y
CONFIG_USE_MKLIBS=y
CONFIG_VERSIONOPT=y
CONFIG_VERSION_DIST="OpenWrt"
CONFIG_VERSION_HWREV=""
CONFIG_VERSION_MANUFACTURER=""
CONFIG_VERSION_NICK=""
CONFIG_VERSION_NUMBER=""
CONFIG_VERSION_PRODUCT=""
CONFIG_VERSION_REPO="file:/mnt/usb1/trunk/packages"
CONFIG_PACKAGE_kmod-ipt-conntrack=y
CONFIG_PACKAGE_kmod-lib-crc-ccitt=y 

Thanks for posting your diffconfig.

Some quick analysis:

CONFIG_BUILD_STATIC_TOOLS=y

Thats the reason for build failure.

I get build fails with Debian 7.7 (like yours) and Arch Linux

HOSTLD  tools/dumpimage
/usr/bin/ld: cannot find -lssl
/usr/bin/ld: cannot find -lcrypto

So similar problem - Debian links the wrong libcrypto and Arch does not find any.

You probably should write a ticket for that - since its relatively easy to replicate (make tools/mkimage/compile -> errors out from a clean tree with that config option)

(Last edited by zloop on 30 Dec 2014, 19:18)

Thanks a lot, setting CONFIG_BUILD_STATIC_TOOLS=n solved the problem.
Ticket is here.

One can fix the problem locally but STATIC compilation is highly distribution specific

There are 3 solutions:

Solution 1 - partially fix Debian bug - "dirty":
add a 001-fix_debian_static_libs.patch to tools/mkimage/patches/

--- a/tools/Makefile
+++ b/tools/Makefile
@@ -115,7 +115,7 @@ endif
 
 # MXSImage needs LibSSL
 ifneq ($(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_FIT_SIGNATURE),)
-HOSTLOADLIBES_mkimage += -lssl -lcrypto
+HOSTLOADLIBES_mkimage += -lssl -lcrypto -ldl -lz               
 endif
 
 HOSTLOADLIBES_dumpimage := $(HOSTLOADLIBES_mkimage)

This adds the symbols for zlib/libs (like 'inflate') and from libdl (like 'dlopen').
BUT since dlopen is dynamically loading libs you dont really have a static binary.
Thats why you get a compiler warning like

/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup':
(.text+0x19): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

Solution 2: modify the build with custom OpenSSL - "dirty"
Arch Linux does not seem to provide static libraries. So one has to built openssl from source.

#download openssl
./Configure -no-shared -no-dso linux-x86_64
make

#check for wrong symbols (like from your warning):
objdump -x libcrypto.a  |grep dlfcn
objdump -x libcrypto.a  |grep inflateEnd
#output should be (almost?) empty 

you then modify tools/mkimage/Makefile in the Host section where "tools-only" is built to match sth like

    $(MAKE) --trace -C $(HOST_BUILD_DIR) \
        HOSTCC="$(HOSTCC)" \
        HOSTCFLAGS="$(HOST_CFLAGS) -I/path/to/custom/openssl/include" \
        HOSTLDFLAGS="$(HOST_STATIC_LINKING) $(HOST_LDFLAGS) -L/path/to/custom/openssl/" \
                tools-only

with that "--trace" you can see what commands are executed

There seem to be a bug/error when building u-boot-2014.10 now: rsa-sign.c:(.text+0x960): undefined reference to `BN_mod'
this is fixed by the following patch

cat tools/mkimage/patches/001-fix_openssl_includes.patch 
--- a/lib/rsa/rsa-sign.c
+++ b/lib/rsa/rsa-sign.c
@@ -14,6 +14,7 @@
 #include <openssl/err.h>
 #include <openssl/ssl.h>
 #include <openssl/evp.h>
+#include <openssl/bn.h>
 
 #if OPENSSL_VERSION_NUMBER >= 0x10000000L
 #define HAVE_ERR_REMOVE_THREAD_STATE

Result: no complaining (no warnings unlike Solution 1)
FINALLY smile
Solution 3: add tools/openssl package and let it compile the libraries with correct flags
possibly the cleanest

(Last edited by zloop on 30 Dec 2014, 23:28)

The discussion might have continued from here.