diff mbox series

[v5] pixmap: Enable openmp support with clang compiler

Message ID 20250530205609.3185264-1-raj.khem@gmail.com
State New
Headers show
Series [v5] pixmap: Enable openmp support with clang compiler | expand

Commit Message

Khem Raj May 30, 2025, 8:56 p.m. UTC
pixman's meson detects openmp support and if it finds it in runtime then
enables it, this happens for gcc via gcc-runtime, however for clang, it
does not. In some cases e.g. mips it enables it during configure only to
find that clang can not find the libomp during linking. Therefore, add
the dependency on openmp when using clang compiler. This ensures consistent
behaviour across architectures.

Disable internal assembler on mips since it can not handle the inline assembly

Turn openmp into a packageconfig

openmp is not yet ported to all architectures e.g. RISCV32/PPC32
does not have it

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
v5: Remove openmp on rv32 and ppc32

 meta/recipes-graphics/xorg-lib/pixman_0.46.0.bb | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

Comments

Alexander Kanavin June 2, 2025, 8:03 a.m. UTC | #1
On Fri, 30 May 2025 at 22:56, Khem Raj via lists.openembedded.org
<raj.khem=gmail.com@lists.openembedded.org> wrote:
> +PACKAGECONFIG[openmp] = ",-Dopenmp=disabled,${OPENMP}"

There should be an explicit enablement too, otherwise we rely on
upstream default for it, which can silently change.

Alex
diff mbox series

Patch

diff --git a/meta/recipes-graphics/xorg-lib/pixman_0.46.0.bb b/meta/recipes-graphics/xorg-lib/pixman_0.46.0.bb
index c1c71fd4202..925a7d7b29b 100644
--- a/meta/recipes-graphics/xorg-lib/pixman_0.46.0.bb
+++ b/meta/recipes-graphics/xorg-lib/pixman_0.46.0.bb
@@ -23,6 +23,17 @@  LIC_FILES_CHKSUM = "file://COPYING;md5=14096c769ae0cbb5fcb94ec468be11b3 \
 
 inherit meson pkgconfig
 
+OPENMP ?= ""
+OPENMP:toolchain-clang = "openmp"
+# openmp is not yet ported to rv32/ppc
+OPENMP:remove:riscv32 = "openmp"
+OPENMP:remove:powerpc = "openmp"
+
+PACKAGECONFIG ??= "openmp"
+PACKAGECONFIG:class-native ?= ""
+
+PACKAGECONFIG[openmp] = ",-Dopenmp=disabled,${OPENMP}"
+
 # These are for the tests and demos, which we don't install
 EXTRA_OEMESON = "-Dgtk=disabled -Dlibpng=disabled"
 # ld: pixman/libpixman-mmx.a(pixman-mmx.c.o):
@@ -36,7 +47,7 @@  EXTRA_OEMESON:append:class-target:powerpc64le = " ${@bb.utils.contains("TUNE_FEA
 EXTRA_OEMESON:append:armv7a = "${@bb.utils.contains("TUNE_FEATURES","neon",""," -Dneon=disabled",d)}"
 EXTRA_OEMESON:append:armv7ve = "${@bb.utils.contains("TUNE_FEATURES","neon",""," -Dneon=disabled",d)}"
 
-EXTRA_OEMESON:append:class-native = " -Dopenmp=disabled"
+CFLAGS:append:toolchain-clang:mipsarch = " -fno-integrated-as"
 
 BBCLASSEXTEND = "native nativesdk"