diff mbox series

package/graphene: needs a toolchain with threads

Message ID 20240811080755.2588426-1-francois.perrad@gadz.org
State Changes Requested
Headers show
Series package/graphene: needs a toolchain with threads | expand

Commit Message

Francois Perrad Aug. 11, 2024, 8:07 a.m. UTC
/home/autobuild/autobuild/instance-9/output-1/host/aarch64-buildroot-linux-uclibc/sysroot/usr/include/features.h:220:5: warning: #warning requested reentrant code, but thread support was disabled [-Wcpp]

fix http://autobuild.buildroot.org/results/9b3/9b357b1ef2eccd3110d0ecaaff1ae4883dff9280

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
---
 package/graphene/Config.in | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Thomas Petazzoni Aug. 12, 2024, 8:03 p.m. UTC | #1
Hello François,

On Sun, 11 Aug 2024 10:07:55 +0200
Francois Perrad <francois.perrad@gadz.org> wrote:

> /home/autobuild/autobuild/instance-9/output-1/host/aarch64-buildroot-linux-uclibc/sysroot/usr/include/features.h:220:5: warning: #warning requested reentrant code, but thread support was disabled [-Wcpp]
> 
> fix http://autobuild.buildroot.org/results/9b3/9b357b1ef2eccd3110d0ecaaff1ae4883dff9280
> 
> Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
> ---
>  package/graphene/Config.in | 4 ++++
>  1 file changed, 4 insertions(+)

Thanks a lot, but I believe this is papering over the real issue.
Indeed the code has some nice:

#ifdef HAVE_PTHREAD
...
#endif

around all thread related code. However, the:

threadlib = dependency("threads")

in meson.build adds -pthread to the build command line, causing this
issue. I am not an expert in Meson so I'm not 100% sure how to fix
this, and to understand 100% what is the semantic of
dependency("threads"), but this is what needs to be fixed (or
alternatively reported upstream). Maybe meson.build needs to be changed this way:

test if pthread.h is here, and if it is:
 set HAVE_PHTHREAD
 threadlib = dependency("threads")

something along those lines. Could you have a look?

Thomas
diff mbox series

Patch

diff --git a/package/graphene/Config.in b/package/graphene/Config.in
index 60f6073a1..085efb301 100644
--- a/package/graphene/Config.in
+++ b/package/graphene/Config.in
@@ -1,6 +1,10 @@ 
 config BR2_PACKAGE_GRAPHENE
 	bool "graphene"
+	depends on BR2_TOOLCHAIN_HAS_THREADS
 	help
 	  A thin layer of types for graphic libraries.
 
 	  https://ebassi.github.io/graphene/
+
+comment "graphene needs a toolchain w/ threads"
+	depends on !BR2_TOOLCHAIN_HAS_THREADS