diff options
| -rw-r--r-- | meta/recipes-extended/ghostscript/ghostscript/configure.ac-add-option-to-explicitly-disable-neon.patch | 99 | ||||
| -rw-r--r-- | meta/recipes-extended/ghostscript/ghostscript_10.01.2.bb | 4 |
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 @@ | |||
| 1 | From fd37229a17822c5ad21a369f670b8a6f6cc6b95b Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Benjamin Bara <benjamin.bara@skidata.com> | ||
| 3 | Date: Mon, 4 Sep 2023 12:16:39 +0200 | ||
| 4 | Subject: [PATCH] configure.ac: add option to explicitly disable neon | ||
| 5 | |||
| 6 | Uncomment an already existing possibility to explicitly disable neon and | ||
| 7 | use it on both implemented neon checks. | ||
| 8 | |||
| 9 | Upstream-Status: Submitted [https://bugs.ghostscript.com/show_bug.cgi?id=707097] | ||
| 10 | |||
| 11 | Signed-off-by: Benjamin Bara <benjamin.bara@skidata.com> | ||
| 12 | --- | ||
| 13 | configure.ac | 52 +++++++++++++++++++++++++++++----------------------- | ||
| 14 | 1 file changed, 29 insertions(+), 23 deletions(-) | ||
| 15 | |||
| 16 | diff --git a/configure.ac b/configure.ac | ||
| 17 | index 09d881dd1..62718e15e 100644 | ||
| 18 | --- a/configure.ac | ||
| 19 | +++ b/configure.ac | ||
| 20 | @@ -749,6 +749,33 @@ SUBCONFIG_OPTS="--build=$build --host=$host" | ||
| 21 | # SUBCONFIG_OPTS="$SUBCONFIG_OPTS --host=$host_alias" | ||
| 22 | #fi | ||
| 23 | |||
| 24 | +dnl -------------------------------------------------- | ||
| 25 | +dnl Check for NEON support | ||
| 26 | +dnl -------------------------------------------------- | ||
| 27 | +save_cflags=$CFLAGS | ||
| 28 | +AC_MSG_CHECKING([neon support]) | ||
| 29 | +CFLAGS="$save_cflags $OPT_CFLAGS -mfpu=neon -mcpu=cortex-a53" | ||
| 30 | +HAVE_NEON="" | ||
| 31 | +AC_LINK_IFELSE( | ||
| 32 | + [AC_LANG_PROGRAM([#include "arm_neon.h"], [ | ||
| 33 | + int32x4_t round = vdupq_n_s32(10); | ||
| 34 | + return(0); | ||
| 35 | + ])], | ||
| 36 | + [HAVE_NEON="-DHAVE_NEON"], [HAVE_NEON=""]) | ||
| 37 | + | ||
| 38 | +AC_ARG_ENABLE([neon], AS_HELP_STRING([--disable-neon], | ||
| 39 | + [Do not use neon instrinsics]), [ | ||
| 40 | + if test "x$enable_neon" = xno; then | ||
| 41 | + HAVE_NEON="" | ||
| 42 | + fi]) | ||
| 43 | + | ||
| 44 | +if test "x$HAVE_NEON" != x; then | ||
| 45 | + AC_MSG_RESULT(yes) | ||
| 46 | +else | ||
| 47 | + AC_MSG_RESULT(no) | ||
| 48 | +fi | ||
| 49 | +CFLAGS=$save_cflags | ||
| 50 | + | ||
| 51 | dnl -------------------------------------------------- | ||
| 52 | dnl Check for libraries | ||
| 53 | dnl -------------------------------------------------- | ||
| 54 | @@ -971,11 +998,12 @@ if test x$with_tesseract != xno; then | ||
| 55 | [TESS_NEON="-mfpu=neon -mcpu=cortex-a53 -D__ARM_NEON__"], | ||
| 56 | [TESS_NEON=""]) | ||
| 57 | |||
| 58 | - if test "x$TESS_NEON" != x; then | ||
| 59 | + if test "x$TESS_NEON" != x && test "x$enable_neon" != xno; then | ||
| 60 | AC_MSG_RESULT(yes) | ||
| 61 | TESS_CXXFLAGS="$TESS_CXXFLAGS -DHAVE_NEON" | ||
| 62 | else | ||
| 63 | AC_MSG_RESULT(no) | ||
| 64 | + TESS_NEON="" | ||
| 65 | fi | ||
| 66 | |||
| 67 | CXXFLAGS="$save_cxxflags" | ||
| 68 | @@ -2387,28 +2415,6 @@ if test x$WITH_CAL != x0; then | ||
| 69 | AC_MSG_RESULT(no) | ||
| 70 | fi | ||
| 71 | |||
| 72 | - AC_MSG_CHECKING([neon support]) | ||
| 73 | - CFLAGS="$save_cflags $OPT_CFLAGS -mfpu=neon -mcpu=cortex-a53" | ||
| 74 | - HAVE_NEON="" | ||
| 75 | - AC_LINK_IFELSE( | ||
| 76 | - [AC_LANG_PROGRAM([#include "arm_neon.h"], [ | ||
| 77 | - int32x4_t round = vdupq_n_s32(10); | ||
| 78 | - return(0); | ||
| 79 | - ])], | ||
| 80 | - [HAVE_NEON="-DHAVE_NEON"], [HAVE_NEON=""]) | ||
| 81 | - | ||
| 82 | - #AC_ARG_ENABLE([neon], AS_HELP_STRING([--disable-neon], | ||
| 83 | - # [Do not use neon instrinsics]), [ | ||
| 84 | - # if test "x$enable_neon" = xno; then | ||
| 85 | - # HAVE_NEON="" | ||
| 86 | - # fi]) | ||
| 87 | - | ||
| 88 | - if test "x$HAVE_NEON" != x; then | ||
| 89 | - AC_MSG_RESULT(yes) | ||
| 90 | - else | ||
| 91 | - AC_MSG_RESULT(no) | ||
| 92 | - fi | ||
| 93 | - | ||
| 94 | #AC_SUBST(HAVE_SSE4_2) | ||
| 95 | #AC_SUBST(HAVE_NEON) | ||
| 96 | CFLAGS=$save_cflags | ||
| 97 | -- | ||
| 98 | 2.34.1 | ||
| 99 | |||
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 | |||
| 26 | file://ghostscript-9.16-Werror-return-type.patch \ | 26 | file://ghostscript-9.16-Werror-return-type.patch \ |
| 27 | file://avoid-host-contamination.patch \ | 27 | file://avoid-host-contamination.patch \ |
| 28 | file://0001-Bug-706897-Copy-pcx-buffer-overrun-fix-from-devices-.patch \ | 28 | file://0001-Bug-706897-Copy-pcx-buffer-overrun-fix-from-devices-.patch \ |
| 29 | file://configure.ac-add-option-to-explicitly-disable-neon.patch \ | ||
| 29 | " | 30 | " |
| 30 | 31 | ||
| 31 | SRC_URI[sha256sum] = "a4cd61a07fec161bee35da0211a5e5cde8ff8a0aaf942fc0176715e499d21661" | 32 | SRC_URI[sha256sum] = "a4cd61a07fec161bee35da0211a5e5cde8ff8a0aaf942fc0176715e499d21661" |
| @@ -45,6 +46,9 @@ EXTRA_OECONF = "--with-jbig2dec \ | |||
| 45 | 46 | ||
| 46 | EXTRA_OECONF:append:mipsarcho32 = " --with-large_color_index=0" | 47 | EXTRA_OECONF:append:mipsarcho32 = " --with-large_color_index=0" |
| 47 | 48 | ||
| 49 | EXTRA_OECONF:append:armv7a = "${@bb.utils.contains('TUNE_FEATURES','neon','',' --disable-neon',d)}" | ||
| 50 | EXTRA_OECONF:append:armv7ve = "${@bb.utils.contains('TUNE_FEATURES','neon','',' --disable-neon',d)}" | ||
| 51 | |||
| 48 | # Uses autoconf but not automake, can't do out-of-tree | 52 | # Uses autoconf but not automake, can't do out-of-tree |
| 49 | inherit autotools-brokensep pkgconfig | 53 | inherit autotools-brokensep pkgconfig |
| 50 | 54 | ||
