Skip to contentSkip to conversation

package/sord: fix build without threads

PATCH Applied Fabrice Fontaine 2 participants 2 messages Feb 22, 2022 – Mar 7, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/sord: fix build without threads

Fix the following build failure without threads raised since the addition of the package in commit 0d4c8ce8a2f26989e0e2d95b977d60e450c090a9:

/home/buildroot/autobuild/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabihf/9.3.0/../../../../arm-buildroot-linux-uclibcgnueabihf/bin/ld: cannot find -lpthread

Fixes:
- http://autobuild.buildroot.org/results/170d0114987b39a2b9ea173df7a5e806bd270fd8

---
 .../0001-wscript-add-no-threads-option.patch  | 59 +++++++++++++++++++
 package/sord/sord.mk                          |  4 ++
 2 files changed, 63 insertions(+)
 create mode 100644 package/sord/0001-wscript-add-no-threads-option.patch
package/sord/0001-wscript-add-no-threads-option.patch new file +59 -0
new file mode 100644
index 0000000000..750ea8f4ad
@@ -0,0 +1,59 @@
+From 82ab045a45c06187dca5e9d2a9a4003fcfbfa830 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <[email protected]>
+Date: Tue, 22 Feb 2022 21:22:31 +0100
+Subject: [PATCH] wscript: add -no-threads option
+
+Add -no-threads options to avoid the following build failure on embedded
+toolchains without threads support:
+
+/home/buildroot/autobuild/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabihf/9.3.0/../../../../arm-buildroot-linux-uclibcgnueabihf/bin/ld: cannot find -lpthread
+
+Fixes:
+ - http://autobuild.buildroot.org/results/170d0114987b39a2b9ea173df7a5e806bd270fd8
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+[Upstream status: https://github.com/drobilla/sord/pull/3]
+---
+ wscript | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/wscript b/wscript
+index fd8578e..d71d78c 100644
+--- a/wscript
++++ b/wscript
+@@ -35,6 +35,7 @@ def options(ctx):
+         {'no-utils':     'do not build command line utilities',
+          'static':       'build static library',
+          'no-shared':    'do not build shared library',
++         'no-threads':   'disable threads',
+          'static-progs': 'build programs as static binaries'})
+ 
+     opt.add_option('--dump', type='string', default='', dest='dump',
+@@ -55,6 +56,7 @@ def configure(conf):
+ 
+     conf.env.BUILD_UTILS  = not Options.options.no_utils
+     conf.env.BUILD_SHARED = not Options.options.no_shared
++    conf.env.ENABLE_THREADS = not Options.options.no_threads
+     conf.env.STATIC_PROGS = Options.options.static_progs
+     conf.env.BUILD_STATIC = (Options.options.static or
+                              Options.options.static_progs)
+@@ -124,7 +126,7 @@ def configure(conf):
+     conf.check_pkg('serd-0 >= 0.30.0', uselib_store='SERD')
+     conf.check_pkg('libpcre', uselib_store='PCRE', mandatory=False)
+ 
+-    if conf.env.HAVE_PCRE:
++    if conf.env.HAVE_PCRE and conf.env.ENABLE_THREADS:
+         if conf.check(cflags=['-pthread'], mandatory=False):
+             conf.env.PTHREAD_CFLAGS    = ['-pthread']
+             if conf.env.CC_NAME != 'clang':
+@@ -160,6 +162,7 @@ def configure(conf):
+         conf,
+         {'Static library': bool(conf.env.BUILD_STATIC),
+          'Shared library': bool(conf.env.BUILD_SHARED),
++         'Threads':        bool(conf.env.ENABLE_THREADS),
+          'Utilities':      bool(conf.env.BUILD_UTILS),
+          'Unit tests':     bool(conf.env.BUILD_TESTS),
+          'Debug dumping':  dump})
+-- 
+2.34.1
+
package/sord/sord.mk +4 -0
index f805805e9d..c06ef9c55c 100644
@@ -22,4 +22,8 @@ ifeq ($(BR2_STATIC_LIBS),y)
 SORD_CONF_OPTS += --static --no-shared --static-progs
 endif
 
+ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),)
+SORD_CONF_OPTS += --no-threads
+endif
+
 $(eval $(waf-package))
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 10 lines · Fabrice Fontaine

