Missing -lpthread for libssl / libcrypto (LibreSSL) when compiling U-Boot

Andre Heider a.heider at gmail.com
Wed Oct 13 03:27:30 PDT 2021


Close, but:

u-boot 2021.10 seems to use OpenSSL 1.1.x APIs, and the currently used 
LibreSSL 3.3.4 doesn't include those. Updating LibreSSL with [0] plus 
this patch makes it work:

diff --git a/include/u-boot.mk b/include/u-boot.mk
index c0a1e87bf3..8c6941b88a 100644
--- a/include/u-boot.mk
+++ b/include/u-boot.mk
@@ -45,6 +45,9 @@ UBOOT_MAKE_FLAGS = \
     HOSTCC="$(HOSTCC)" \
     HOSTCFLAGS="$(HOST_CFLAGS) $(HOST_CPPFLAGS) -std=gnu11" \
     HOSTLDFLAGS="$(HOST_LDFLAGS)" \
+   STAGING_PREFIX="$(STAGING_DIR_HOST)" \
+   PKG_CONFIG_PATH="$(STAGING_DIR_HOST)/lib/pkgconfig" \
+   PKG_CONFIG_LIBDIR="$(STAGING_DIR_HOST)/lib/pkgconfig" \
     $(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='')

  define Build/U-Boot/Target
diff --git a/package/boot/uboot-mvebu/Makefile 
b/package/boot/uboot-mvebu/Makefile
index e9578a492b..b186d0bde9 100644
--- a/package/boot/uboot-mvebu/Makefile
+++ b/package/boot/uboot-mvebu/Makefile
@@ -53,8 +53,6 @@ UBOOT_TARGETS:= \
     espressobin \
     uDPU

-Build/Exports:=$(Host/Exports)
-
  define Build/Configure
     # enable additional options beyond <device>_defconfig
     echo CONFIG_CMD_SETEXPR=y >> 
$(PKG_BUILD_DIR)/configs/$(UBOOT_CONFIG)_defconfig


There may be a better way to fix Host/Exports.

And package/boot/uboot-mvebu/patches/210-link-libcrypto-static.patch is 
still required.

[0] 
http://patchwork.ozlabs.org/project/openwrt/patch/20210922201852.4546-1-rosenp@gmail.com/



More information about the openwrt-devel mailing list