All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/cairo: fix build without NPTL
@ 2024-07-26  8:53 Fabrice Fontaine
  2024-07-27 16:36 ` Thomas Petazzoni via buildroot
  2024-08-02 17:28 ` Thomas Petazzoni via buildroot
  0 siblings, 2 replies; 3+ messages in thread
From: Fabrice Fontaine @ 2024-07-26  8:53 UTC (permalink / raw)
  To: buildroot; +Cc: Fabrice Fontaine

Fix the following build failure without NPTL raised since switch to
meson-package in commit 1fa58814c09a71444f961b61a9a2c399b9163fc2 which
wrongly removed -DCAIRO_NO_MUTEX=1:

In file included from ../src/cairo-mutex-type-private.h:45,
                 from ../src/cairo-scaled-font-private.h:45,
                 from ../src/cairoint.h:415,
                 from ../src/cairo-arc.c:37:
../src/cairo-mutex-impl-private.h:231:3: error: #error "XXX: No mutex implementation found.  Cairo will not work with multiple threads.  Define CAIRO_NO_MUTEX to 1 to acknowledge and accept this limitation and compile cairo without thread-safety support."
  231 | # error "XXX: No mutex implementation found.  Cairo will not work with multiple threads.  Define CAIRO_NO_MUTEX to 1 to acknowledge and accept this limitation and compile cairo without thread-safety support."
      |   ^~~~~

Fixes: 1fa58814c09a71444f961b61a9a2c399b9163fc2
 - http://autobuild.buildroot.org/results/a123355b6d315d2fcda646d3f1c7b588cba78258

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/cairo/cairo.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/package/cairo/cairo.mk b/package/cairo/cairo.mk
index 4ace04ebbe..3cfc182d09 100644
--- a/package/cairo/cairo.mk
+++ b/package/cairo/cairo.mk
@@ -20,6 +20,10 @@ ifeq ($(BR2_m68k_cf),y)
 CAIRO_CFLAGS += -mxgot
 endif
 
+ifeq ($(BR2_TOOLCHAIN_HAS_THREADS_NPTL),)
+CAIRO_CFLAGS += -DCAIRO_NO_MUTEX=1
+endif
+
 # cairo can use C++11 atomics when available, so we need to link with
 # libatomic for the architectures who need libatomic.
 ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/cairo: fix build without NPTL
  2024-07-26  8:53 [Buildroot] [PATCH 1/1] package/cairo: fix build without NPTL Fabrice Fontaine
@ 2024-07-27 16:36 ` Thomas Petazzoni via buildroot
  2024-08-02 17:28 ` Thomas Petazzoni via buildroot
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-07-27 16:36 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: buildroot

On Fri, 26 Jul 2024 10:53:52 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> +ifeq ($(BR2_TOOLCHAIN_HAS_THREADS_NPTL),)
> +CAIRO_CFLAGS += -DCAIRO_NO_MUTEX=1
> +endif

Not your fault because it was already like this before, but I believe
92f14307ba670058d0b3692fb8e82753d6ad6868 was wrong. Indeed, it means
that when thread support is enabled, but not with NPTL, we disable
mutex support in cairo. This means that a multi-threaded application
that uses cairo will be using a version of cairo without mutexes, which
seems very wrong.

Not be honest, I am unsure on how to proceed with this. Add a
BR2_TOOLCHAIN_HAS_THREADS_NPTL dependency to cairo?

Maybe retry if toolchains with threads not provided by NPTL continue to
fail building the mutex code? (Though I doubt anything has changed in
this area). Or maybe uClibc-ng has been improved to the point where the
mutex code now builds correctly with !NPTL threads?

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/cairo: fix build without NPTL
  2024-07-26  8:53 [Buildroot] [PATCH 1/1] package/cairo: fix build without NPTL Fabrice Fontaine
  2024-07-27 16:36 ` Thomas Petazzoni via buildroot
@ 2024-08-02 17:28 ` Thomas Petazzoni via buildroot
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-08-02 17:28 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: buildroot

Hello Fabrice,

On Fri, 26 Jul 2024 10:53:52 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> +ifeq ($(BR2_TOOLCHAIN_HAS_THREADS_NPTL),)

As pointed out during my review, and clarified by Waldemar, uClibc
linuxthreads now has everything needed to build the cairo mutex code.
So I changed this to:

ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),)

and updated the commit log accordingly.

Applied with this change. Thanks!

Best regards,

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-02 17:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-26  8:53 [Buildroot] [PATCH 1/1] package/cairo: fix build without NPTL Fabrice Fontaine
2024-07-27 16:36 ` Thomas Petazzoni via buildroot
2024-08-02 17:28 ` Thomas Petazzoni via buildroot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.