All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/zstd: fix dynamic build without threads
@ 2021-07-01 19:29 Fabrice Fontaine
  2021-08-04 12:43 ` Arnout Vandecappelle
  0 siblings, 1 reply; 4+ messages in thread
From: Fabrice Fontaine @ 2021-07-01 19:29 UTC (permalink / raw)
  To: buildroot

Dynamic build without threads is broken since bump to version 1.5.0 in
commit aad8bbf58842dd62a4911d2c671ad9598e26b459

Indeed, dynamic library is built with threads support since
https://github.com/facebook/zstd/commit/91465e23b2710de031a762874cafb417f8b7556e

To fix this build failure, add -nomt if needed however libzstd-nomt is a
"special target that builds a library in single-thread mode _and_
without zstdmt_compress.c". For an unknown reason, this target fails to
build and don't create any symlinks so replace libzstd-{mt,nomt} by
lib-{mt,nomt} even if this will have the side effect of building a
shared and a static version of the library.

While at it, also replace "libzstd.a libzstd" by "lib"

Fixes:
 - http://autobuild.buildroot.org/results/e609601a0fc91c44d88a12c35b29ce937381462f

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/zstd/zstd.mk | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/package/zstd/zstd.mk b/package/zstd/zstd.mk
index 2a876376a2..47d774bc81 100644
--- a/package/zstd/zstd.mk
+++ b/package/zstd/zstd.mk
@@ -43,19 +43,22 @@ ifeq ($(BR2_STATIC_LIBS),y)
 ZSTD_BUILD_LIBS = libzstd.a
 ZSTD_INSTALL_LIBS = install-static
 else ifeq ($(BR2_SHARED_LIBS),y)
-ZSTD_BUILD_LIBS = libzstd
+ZSTD_BUILD_LIBS = lib
 ZSTD_INSTALL_LIBS = install-shared
 else
-ZSTD_BUILD_LIBS = libzstd.a libzstd
+ZSTD_BUILD_LIBS = lib
 ZSTD_INSTALL_LIBS = install-static install-shared
 endif
 
 # The HAVE_THREAD flag is read by the 'programs' makefile but not by  the 'lib'
-# one. Building a multi-threaded binary with a library (which defaults to
-# single-threaded) gives a runtime error when compressing files.
-# The 'lib' makefile provides specific '%-mt' targets for this purpose.
+# one. Building a multi-threaded binary with a static library (which defaults
+# to single-threaded) gives a runtime error when compressing files.
+# The 'lib' makefile provides specific '%-mt' and '%-nomt' targets for this
+# purpose.
 ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
 ZSTD_BUILD_LIBS := $(addsuffix -mt,$(ZSTD_BUILD_LIBS))
+else
+ZSTD_BUILD_LIBS := $(addsuffix -nomt,$(ZSTD_BUILD_LIBS))
 endif
 
 define ZSTD_BUILD_CMDS
-- 
2.30.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/zstd: fix dynamic build without threads
  2021-07-01 19:29 [Buildroot] [PATCH 1/1] package/zstd: fix dynamic build without threads Fabrice Fontaine
@ 2021-08-04 12:43 ` Arnout Vandecappelle
  0 siblings, 0 replies; 4+ messages in thread
From: Arnout Vandecappelle @ 2021-08-04 12:43 UTC (permalink / raw)
  To: Fabrice Fontaine, buildroot, Norbert Lange; +Cc: Andrey Smirnov



On 01/07/2021 21:29, Fabrice Fontaine wrote:
> Dynamic build without threads is broken since bump to version 1.5.0 in
> commit aad8bbf58842dd62a4911d2c671ad9598e26b459
> 
> Indeed, dynamic library is built with threads support since
> https://github.com/facebook/zstd/commit/91465e23b2710de031a762874cafb417f8b7556e
> 
> To fix this build failure, add -nomt if needed however libzstd-nomt is a
> "special target that builds a library in single-thread mode _and_
> without zstdmt_compress.c". For an unknown reason, this target fails to
> build and don't create any symlinks so replace libzstd-{mt,nomt} by
> lib-{mt,nomt} even if this will have the side effect of building a
> shared and a static version of the library.
> 
> While at it, also replace "libzstd.a libzstd" by "lib"
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/e609601a0fc91c44d88a12c35b29ce937381462f
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

 Applied to master, thanks.

 I've applied this one rather than Norbert's patch [1] because Norbert's does a
lot of unrelated stuff as well. Also, this patch has a better commit log. In
addition, it handles the "libzstd-nomt doesn't create symlinks" part.

> ---
>  package/zstd/zstd.mk | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/package/zstd/zstd.mk b/package/zstd/zstd.mk
> index 2a876376a2..47d774bc81 100644
> --- a/package/zstd/zstd.mk
> +++ b/package/zstd/zstd.mk
> @@ -43,19 +43,22 @@ ifeq ($(BR2_STATIC_LIBS),y)
>  ZSTD_BUILD_LIBS = libzstd.a
>  ZSTD_INSTALL_LIBS = install-static
>  else ifeq ($(BR2_SHARED_LIBS),y)
> -ZSTD_BUILD_LIBS = libzstd
> +ZSTD_BUILD_LIBS = lib
>  ZSTD_INSTALL_LIBS = install-shared
>  else
> -ZSTD_BUILD_LIBS = libzstd.a libzstd
> +ZSTD_BUILD_LIBS = lib
>  ZSTD_INSTALL_LIBS = install-static install-shared
>  endif
>  
>  # The HAVE_THREAD flag is read by the 'programs' makefile but not by  the 'lib'
> -# one. Building a multi-threaded binary with a library (which defaults to
> -# single-threaded) gives a runtime error when compressing files.
> -# The 'lib' makefile provides specific '%-mt' targets for this purpose.
> +# one. Building a multi-threaded binary with a static library (which defaults
> +# to single-threaded) gives a runtime error when compressing files.
> +# The 'lib' makefile provides specific '%-mt' and '%-nomt' targets for this
> +# purpose.
>  ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
>  ZSTD_BUILD_LIBS := $(addsuffix -mt,$(ZSTD_BUILD_LIBS))

 Here, I took inspiration from Norbert's patch and included the HAVE_THREAD
setting inside this condition instead of having a separate condition in the
beginning of the file.

 Regards,
 Arnout

> +else
> +ZSTD_BUILD_LIBS := $(addsuffix -nomt,$(ZSTD_BUILD_LIBS))
>  endif
>  
>  define ZSTD_BUILD_CMDS
> 
_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 1/1] package/zstd: fix dynamic build without threads
  2021-07-07  9:12 Norbert Lange
@ 2021-07-07  9:18 ` Baruch Siach
  0 siblings, 0 replies; 4+ messages in thread
From: Baruch Siach @ 2021-07-07  9:18 UTC (permalink / raw)
  To: buildroot


On Wed, Jul 07 2021, Norbert Lange wrote:
> PS. dont know how to reply to a ML entry that did not end up in my inbox

You can download the mailing list archive of each month in mbox format
from the right most column (under "Downloadable version") here:

  http://lists.busybox.net/pipermail/buildroot/

Import the mbox to your email client and reply as usual.

baruch

-- 
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 1/1] package/zstd: fix dynamic build without threads
@ 2021-07-07  9:12 Norbert Lange
  2021-07-07  9:18 ` Baruch Siach
  0 siblings, 1 reply; 4+ messages in thread
From: Norbert Lange @ 2021-07-07  9:12 UTC (permalink / raw)
  To: buildroot

Hello,

the 1.5.0 upgrade was from a patch series that hasn't been fully applied,
the rest of the series should fix that.

http://lists.busybox.net/pipermail/buildroot/2021-June/312877.html

PS. dont know how to reply to a ML entry that did not end up in my inbox

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-08-04 12:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-01 19:29 [Buildroot] [PATCH 1/1] package/zstd: fix dynamic build without threads Fabrice Fontaine
2021-08-04 12:43 ` Arnout Vandecappelle
2021-07-07  9:12 Norbert Lange
2021-07-07  9:18 ` Baruch Siach

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.