On Mon, Sep 28, 2020 at 4:38 AM Chen Qi <[email protected]> wrote: > > 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)
I've been looking at these two patches and they don't quite make sense. Looking up the crypto libs via pkg-config .. that does make sense, but why can't we use $(PKG_CONFIG) like other locations in the kernel ? If needed, we can pass a different PKG_CONFIG value for the SDK, versus the standard build, but we shouldn't need to set the PKG_CONFIG_PATH, etc variables that you are doing in the other patch. The explicit setting of those values in the kernel Makefile, embeds too much information about the build system, into the kernel build itself. We are ok to tell the kernel which pkg-config to use, but we shouldn't be setting the variables the pkg-config needs from within the kernel. Bruce > +$(info $(LIBCRYPTO_LIBS)) > +HOSTLDLIBS_sign-file = $(LIBCRYPTO_LIBS) > +HOSTLDLIBS_extract-cert = $(LIBCRYPTO_LIBS) -lpthread > > always := $(hostprogs-y) $(hostprogs-m) > > -- > 2.17.1 > > > > -- - Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end - "Use the force Harry" - Gandalf, Star Trek II
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#9101): https://lists.yoctoproject.org/g/linux-yocto/message/9101 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]] -=-=-=-=-=-=-=-=-=-=-=-
