From 69be65b594c4fafbc4e58dd3cd235547f02a33ca Mon Sep 17 00:00:00 2001
From: Jo-Philipp Wich <jo@mein.io>
Date: Wed, 11 Jan 2017 02:43:04 +0100
Subject: [PATCH] tools: mkimage: pass crypto libraries through HOST_LOADLIBES
 (FS#381)

Since linker argument order is significant on modern host compilers, pass
the required libcrypto libraries through the HOST_LOADLIBES variable in
order to ensure proper order of the final linker command line.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
---
 tools/mkimage/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/mkimage/Makefile b/tools/mkimage/Makefile
index 4aa822d606..bfe60993e2 100644
--- a/tools/mkimage/Makefile
+++ b/tools/mkimage/Makefile
@@ -31,8 +31,8 @@ define Host/Prepare
 endef
 
 define Host/Compile
-	$(MAKE) -C $(HOST_BUILD_DIR) defconfig   HOSTCFLAGS="$(HOST_CPPFLAGS) $(HOST_CFLAGS)" HOSTLDFLAGS="$(HOST_LDFLAGS) $$$$(pkg-config --static --libs libcrypto)"
-	$(MAKE) -C $(HOST_BUILD_DIR) tools-only  HOSTCFLAGS="$(HOST_CPPFLAGS) $(HOST_CFLAGS)" HOSTLDFLAGS="$(HOST_LDFLAGS) $$$$(pkg-config --static --libs libcrypto)"
+	$(MAKE) -C $(HOST_BUILD_DIR) defconfig   HOSTCFLAGS="$(HOST_CPPFLAGS) $(HOST_CFLAGS)" HOSTLDFLAGS="$(HOST_LDFLAGS)" HOST_LOADLIBES="$$$$(pkg-config --static --libs libcrypto)"
+	$(MAKE) -C $(HOST_BUILD_DIR) tools-only  HOSTCFLAGS="$(HOST_CPPFLAGS) $(HOST_CFLAGS)" HOSTLDFLAGS="$(HOST_LDFLAGS)" HOST_LOADLIBES="$$$$(pkg-config --static --libs libcrypto)"
 endef
 
 define Host/Install
-- 
GitLab