On some unix distributions, pthread is not automatically linked.
This results in unresolved symbols when e.g. building u-boot via OpenWRT (using 
LibreSSL) in dumpimage and other host tools when i.E. CONFIG_FIT_SIGNATURE is 
set.
Using -pthread to link pthread should be portable across all distributions and 
OS X.

CHANGELOG:
* Added -pthread to HOSTLOADLIBES_mkimage
---
 tools/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/Makefile b/tools/Makefile
index 24581adccd..2f122bed8e 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -150,7 +150,8 @@ ifneq 
($(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_ARMADA_38X)$(CONFIG_ARMADA_39X)$(CON
 HOSTCFLAGS_kwbimage.o += \
 $(shell pkg-config --cflags libssl libcrypto 2> /dev/null || echo "")
 HOSTLOADLIBES_mkimage += \
-$(shell pkg-config --libs libssl libcrypto 2> /dev/null || echo "-lssl 
-lcrypto")
+$(shell pkg-config --libs libssl libcrypto 2> /dev/null || echo "-lssl 
-lcrypto") \
+-pthread

 # OS X deprecate openssl in favour of CommonCrypto, supress deprecation
 # warnings on those systems
--
2.20.1



Benedikt-Alexander Mokroß
Head of Research
iCOGNIZE GmbH

Tel.: +49 (0)60 74 - 310 36 31
Email: benedikt-alexander.mokr...@icognize.de




________________________________

[iCOGNIZE]<https://www.icognize.de>




iCOGNIZE GmbH
Justus-von-Liebig-Straße 9
63128 Dietzenbach (Germany)

Tel.:   +49 (0)6074 3103600
Fax:    +49 (0)6074 3103640
Web:    www.iCOGNIZE.de<https://www.icognize.de>

Geschäftsführer/Board: Dr. Alexander W. Lenhardt
USt.-ID.: DE 814 952 849, Registergericht: Amtsgericht Offenbach a. M., HRB 
43145

________________________________

WICHTIGER HINWEIS:
Die in dieser E-Mail und in den dazugehoerigen Anhaengen enthaltenen 
Informationen (die "Nachricht") sind nur fuer den Adressaten bestimmt und 
koennen vertrauliche und/oder rechtlich geschuetzte Angaben enthalten. Falls 
Sie nicht der Adressat sind, loeschen Sie bitte diese Nachricht und 
benachrichtigen Sie den Absender; Sie duerfen diese Nachricht nicht kopieren, 
verteilen oder ihren Inhalt an andere Personen weitergeben. Die in dieser 
E-Mail geaeusserten Ansichten spiegeln lediglich die Meinung des Autors wider 
und stellen nicht notwendigerweise die Meinung der iCOGNIZE GmbH dar. Diese 
Nachricht ist nicht rechtsverbindlich, wenn Sie keine schriftliche Bestaetigung 
ihres Inhalts durch einen autorisierten Vertreter erhalten. Wir schliessen 
ausser fuer den Fall von Vorsatz oder grober Fahrlaessigkeit die Haftung fuer 
jeglichen Verlust oder Schaeden durch virenbefallene Software oder E-Mails aus. 
Danke.

IMPORTANT NOTICE:
This message is intended only for the use of the individual or entity to which 
it is addressed, and may contain information that is privileged, confidential 
and exempt from disclosure under applicable law. If the reader of this message 
is not the intended recipient, or the employee or agent responsible for 
delivering the message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited. If you have received this communication in error, please notify the 
sender immediately by email and delete this message. Thank you.

Attachment: 0001-Add-pthread-to-HOSTLOADLIBES_mkimage.patch
Description: 0001-Add-pthread-to-HOSTLOADLIBES_mkimage.patch

Reply via email to