tesseract-ocr: remove -Wl,--as-needed linker flag

according to https://github.com/mesonbuild/meson/pull/4230 this flag and
-Wl,--no-undefined are silently ignored by binutils LD, but they cause
errors on LLD so remove them.
This commit is contained in:
Jeremy Drake
2021-05-05 11:10:55 -07:00
parent 574ce7eab7
commit 94d9a99d4e
2 changed files with 17 additions and 3 deletions

View File

@@ -5,7 +5,7 @@ _realname=tesseract-ocr
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=4.1.1
pkgrel=6
pkgrel=7
pkgdesc="Tesseract OCR (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64')
@@ -22,12 +22,15 @@ depends=(${MINGW_PACKAGE_PREFIX}-cairo
${MINGW_PACKAGE_PREFIX}-zlib)
options=('!libtool' 'strip')
source=(${_realname}-${pkgver}.tar.gz::https://github.com/tesseract-ocr/tesseract/archive/${pkgver}.tar.gz
https://github.com/tesseract-ocr/tessdata_fast/raw/master/osd.traineddata)
https://github.com/tesseract-ocr/tessdata_fast/raw/master/osd.traineddata
tesseract-no-as-needed.patch)
sha256sums=('2a66ff0d8595bff8f04032165e6c936389b1e5727c3ce5a27b3e059d218db1cb'
'9cf5d576fcc47564f11265841e5ca839001e7e6f38ff7f7aacf46d15a96b00ff')
'9cf5d576fcc47564f11265841e5ca839001e7e6f38ff7f7aacf46d15a96b00ff'
'60aa311301015e78a96edb228db160fe10784e074f45ef3d7e6ecbc8d52eb388')
prepare() {
cd "${srcdir}/tesseract-${pkgver}"
patch -p1 -i "${srcdir}/tesseract-no-as-needed.patch"
./autogen.sh
}

View File

@@ -0,0 +1,11 @@
--- tesseract-4.1.1/src/api/Makefile.am.orig 2021-05-05 11:01:16.091542600 -0700
+++ tesseract-4.1.1/src/api/Makefile.am 2021-05-05 11:04:58.638484300 -0700
@@ -103,7 +103,7 @@
if T_WIN
tesseract_LDADD += -ltiff
tesseract_LDADD += -lws2_32
-libtesseract_la_LDFLAGS += -no-undefined -Wl,--as-needed -lws2_32
+libtesseract_la_LDFLAGS += -no-undefined -lws2_32
endif
if ADD_RT
tesseract_LDADD += -lrt