Skip to contentSkip to conversation

package/cairo: fix pthread detection

PATCH In review Waldemar Brodkorb 2 participants 2 messages Aug 11, 2023 – Aug 12, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/cairo: fix pthread detection

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

---
 package/cairo/cairo.mk | 4 ++++
 1 file changed, 4 insertions(+)
package/cairo/cairo.mk +4 -0
index 7bc8f92deb..3373aa4f73 100644
@@ -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
Signature · 6 lines
2.39.2

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

Hello,

+Bernd, +Fabrice,

Quoted 8 lines · On Fri, 11 Aug 2023 07:30:24 +0200 Waldemar Brodkorb <[email protected]> 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.

Quoted 7 lines

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

---
 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

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot