summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/ghostscript
diff options
context:
space:
mode:
authorBenjamin Bara <benjamin.bara@skidata.com>2023-09-04 17:28:18 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-09-05 08:09:11 +0100
commit22d40fcb984849bc8735bf03b306c3a3b11eb779 (patch)
treef10ee8aa33d991cff8a87fd4aa2cf367d10f9eec /meta/recipes-extended/ghostscript
parent1d07be514ccacedb4d1ac48e0fdd3a36ae098698 (diff)
downloadopenembedded-core-22d40fcb984849bc8735bf03b306c3a3b11eb779.tar.gz
ghostscript: avoid neon on unsupported machines
Disable neon if the machine does not support it. Signed-off-by: Benjamin Bara <benjamin.bara@skidata.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended/ghostscript')
-rw-r--r--meta/recipes-extended/ghostscript/ghostscript/configure.ac-add-option-to-explicitly-disable-neon.patch99
-rw-r--r--meta/recipes-extended/ghostscript/ghostscript_10.01.2.bb4
2 files changed, 103 insertions, 0 deletions
diff --git a/meta/recipes-extended/ghostscript/ghostscript/configure.ac-add-option-to-explicitly-disable-neon.patch b/meta/recipes-extended/ghostscript/ghostscript/configure.ac-add-option-to-explicitly-disable-neon.patch
new file mode 100644
index 0000000000..7873396045
--- /dev/null
+++ b/meta/recipes-extended/ghostscript/ghostscript/configure.ac-add-option-to-explicitly-disable-neon.patch
@@ -0,0 +1,99 @@
+From fd37229a17822c5ad21a369f670b8a6f6cc6b95b Mon Sep 17 00:00:00 2001
+From: Benjamin Bara <benjamin.bara@skidata.com>
+Date: Mon, 4 Sep 2023 12:16:39 +0200
+Subject: [PATCH] configure.ac: add option to explicitly disable neon
+
+Uncomment an already existing possibility to explicitly disable neon and
+use it on both implemented neon checks.
+
+Upstream-Status: Submitted [https://bugs.ghostscript.com/show_bug.cgi?id=707097]
+
+Signed-off-by: Benjamin Bara <benjamin.bara@skidata.com>
+---
+ configure.ac | 52 +++++++++++++++++++++++++++++-----------------------
+ 1 file changed, 29 insertions(+), 23 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 09d881dd1..62718e15e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -749,6 +749,33 @@ SUBCONFIG_OPTS="--build=$build --host=$host"
+ # SUBCONFIG_OPTS="$SUBCONFIG_OPTS --host=$host_alias"
+ #fi
+
++dnl --------------------------------------------------
++dnl Check for NEON support
++dnl --------------------------------------------------
++save_cflags=$CFLAGS
++AC_MSG_CHECKING([neon support])
++CFLAGS="$save_cflags $OPT_CFLAGS -mfpu=neon -mcpu=cortex-a53"
++HAVE_NEON=""
++AC_LINK_IFELSE(
++ [AC_LANG_PROGRAM([#include "arm_neon.h"], [
++ int32x4_t round = vdupq_n_s32(10);
++ return(0);
++ ])],
++ [HAVE_NEON="-DHAVE_NEON"], [HAVE_NEON=""])
++
++AC_ARG_ENABLE([neon], AS_HELP_STRING([--disable-neon],
++ [Do not use neon instrinsics]), [
++ if test "x$enable_neon" = xno; then
++ HAVE_NEON=""
++ fi])
++
++if test "x$HAVE_NEON" != x; then
++ AC_MSG_RESULT(yes)
++else
++ AC_MSG_RESULT(no)
++fi
++CFLAGS=$save_cflags
++
+ dnl --------------------------------------------------
+ dnl Check for libraries
+ dnl --------------------------------------------------
+@@ -971,11 +998,12 @@ if test x$with_tesseract != xno; then
+ [TESS_NEON="-mfpu=neon -mcpu=cortex-a53 -D__ARM_NEON__"],
+ [TESS_NEON=""])
+
+- if test "x$TESS_NEON" != x; then
++ if test "x$TESS_NEON" != x && test "x$enable_neon" != xno; then
+ AC_MSG_RESULT(yes)
+ TESS_CXXFLAGS="$TESS_CXXFLAGS -DHAVE_NEON"
+ else
+ AC_MSG_RESULT(no)
++ TESS_NEON=""
+ fi
+
+ CXXFLAGS="$save_cxxflags"
+@@ -2387,28 +2415,6 @@ if test x$WITH_CAL != x0; then
+ AC_MSG_RESULT(no)
+ fi
+
+- AC_MSG_CHECKING([neon support])
+- CFLAGS="$save_cflags $OPT_CFLAGS -mfpu=neon -mcpu=cortex-a53"
+- HAVE_NEON=""
+- AC_LINK_IFELSE(
+- [AC_LANG_PROGRAM([#include "arm_neon.h"], [
+- int32x4_t round = vdupq_n_s32(10);
+- return(0);
+- ])],
+- [HAVE_NEON="-DHAVE_NEON"], [HAVE_NEON=""])
+-
+- #AC_ARG_ENABLE([neon], AS_HELP_STRING([--disable-neon],
+- # [Do not use neon instrinsics]), [
+- # if test "x$enable_neon" = xno; then
+- # HAVE_NEON=""
+- # fi])
+-
+- if test "x$HAVE_NEON" != x; then
+- AC_MSG_RESULT(yes)
+- else
+- AC_MSG_RESULT(no)
+- fi
+-
+ #AC_SUBST(HAVE_SSE4_2)
+ #AC_SUBST(HAVE_NEON)
+ CFLAGS=$save_cflags
+--
+2.34.1
+
diff --git a/meta/recipes-extended/ghostscript/ghostscript_10.01.2.bb b/meta/recipes-extended/ghostscript/ghostscript_10.01.2.bb
index 0ddf708f93..434170e34d 100644
--- a/meta/recipes-extended/ghostscript/ghostscript_10.01.2.bb
+++ b/meta/recipes-extended/ghostscript/ghostscript_10.01.2.bb
@@ -26,6 +26,7 @@ SRC_URI = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/downlo
file://ghostscript-9.16-Werror-return-type.patch \
file://avoid-host-contamination.patch \
file://0001-Bug-706897-Copy-pcx-buffer-overrun-fix-from-devices-.patch \
+ file://configure.ac-add-option-to-explicitly-disable-neon.patch \
"
SRC_URI[sha256sum] = "a4cd61a07fec161bee35da0211a5e5cde8ff8a0aaf942fc0176715e499d21661"
@@ -45,6 +46,9 @@ EXTRA_OECONF = "--with-jbig2dec \
EXTRA_OECONF:append:mipsarcho32 = " --with-large_color_index=0"
+EXTRA_OECONF:append:armv7a = "${@bb.utils.contains('TUNE_FEATURES','neon','',' --disable-neon',d)}"
+EXTRA_OECONF:append:armv7ve = "${@bb.utils.contains('TUNE_FEATURES','neon','',' --disable-neon',d)}"
+
# Uses autoconf but not automake, can't do out-of-tree
inherit autotools-brokensep pkgconfig