[OE-core] [OE-Core][PATCH] libxcrypt: Enable static builds

Andre McCurdy armccurdy at gmail.com
Mon Feb 24 21:40:45 UTC 2020


On Fri, Feb 21, 2020 at 8:35 AM Alex Kiernan <alex.kiernan at gmail.com> wrote:
>
> On Tue, Jan 28, 2020 at 8:07 PM Andre McCurdy <armccurdy at gmail.com> wrote:
> >
> > On Tue, Jan 28, 2020 at 4:48 AM Alex Kiernan <alex.kiernan at gmail.com> wrote:
> > >
> > > Let me have a look at that - what got me here was trying to get a
> > > static busybox so I could OSTree's tests to pass, which all turned out
> > > to be way harder than I expected; this was just one of the things I
> > > tripped over.
> >
> > Busybox shouldn't need to link with libxcrypt if USE_BB_CRYPT is
> > enabled (which it is in OE's default Busybox defconfig).
> >
> > There's a long standing bug in Busybox whereby crypt.h gets included
> > unconditionally (instead of being guarded by #if ENABLE_USE_BB_CRYPT
> > etc) so the Busybox recipe still needs to depend on virtual/crypt but
> > it's only a compile time dependency.
>
> It looks like that might've been fixed:
>
> 4767a5375e66 libbb: include <crypt.h> only if necessary

Yes, looks like a fix in the Busybox master branch (not in any release
yet though).

> If I drop virtual/crypt, I still get the same link time failure to
> find crypt, which I think we're getting because this test
> https://git.busybox.net/busybox/tree/Makefile.flags#n149 passes:
>
> CRYPT_AVAILABLE := $(shell echo 'int main(void){return 0;}'
> >crypttest.c; $(CC) $(CFLAGS) -lcrypt -o /dev/null crypttest.c
> >/dev/null 2>&1 && echo "y"; rm crypttest.c)
>
> Not quite sure how that can pass tbh...

It looks like that test should just be skipped completely if Busybox
is configured to use its own internal libcrypt? Probably something to
raise on the Busybox mailing list rather than here.

> This ugly hack avoids needing a static crypt:>
> diff --git a/meta/recipes-core/busybox/busybox.inc
> b/meta/recipes-core/busybox/busybox.inc
> index 1a82f23b0f3a..7335a846038f 100644
> --- a/meta/recipes-core/busybox/busybox.inc
> +++ b/meta/recipes-core/busybox/busybox.inc
> @@ -18,7 +18,7 @@ BUSYBOX_SPLIT_SUID ?= "1"
>  export EXTRA_CFLAGS = "${CFLAGS}"
>  export EXTRA_LDFLAGS = "${LDFLAGS}"
>
> -EXTRA_OEMAKE = "CC='${CC}' LD='${CCLD}' V=1 ARCH=${TARGET_ARCH}
> CROSS_COMPILE=${TARGET_PREFIX} SKIP_STRIP=y HOSTCC='${BUILD_CC}'
> HOSTCPP='${BUILD_CPP}'"
> +EXTRA_OEMAKE = "CC='${CC}' LD='${CCLD}' V=1 ARCH=${TARGET_ARCH}
> CROSS_COMPILE=${TARGET_PREFIX} SKIP_STRIP=y HOSTCC='${BUILD_CC}'
> HOSTCPP='${BUILD_CPP}' CRYPT_AVAILABLE=n"

That's going to break for anyone who has their own busybox config with
CONFIG_USE_BB_CRYPT disabled.

>  PACKAGES =+ "${PN}-httpd ${PN}-udhcpd ${PN}-udhcpc ${PN}-syslog
> ${PN}-mdev ${PN}-hwclock"
>
> Not sure how to get that integrated nicely...
>
> --
> Alex Kiernan


More information about the Openembedded-core mailing list