From d7f42a4c58674d5c0988dd676b16cebb4a127190 Mon Sep 17 00:00:00 2001 From: "Sergey V. Lobanov" Date: Tue, 8 Feb 2022 02:22:11 +0300 Subject: [PATCH] tesseract: fix build on macos tesseract build script checks /proc/cpuinfo file, but this file is not exist or darwin. This check is used for getting optimized build flags depends on CPU. This feature does not work in cross-compile case and should be explicitly disabled. This patch disables CPU detection using cmake option BUILD_TRAINING_TOOLS=OFF. Generated binaries (aarch64 target) are exactly the same on Ubuntu 20.04 x86_64 and MacOS 11.6 arm64. Binaries generated on Linux build host are not changed (the same checksums before and after applying this patch). Signed-off-by: Sergey V. Lobanov --- utils/tesseract/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/tesseract/Makefile b/utils/tesseract/Makefile index 328998df6..55a9f3052 100644 --- a/utils/tesseract/Makefile +++ b/utils/tesseract/Makefile @@ -35,6 +35,7 @@ endef TARGET_CFLAGS:=$(filter-out -O%,$(TARGET_CFLAGS)) -O3 CMAKE_OPTIONS += \ + -DAUTO_OPTIMIZE=OFF \ -DBUILD_TRAINING_TOOLS=OFF define Build/InstallDev