Fix the following build failure without threads raised since the addition of the package in commit 0d4c8ce8a2f26989e0e2d95b977d60e450c090a9:

/home/buildroot/autobuild/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabihf/9.3.0/../../../../arm-buildroot-linux-uclibcgnueabihf/bin/ld: cannot find -lpthread

Fixes:
- http://autobuild.buildroot.org/results/170d0114987b39a2b9ea173df7a5e806bd270fd8

Applied to master, thanks.

Regards,
Arnout

Quoted 76 lines
---
  .../0001-wscript-add-no-threads-option.patch  | 59 +++++++++++++++++++
  package/sord/sord.mk                          |  4 ++
  2 files changed, 63 insertions(+)

create mode 100644 package/sord/0001-wscript-add-no-threads-option.patch

package/sord/0001-wscript-add-no-threads-option.patch new file +59 -0
new file mode 100644
index 0000000000..750ea8f4ad
@@ -0,0 +1,59 @@
+From 82ab045a45c06187dca5e9d2a9a4003fcfbfa830 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <[email protected]>
+Date: Tue, 22 Feb 2022 21:22:31 +0100
+Subject: [PATCH] wscript: add -no-threads option
+
+Add -no-threads options to avoid the following build failure on embedded
+toolchains without threads support:
+
+/home/buildroot/autobuild/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabihf/9.3.0/../../../../arm-buildroot-linux-uclibcgnueabihf/bin/ld: cannot find -lpthread
+
+Fixes:
+ - http://autobuild.buildroot.org/results/170d0114987b39a2b9ea173df7a5e806bd270fd8
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+[Upstream status: https://github.com/drobilla/sord/pull/3]
+---
+ wscript | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/wscript b/wscript
+index fd8578e..d71d78c 100644
+--- a/wscript
++++ b/wscript
+@@ -35,6 +35,7 @@ def options(ctx):
+         {'no-utils':     'do not build command line utilities',
+          'static':       'build static library',
+          'no-shared':    'do not build shared library',
++         'no-threads':   'disable threads',
+          'static-progs': 'build programs as static binaries'})
+
+     opt.add_option('--dump', type='string', default='', dest='dump',
+@@ -55,6 +56,7 @@ def configure(conf):
+
+     conf.env.BUILD_UTILS  = not Options.options.no_utils
+     conf.env.BUILD_SHARED = not Options.options.no_shared
++    conf.env.ENABLE_THREADS = not Options.options.no_threads
+     conf.env.STATIC_PROGS = Options.options.static_progs
+     conf.env.BUILD_STATIC = (Options.options.static or
+                              Options.options.static_progs)
+@@ -124,7 +126,7 @@ def configure(conf):
+     conf.check_pkg('serd-0 >= 0.30.0', uselib_store='SERD')
+     conf.check_pkg('libpcre', uselib_store='PCRE', mandatory=False)
+
+-    if conf.env.HAVE_PCRE:
++    if conf.env.HAVE_PCRE and conf.env.ENABLE_THREADS:
+         if conf.check(cflags=['-pthread'], mandatory=False):
+             conf.env.PTHREAD_CFLAGS    = ['-pthread']
+             if conf.env.CC_NAME != 'clang':
+@@ -160,6 +162,7 @@ def configure(conf):
+         conf,
+         {'Static library': bool(conf.env.BUILD_STATIC),
+          'Shared library': bool(conf.env.BUILD_SHARED),
++         'Threads':        bool(conf.env.ENABLE_THREADS),
+          'Utilities':      bool(conf.env.BUILD_UTILS),
+          'Unit tests':     bool(conf.env.BUILD_TESTS),
+          'Debug dumping':  dump})
+--
+2.34.1
+
package/sord/sord.mk +0 -0
index f805805e9d..c06ef9c55c 100644

package/sord/sord.mk ifeq ($(BR2_STATIC_LIBS),y) · line 29

Quoted 8 lines
package/sord/sord.mk +4 -0
@@ -22,4 +22,8 @@ ifeq ($(BR2_STATIC_LIBS),y)
  SORD_CONF_OPTS += --static --no-shared --static-progs
  endif
 
+ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),)
+SORD_CONF_OPTS += --no-threads
+endif
+
  $(eval $(waf-package))

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot