From d1f0a9a25631035025da44549625ea0a17a22d37 Mon Sep 17 00:00:00 2001 From: Peter Michael Green Date: Thu, 4 Feb 2021 21:51:18 +0100 Subject: [PATCH] Prevent building with march=native --- configure.ac | 2 +- debian/changelog | 8 ++++++++ debian/control | 2 +- debian/patches/no-march-native | 28 ++++++++++++++++++++++++++++ debian/patches/series | 1 + debian/rules | 2 +- 6 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 debian/patches/no-march-native diff --git a/configure.ac b/configure.ac index 31971a7..8526332 100644 --- a/configure.ac +++ b/configure.ac @@ -136,7 +136,7 @@ AM_CONDITIONAL([FMA_OPT], $fma) AX_CHECK_COMPILE_FLAG([-msse4.1], [sse41=true], [sse41=false], [$WERROR]) AM_CONDITIONAL([SSE41_OPT], $sse41) -AX_CHECK_COMPILE_FLAG([-march=native], [arch_native=true], [arch_native=false], [$WERROR]) +AX_CHECK_COMPILE_FLAG([-march=native], [arch_native=false], [arch_native=false], [$WERROR]) AM_CONDITIONAL([MARCH_NATIVE_OPT], $arch_native) AC_ARG_WITH([extra-includes], diff --git a/debian/changelog b/debian/changelog index 18311d3..1e976fb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +tesseract (4.1.1-2.1) unstable; urgency=medium + + [ Peter Green ] + * Edit configure.ac to disable -march=native (Closes: #949638) + * Edit control/rules to enable autoreconf. + + -- Paul Gevers Thu, 04 Feb 2021 21:49:33 +0100 + tesseract (4.1.1-2) unstable; urgency=medium * Update debian/control: diff --git a/debian/control b/debian/control index e4a1d5c..7b59f66 100644 --- a/debian/control +++ b/debian/control @@ -5,7 +5,7 @@ Maintainer: Alexander Pozdnyakov Build-Depends: debhelper (>= 9), libleptonica-dev (>= 1.75.3), automake, libtool, libarchive-dev, libpango1.0-dev, libcairo2-dev, libicu-dev, libpng-dev, libjpeg-dev, libtiff-dev, zlib1g-dev, git, autoconf-archive, asciidoc, - xsltproc, docbook-xsl, docbook-xml, tesseract-ocr-eng (>= 4.00~) + xsltproc, docbook-xsl, docbook-xml, tesseract-ocr-eng (>= 4.00~), dh-autoreconf Standards-Version: 4.4.1 Homepage: https://github.com/tesseract-ocr/ Vcs-Git: https://github.com/AlexanderP/tesseract-debian.git diff --git a/debian/patches/no-march-native b/debian/patches/no-march-native new file mode 100644 index 0000000..aeed875 --- /dev/null +++ b/debian/patches/no-march-native @@ -0,0 +1,28 @@ +Description: Edit configure.ac to disable -march=native + -march=native is inappropriate for a binary distribution like Debian. +Author: Peter Michael Green + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: , +Bug: +Bug-Debian: https://bugs.debian.org/ +Bug-Ubuntu: https://launchpad.net/bugs/ +Forwarded: +Reviewed-By: +Last-Update: 2020-01-23 + +--- tesseract-4.1.1.orig/configure.ac ++++ tesseract-4.1.1/configure.ac +@@ -136,7 +136,7 @@ AM_CONDITIONAL([FMA_OPT], $fma) + AX_CHECK_COMPILE_FLAG([-msse4.1], [sse41=true], [sse41=false], [$WERROR]) + AM_CONDITIONAL([SSE41_OPT], $sse41) + +-AX_CHECK_COMPILE_FLAG([-march=native], [arch_native=true], [arch_native=false], [$WERROR]) ++AX_CHECK_COMPILE_FLAG([-march=native], [arch_native=false], [arch_native=false], [$WERROR]) + AM_CONDITIONAL([MARCH_NATIVE_OPT], $arch_native) + + AC_ARG_WITH([extra-includes], diff --git a/debian/patches/series b/debian/patches/series index 22431bc..4bbee71 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -2,3 +2,4 @@ #fix-up-headers helptext #shebang.diff +no-march-native diff --git a/debian/rules b/debian/rules index 18dc1c5..f2b70dd 100755 --- a/debian/rules +++ b/debian/rules @@ -16,7 +16,7 @@ ifeq (,$(NUMJOBS)) endif %: - dh $@ --parallel + dh $@ --parallel --with autoreconf override_dh_auto_build: make -j$(NUMJOBS) -- 2.30.2