[Buildroot] [PATCH] package/cairo: fix pthread detection

Waldemar Brodkorb wbx at openadk.org
Fri Aug 11 05:30:24 UTC 2023


Cairo configure fails to detect pthreads, because of the following warning
binutils 2.39+ emits:
ld: warning: some.o: missing .note.GNU-stack section implies executable stack
ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker

Then the build errors out with:
error: #error "XXX: No mutex implementation found.  Cairo will not work with multiple threads.

Fixes:
 - http://autobuild.buildroot.net/results/2c4/2c4b983248b25ed6769c91d8b687c54434068eb7

Signed-off-by: Waldemar Brodkorb <wbx at openadk.org>
---
 package/cairo/cairo.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/package/cairo/cairo.mk b/package/cairo/cairo.mk
index 7bc8f92deb..3373aa4f73 100644
--- a/package/cairo/cairo.mk
+++ b/package/cairo/cairo.mk
@@ -26,8 +26,12 @@ ifeq ($(BR2_m68k_cf),y)
 CAIRO_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -mxgot"
 endif
 
+# cairo configure check for pthreads is failing when
+# binutils is warning about executable stack
 ifeq ($(BR2_TOOLCHAIN_HAS_THREADS_NPTL),)
 CAIRO_CONF_ENV += CPPFLAGS="$(TARGET_CPPFLAGS) -DCAIRO_NO_MUTEX=1"
+else
+CAIRO_CONF_ENV += LDFLAGS="$(TARGET_LDFLAGS) -z noexecstack"
 endif
 
 # cairo can use C++11 atomics when available, so we need to link with
-- 
2.39.2




More information about the buildroot mailing list