Avoid building failure to link libpthread from host.

On some host, when `make scripts` inside SDK, we will meet error
about libpthread linking error. This is because kernel hard codes
to link libpthread from host. So we make it link to libpthread
from SDK's host part to solve this problem.

Signed-off-by: Chen Qi <[email protected]>
---
 scripts/Makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/scripts/Makefile b/scripts/Makefile
index 3e86b30..afa6b33 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -23,8 +23,10 @@ hostprogs-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += 
insert-sys-cert
 
 HOSTCFLAGS_sortextable.o = -I$(srctree)/tools/include
 HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include
-HOSTLDLIBS_sign-file = -lcrypto
-HOSTLDLIBS_extract-cert = -lcrypto
+LIBCRYPTO_LIBS  := $(shell pkg-config libcrypto --libs 2>/dev/null || echo 
-lcrypto)
+$(info $(LIBCRYPTO_LIBS))
+HOSTLDLIBS_sign-file = $(LIBCRYPTO_LIBS)
+HOSTLDLIBS_extract-cert = $(LIBCRYPTO_LIBS) -lpthread
 
 always         := $(hostprogs-y) $(hostprogs-m)
 
-- 
2.17.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#9091): 
https://lists.yoctoproject.org/g/linux-yocto/message/9091
Mute This Topic: https://lists.yoctoproject.org/mt/77170451/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to