Skip to contentSkip to conversation

package/cairo: fix pthread detection

PATCH In review Bernd Kuhls 2 participants 2 messages Jul 29, 2023 – Sep 11, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/cairo: fix pthread detection

Cairo's link check for pthreads support "must complete without warnings or errors to stderr":
https://cgit.freedesktop.org/cairo/tree/build/aclocal.cairo.m4?h=1.16.0#n83
https://cgit.freedesktop.org/cairo/tree/build/configure.ac.pthread?h=1.16.0#n137

The pthread check fails with this defconfig

checking for cairo's pthread feature...
checking whether cairo's pthread feature could be enabled... no (can't link with -lpthread or -pthread)

due a warning thrown by ld:

/home/bernd/buildroot/output/per-package/cairo/host/bin/../lib/gcc/xtensa-buildroot-linux-uclibc/12.3.0/../../../../xtensa-buildroot-linux-uclibc/bin/ld:
warning: /home/bernd/buildroot/br4/output/per-package/cairo/host/bin/../lib/gcc/xtensa-buildroot-linux-uclibc/12.3.0/crtendS.o:
missing .note.GNU-stack section implies executable stack

/home/bernd/buildroot/output/per-package/cairo/host/bin/../lib/gcc/xtensa-buildroot-linux-uclibc/12.3.0/../../../../xtensa-buildroot-linux-uclibc/bin/ld:
NOTE: This behaviour is deprecated and will be removed in a future version of the linker

These linker warnings were introduced by binutils 2.39:
https://www.redhat.com/en/blog/linkers-warnings-about-executable-stacks-and-segments

Silence them by adding "-Wl,-z,noexecstack" to fix cairo's pthread check

Meanwhile upstream removed autoconf support on the master branch:
https://cgit.freedesktop.org/cairo/commit/?id=efe303d9db6e24d5786c15252327811338bc9b0a
so no need to notify them.

Fixes:
http://autobuild.buildroot.net/results/408/408a900ac01dbce145aff302c75f9f4e147f5672/

---
 package/cairo/cairo.mk | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
package/cairo/cairo.mk +3 -1
index 7bc8f92deb..3e1a7956f7 100644
@@ -19,7 +19,9 @@ CAIRO_IGNORE_CVES += CVE-2019-6462
 # 0004-Fix-mask-usage-in-image-compositor.patch
 CAIRO_IGNORE_CVES += CVE-2020-35492
 
-CAIRO_CONF_ENV = LIBS="$(CAIRO_LIBS)"
+CAIRO_CONF_ENV = \
+	LIBS="$(CAIRO_LIBS)" \
+	LDFLAGS="$(TARGET_LDFLAGS) -Wl,-z,noexecstack"
 
 # relocation truncated to fit: R_68K_GOT16O
 ifeq ($(BR2_m68k_cf),y)
Signature · 6 lines
2.39.2

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 28 lines · On Sat, 29 Jul 2023 12:30:22 +0200 Bernd Kuhls <[email protected]> wrote:

Cairo's link check for pthreads support "must complete without warnings or errors to stderr":
https://cgit.freedesktop.org/cairo/tree/build/aclocal.cairo.m4?h=1.16.0#n83
https://cgit.freedesktop.org/cairo/tree/build/configure.ac.pthread?h=1.16.0#n137

The pthread check fails with this defconfig

checking for cairo's pthread feature...
checking whether cairo's pthread feature could be enabled... no (can't link with -lpthread or -pthread)

due a warning thrown by ld:

/home/bernd/buildroot/output/per-package/cairo/host/bin/../lib/gcc/xtensa-buildroot-linux-uclibc/12.3.0/../../../../xtensa-buildroot-linux-uclibc/bin/ld:
warning: /home/bernd/buildroot/br4/output/per-package/cairo/host/bin/../lib/gcc/xtensa-buildroot-linux-uclibc/12.3.0/crtendS.o:
missing .note.GNU-stack section implies executable stack

/home/bernd/buildroot/output/per-package/cairo/host/bin/../lib/gcc/xtensa-buildroot-linux-uclibc/12.3.0/../../../../xtensa-buildroot-linux-uclibc/bin/ld:
NOTE: This behaviour is deprecated and will be removed in a future version of the linker

These linker warnings were introduced by binutils 2.39:
https://www.redhat.com/en/blog/linkers-warnings-about-executable-stacks-and-segments

Silence them by adding "-Wl,-z,noexecstack" to fix cairo's pthread check

Meanwhile upstream removed autoconf support on the master branch:
https://cgit.freedesktop.org/cairo/commit/?id=efe303d9db6e24d5786c15252327811338bc9b0a
so no need to notify them.

Quoted 7 lines

Fixes:
http://autobuild.buildroot.net/results/408/408a900ac01dbce145aff302c75f9f4e147f5672/

---
 package/cairo/cairo.mk | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

The correct fix for this was to fix gcc:

https://gitlab.com/buildroot.org/buildroot/-/commit/ab4f3fafaa839593b3efd9ea12c8ee5d9340cdeb

So I've marked this patch as Rejected. Thanks!

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