Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 938740 - app-text/ghostscript-gpl-10.03.1 doesn't compile with -mno-avx (in chroot)
Summary: app-text/ghostscript-gpl-10.03.1 doesn't compile with -mno-avx (in chroot)
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Codec Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-30 12:16 UTC by deim
Modified: 2024-09-02 03:56 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge_info.txt,6.94 KB, text/plain)
2024-08-30 12:18 UTC, deim
Details
build.log (XZ) (build.log.xz,17.05 KB, application/x-xz)
2024-08-30 12:20 UTC, deim
Details

Note You need to log in before you can comment on or make changes to this bug.
Description deim 2024-08-30 12:16:10 UTC
When building on binpackage server (Haswell) for Sandybridge G530 (no AVX)
Clang (Gcc also) builds with error:
tesseract/src/arch/dotproductavx.cpp:20:6: error: Implementation only for AVX capable architectures

Reproducible: Always

Steps to Reproduce:
1. build with flags: "-march=sandybridge -mno-avx -O2 -pipe -fomit-frame-pointer"
2. emerge emerge -av1 app-text/ghostscript-gpl
Actual Results:  
clang++ -Itesseract/include -Itesseract/src/api -Itesseract/src/arch -Itesseract/src/ccmain -Itesseract/src/ccstruct -Itesseract/src/ccutil -Itesseract/src/classify -Itesseract/src/cutil -Itesseract/src/dict -Itesseract/src/lstm -Itesseract/src/opencl -Itesseract/src/textord -Itesseract/src/training -Itesseract/src/viewer -Itesseract/src/wordrec -Ileptonica/src -I./base -I./soobj -march=sandybridge -mno-avx -O2 -pipe -fomit-frame-pointer  -std=c++17 -DHAVE_SSE4_1  -DHAVE_MKSTEMP -DHAVE_FILE64 -DHAVE_FSEEKO -DHAVE_MKSTEMP64 -DHAVE_FONTCONFIG -DHAVE_LIBIDN -DHAVE_SETLOCALE -DHAVE_SSE2 -DHAVE_DBUS -DHAVE_BSWAP32 -DHAVE_BYTESWAP_H -DHAVE_STRERROR -DHAVE_ISNAN -DHAVE_ISINF  -DHAVE_PREAD_PWRITE=1 -DGS_RECURSIVE_MUTEXATTR=PTHREAD_MUTEX_RECURSIVE -O2 -DNDEBUG -fPIC  -fvisibility=hidden -DGSDLLEXPORT="__attribute__((visibility(\"default\")))" -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE  -Wall -Wstrict-prototypes -Wundef -Wmissing-declarations -Wmissing-prototypes -Wwrite-strings -fno-strict-aliasing -Werror=declaration-after-statement -fno-builtin -fno-common -Werror=return-type -Wno-unused-local-typedefs -DHAVE_STDINT_H=1 -DHAVE_DIRENT_H=1 -DHAVE_SYS_DIR_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_TIMES_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_LIBDL=1 -DGX_COLOR_INDEX_TYPE="unsigned long long" -D__USE_UNIX98=1 -DHAVE_SNPRINTF  -DBUILD_PDF=1 -I./pdf -march=sandybridge -mno-avx -O2 -pipe -fomit-frame-pointer -DHAVE_RESTRICT=1  -DUSE_LIBPAPER  -fno-strict-aliasing -DHAVE_POPEN_PROTO=1   -DTESSERACT_IMAGEDATA_AS_PIX -DTESSERACT_DISABLE_DEBUG_FONTS -DGRAPHICS_DISABLED -UCLUSTER -DDISABLED_LEGACY_ENGINE  -o ./soobj/tesseract_arch_dotproductavx.o -c tesseract/src/arch/dotproductavx.cpp
tesseract/src/arch/dotproductavx.cpp:20:6: error: Implementation only for AVX capable architectures
   20 | #    error Implementation only for AVX capable architectures
      |      ^
1 error generated.
make[2]: *** [base/tesseract.mak:903: soobj/tesseract_arch_dotproductavx.o] Error 1


Expected Results:  
successful build
Comment 1 deim 2024-08-30 12:18:03 UTC
Created attachment 901673 [details]
emerge --info
Comment 2 deim 2024-08-30 12:20:09 UTC
Created attachment 901674 [details]
build.log (XZ)
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-09-02 03:42:10 UTC
```
if HAVE_AVX
libtesseract_avx_la_CXXFLAGS = -mavx
libtesseract_avx_la_CXXFLAGS += -I$(top_srcdir)/src/ccutil
libtesseract_avx_la_SOURCES = src/arch/dotproductavx.cpp
libtesseract_la_LIBADD += libtesseract_avx.la
noinst_LTLIBRARIES += libtesseract_avx.la
endif
```

https://github.com/tesseract-ocr/tesseract/blob/027ad18a8ddeb622b43e83dcc5a326124799cd85/configure.ac#L125
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-09-02 03:56:26 UTC
This is nasty. In both tesseract and the bundled copy in ghostscript, it's not easy to override and has no cache variable.