diff mbox series

package/cairo: fix pthread detection

Message ID ZNXHcDjCcjLhkR7Z@waldemar-brodkorb.de
State Handled Elsewhere
Headers show
Series package/cairo: fix pthread detection | expand

Commit Message

Waldemar Brodkorb Aug. 11, 2023, 5:30 a.m. UTC
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@openadk.org>
---
 package/cairo/cairo.mk | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Thomas Petazzoni Aug. 12, 2023, 12:21 p.m. UTC | #1
Hello,

+Bernd, +Fabrice,

On Fri, 11 Aug 2023 07:30:24 +0200
Waldemar Brodkorb <wbx@openadk.org> wrote:

> 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@openadk.org>
> ---
>  package/cairo/cairo.mk | 4 ++++
>  1 file changed, 4 insertions(+)

Thanks, however, we already have two previous proposals to address this issue:

  https://patchwork.ozlabs.org/project/buildroot/list/?series=&submitter=&state=&q=cairo&archive=&delegate=

The one from Bernd being identical to yours. I'm not sure which one is
correct. Building the entire cairo code with -Wl,-z,noexecstack just to
solve a bogus configure check seems a bit strange to me.

Since Bernd's proposal came in before yours, I've kept Bernd's patch in
our list of patches to review.

Thomas
diff mbox series

Patch

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