[Buildroot] [PATCHv2 1/2] package/zstd: build multithreaded library if supported

Thomas De Schampheleire patrickdepinguin at gmail.com
Tue Jan 5 16:47:57 UTC 2021


On Tue, Jan 5, 2021, 17:36 Thomas Petazzoni <thomas.petazzoni at bootlin.com>
wrote:

> Hello,
>
> On Tue, 5 Jan 2021 17:20:39 +0100
> Thomas De Schampheleire <patrickdepinguin at gmail.com> wrote:
>
> > > Your patch is fixing this for the target variant of zstd, but to me it
> > > seems like the host variant also builds the library and programs
> > > separately, so it is probably affected by the same issue, isn't it ?
> >
> > The main driver for this series was the ever-expanding size of zstd,
> > worsened by the fact that the binary was using static linking.
> > For host, there is generally no size restriction, at least not of this
> order.
>
> Right, but my point was not about size here but
> correctness/functionality.
>
> > I'm not sure about host-mtd, and host-squashfs, but for the host-zstd
> > command-line tool itself, it is important that the binary and library
> > are either both built for single-threaded or both for multi-threaded.
> > This means that we'd have to pass HAVE_THREAD=1 for the host
> > compilation of zstd as well. Probably possible, not sure why it is not
> > done today.
>
> This is the point I missed: the host variant is not built with any
> HAVE_THREAD= value, so I suppose it's built single-threaded, which is
> why it works fine as it is today.
>
> So your patch is correct in fixing just the target package to use the
> %-mt make targets, because only the target package is built with thread
> support when available.
>
> Optionally, we could have a separate patch that turns on building with
> HAVE_THREAD=1 for the host package, but it's a separate matter.
>
> Makes sense.
>
> > > Also, in your PATCH 2/2 you mention that zstd also supports cmake and
> > > meson. Would switching to cmake-package or meson-package simplify a bit
> > > this issue and generally what zstd.mk looks like ?
> >
> > The developers mention in certain issues that 'make' is the official
> > build system, and that the other ones (like cmake and meson) are
> > 'community supported'.
> > So while their make logic is not clean at all, I would not necessarily
> > trust non-official solutions better.
> >
> > Meanwhile, a FreeBSD developer proposed an alternative patch on the
> > corresponding issue:
> > https://github.com/facebook/zstd/issues/2261#issuecomment-753632465
> >
> > So I suggest to hold this patch for a while, I'll try to get it moving
> upstream.
>
> OK. This is for PATCH 2/2, right ?
>

Yes, sorry for the confusion. Patch 1 can proceed, and patch 2 to be held.

Thanks,
Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20210105/a2148658/attachment-0002.html>


More information about the buildroot mailing list