FreeBSD Bugzilla – Attachment 232893 Details for
Bug 263004
graphics/tesseract: fix build on armv6/armv7
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
graphics/tesseract: fix build on armv6/armv7
0001-graphics-tesseract-fix-build-on-armv6-armv7.patch (text/plain), 2.19 KB, created by
Robert Clausecker
on 2022-04-02 13:58:17 UTC
(
hide
)
Description:
graphics/tesseract: fix build on armv6/armv7
Filename:
MIME Type:
Creator:
Robert Clausecker
Created:
2022-04-02 13:58:17 UTC
Size:
2.19 KB
patch
obsolete
>From 293d4b669fb99112ec0dddb77de64d1ea2ae6091 Mon Sep 17 00:00:00 2001 >From: Robert Clausecker <fuz@fuz.su> >Date: Sat, 2 Apr 2022 15:54:54 +0200 >Subject: [PATCH] graphics/tesseract: fix build on armv6/armv7 > >Tesseract requires the <asm/hwcap.h> header to detect the availability >of NEON instructions on armv7. This commit adds a patch to use the >appropriate FreeBSD interface for this purpose. This issue has already >been reported to up stream. > >See also: https://github.com/tesseract-ocr/tesseract/pull/3782 >See also: PR #263003 > >--- > .../files/patch-src_arch_simddetect.cpp | 41 +++++++++++++++++++ > 1 file changed, 41 insertions(+) > create mode 100644 graphics/tesseract/files/patch-src_arch_simddetect.cpp > >diff --git a/graphics/tesseract/files/patch-src_arch_simddetect.cpp b/graphics/tesseract/files/patch-src_arch_simddetect.cpp >new file mode 100644 >index 000000000000..2e645a041b2e >--- /dev/null >+++ b/graphics/tesseract/files/patch-src_arch_simddetect.cpp >@@ -0,0 +1,41 @@ >+--- src/arch/simddetect.cpp.orig 2022-04-02 13:06:33 UTC >++++ src/arch/simddetect.cpp >+@@ -55,10 +55,12 @@ >+ #if defined(HAVE_NEON) && !defined(__aarch64__) >+ # ifdef ANDROID >+ # include <cpu-features.h> >+-# else >+-/* Assume linux */ >++# elif defined(__linux__) >+ # include <asm/hwcap.h> >+ # include <sys/auxv.h> >++# elif defined(__FreeBSD__) >++# include <sys/auxv.h> >++# include <sys/elf.h> >+ # endif >+ #endif >+ >+@@ -85,7 +87,7 @@ SIMDDetect SIMDDetect::detector; >+ bool SIMDDetect::neon_available_ = true; >+ #elif defined(HAVE_NEON) >+ // If true, then Neon has been detected. >+-bool SIMDDetect::neon_available_; >++bool SIMDDetect::neon_available_ = false; >+ #else >+ // If true, then AVX has been detected. >+ bool SIMDDetect::avx_available_; >+@@ -216,9 +218,12 @@ SIMDDetect::SIMDDetect() { >+ if (family == ANDROID_CPU_FAMILY_ARM) >+ neon_available_ = (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON); >+ } >+-# else >+- /* Assume linux */ >++# elif defined(__linux__) >+ neon_available_ = getauxval(AT_HWCAP) & HWCAP_NEON; >++# elif defined(__FreeBSD__) >++ unsigned long hwcap = 0; >++ elf_aux_info(AT_HWCAP, &hwcap, sizeof hwcap); >++ neon_available_ = hwcap & HWCAP_NEON; >+ # endif >+ #endif >+ >-- >2.34.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
fuz
:
maintainer-approval?
(
pkubaj
)
Actions:
View
|
Diff
Attachments on
bug 263004
: 232893