Skip to contentSkip to conversation

Add -pthread to HOSTLOADLIBES_mkimage

PATCH New Benedikt-Alexander Mokroß 2 participants 2 messages Dec 3, 2019 – Dec 6, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add -pthread to HOSTLOADLIBES_mkimage

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(-)
tools/Makefile +2 -1
index 24581adccd..2f122bed8e 100644
@@ -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.mokross at 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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-pthread-to-HOSTLOADLIBES_mkimage.patch
Type: application/octet-stream
Size: 1326 bytes
Desc: 0001-Add-pthread-to-HOSTLOADLIBES_mkimage.patch
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20191203/60cdd014/attachment.obj>

#1 lore raw

PATCH 1/1 Add -pthread to HOSTLOADLIBES_mkimage

Quoted 15 lines · Benedikt-Alexander Mokroß

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(-)
tools/Makefile +0 -0
index 24581adccd..2f122bed8e 100644

tools/Makefile ifneq ($(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_ARMADA_38X)$(CONFIG_ARMADA_39X)$(CON · line 157

Quoted 9 lines
tools/Makefile +2 -1
@@ -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

My first reaction is that it's a bug within openwrt pkg-config files to not say that -pthread is required. Would that not be the normal case? Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20191206/74a6f25e/attachment.sig>