Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 853298 - app-office/libreoffice-7.3.4.2 fails to build because "libclucene has contribs-lib missing"
Summary: app-office/libreoffice-7.3.4.2 fails to build because "libclucene has contrib...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Office Team
URL:
Whiteboard:
Keywords:
Depends on: 869170
Blocks:
  Show dependency tree
 
Reported: 2022-06-21 11:03 UTC by dawgg
Modified: 2023-06-28 21:14 UTC (History)
2 users (show)

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


Attachments
build.log (build.log,15.37 KB, text/x-log)
2022-06-24 10:47 UTC, dawgg
Details
config.log (config.log,136.96 KB, text/plain)
2022-06-24 10:48 UTC, dawgg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dawgg 2022-06-21 11:03:23 UTC
trying to build app-office/libreoffice-7.3.4.2 on ~amd64 (both on Intel and AMD; all logs/configs in this post from Intel-box)
ebuild of
app-office/libreoffice-7.3.4.2::gentoo [7.3.3.2-r3::gentoo] USE="branding clang* cups dbus gtk java mariadb pdfimport -accessibility -base -bluetooth -coinmp -custom-cflags -debug -eds -firebird -googledrive -gstreamer -kde -ldap -odk -postgres -test -vulkan" LIBREOFFICE_EXTENSIONS="-nlpsolver -scripting-beanshell -scripting-javascript -wiki-publisher" PYTHON_SINGLE_TARGET="python3_9 -python3_8 -python3_10"

fails:

cannot be compiled because of configure error:
checking which clucene to use... external
checking for CLUCENE... yes
checking for CLucene/analysis/cjk/CJKAnalyzer.h... no
configure: error: Your version of libclucene has contribs-lib missing.

dev-cpp/clucene-2.3.3.4-r6 is installed
dev-cpp/clucene-2.3.3.4-r6:1::gentoo  USE="-debug -doc -static-libs"

equery f clucene | grep -i contrib
/usr/lib64/libclucene-contribs-lib.so
/usr/lib64/libclucene-contribs-lib.so.1
/usr/lib64/libclucene-contribs-lib.so.2.3.3.4

libreoffice build.log (expires in 50 days):
http://dpaste.com/GSXGS9AP9

libreoffice config.log (expires in 60 days):
http://dpaste.com/34X64N6AE





Reproducible: Always

Steps to Reproduce:
1. emerge app-office/libreoffice
Actual Results:  
emerge app-office/libreoffice-7.3.4.2

Expected Results:  
finish the build

emerge --info
Portage 3.0.30 (python 3.10.5-final-0, default/linux/amd64/17.1/desktop, gcc-11.3.0, glibc-2.35-r7, 5.18.5-gentoo-LLVM x86_64)
=================================================================
System uname: Linux-5.18.5-gentoo-LLVM-x86_64-Intel-R-_Core-TM-_i7-10700K_CPU_@_3.80GHz-with-glibc2.35
KiB Mem:    32451832 total,  24099032 free
KiB Swap:   41943036 total,  41722620 free
Timestamp of repository gentoo: Tue, 21 Jun 2022 00:45:01 +0000
Head commit of repository gentoo: a0b5349db89d992c59712c299fdad1c0fc65761f
sh bash 5.1_p16
ld GNU ld (Gentoo 2.38 p4) 2.38
app-misc/pax-utils:        1.3.4::gentoo
app-shells/bash:           5.1_p16::gentoo
dev-java/java-config:      2.3.1::gentoo
dev-lang/perl:             5.36.0::gentoo
dev-lang/python:           2.7.18_p15::gentoo, 3.8.13_p2::gentoo, 3.9.13::gentoo, 3.10.5::gentoo, 3.11.0_beta3::gentoo
dev-lang/rust:             1.61.0-r1::gentoo
dev-util/cmake:            3.23.2::gentoo
dev-util/meson:            0.62.2::gentoo
sys-apps/baselayout:       2.8::gentoo
sys-apps/openrc:           0.45.1::gentoo
sys-apps/sandbox:          2.29::gentoo
sys-devel/autoconf:        2.13-r2::gentoo, 2.69-r5::gentoo, 2.71-r1::gentoo
sys-devel/automake:        1.13.4-r2::gentoo, 1.15.1-r2::gentoo, 1.16.5::gentoo
sys-devel/binutils:        2.36.1-r2::gentoo, 2.37_p1-r2::gentoo, 2.38-r2::gentoo
sys-devel/binutils-config: 5.4.1::gentoo
sys-devel/clang:           13.0.1::gentoo, 14.0.5::gentoo
sys-devel/gcc:             11.3.0::gentoo
sys-devel/gcc-config:      2.5-r1::gentoo
sys-devel/libtool:         2.4.7::gentoo
sys-devel/lld:             14.0.5::gentoo
sys-devel/llvm:            13.0.1::gentoo, 14.0.5::gentoo
sys-devel/make:            4.3::gentoo
sys-kernel/linux-headers:  5.18-r1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.35-r7::gentoo
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-2.0"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--keep-going"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms split-log strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.inode.at ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo http://ftp.uni-erlangen.de/pub/mirrors/gentoo http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/"
LANG="de_DE.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="de de_DE en en_US"
MAKEOPTS="-j17"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
SHELL="/bin/bash"
USE="a52 aac acl acpi aiglx alsa amd64 ass avx bash-completion bluray branding bzip2 cairo cdda cddb cdr clang cli crypt cups dri dts dvd dvdr dvdread elogind encode erandom examples exif flac fortran gif gnutls gtk gui htmlhandbook iconv icu imagemagick jpeg jpeg2k kdeenablefinal lcms libass libglvnd libnotify libtirpc llvm lzma mad mjpeg mmap mmx mng modern-top mp3 mp4 mpeg mpi multilib ncurses nls nptl nptlonly nsplugin nvenc offensive ogg opengl openmp optimized-qmake pam pango pcre pdf png ppds qt3support readline rtmp sdl seccomp speex split-usr sse sse2 ssl ssse3 startup-notification svg theora threads tiff truetype udev unicode usb userlocales v4l v4l2 vaapi vdpau vim-syntax vorbis vpx wxwidgets x264 x265 xcb xcomposite xml xv xvid zlib zstd" ABI_X86="32 64" ADA_TARGET="gnat_2020" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="pc efi-32 efi-64 multiboot" INPUT_DEVICES="evdev keyboard mouse" KERNEL="linux" L10N="de en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="NVPTX X86" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_8 python3_9 python3_10" RUBY_TARGETS="ruby26 ruby27 ruby30" SANE_BACKENDS="canon_lide70 canon net" USERLAND="GNU" VIDEO_CARDS="intel i915 i965 nouveau nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LEX, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 1 Mike Gilbert gentoo-dev 2022-06-22 18:11:34 UTC
Please attach the log files to this bug report.
Comment 2 dawgg 2022-06-24 10:47:46 UTC
Created attachment 787325 [details]
build.log

build.log
Comment 3 dawgg 2022-06-24 10:48:40 UTC
Created attachment 787328 [details]
config.log

config.log
Comment 4 xdev52 2022-07-05 16:03:01 UTC
This bug shows onlu when you have libclucene compiled by GCC,
I've recompiled it using Clang and have more errors from dependency hell of libraries which must be recompiled by llvm.
Right now have inside /etc/portage/package.env for Clang:
dev-cpp/clucene compiler-clang-lto
dev-util/cppunit compiler-clang-lto
app-crypt/gpgme compiler-clang-lto
app-text/hunspell compiler-clang-lto

Also pdfimprt flag gives error but have just disabled it for now.
In that case I have stopped on errors:

[MOD] uui
S=/var/tmp/portage/app-office/libreoffice-7.3.4.2/work/libreoffice-7.3.4.2 && I=$S/instdir && W=$S/workdir &&  mkdir -p $W/Module/ && touch $W/Module/uui
ld.lld: error: undefined symbol: Numbertext::string2wstring(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
>>> referenced by numbertext.cxx
>>>               /var/tmp/portage/app-office/libreoffice-7.3.4.2/work/libreoffice-7.3.4.2/workdir/CxxObject/lingucomponent/source/numbertext/numbertext.o:((anonymous namespace)::NumberText_Impl::getNumberText(rtl::OUString const&, com::sun::star::lang::Locale const&))
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-06 10:30:35 UTC
You should not need to recursively recompile with Clang as its output should be ABI compatible with GCC. You probably dangerously have default-libcxx on or similar.
Comment 6 xdev52 2022-07-06 10:55:55 UTC
(In reply to Sam James from comment #5)
> You should not need to recursively recompile with Clang as its output should
> be ABI compatible with GCC. You probably dangerously have default-libcxx on
> or similar.

Indeed. What you suggest? Turn this flags (default-compiler-rt default-libcxx default-lld llvm-libunwind) off?

 sys-devel/clang-14.0.6:14::gentoo  USE="default-compiler-rt default-libcxx default-lld llvm-libunwind (pie) static-analyzer xml -debug -doc -test -verify-sig"

Wanted to have independly from gcc compilation environment but it gives some troubles with re2(chromium and qtwebengine sharing lib) and samba(libunwind issue) package too. 

Right now have working:
#app-office/libreoffice compiler-clang-lto
#dev-qt/qtwebengine compiler-clang-lto
www-client/chromium compiler-clang-lto
www-client/firefox compiler-clang-lto
mail-client/thunderbird compiler-clang-lto
sys-devel/llvm compiler-clang-lto
sys-devel/lld compiler-clang-lto
dev-util/lldb compiler-clang-lto
sys-devel/clang compiler-clang-lto
sys-libs/libcxx compiler-clang-lto
sys-libs/libcxxabi compiler-clang-lto
sys-libs/llvm-libunwind compiler-clang-lto
sys-libs/compiler-rt compiler-clang-lto
sys-libs/compiler-rt-sanitizers compiler-clang-lto
dev-lang/rust compiler-clang-lto
app-doc/doxygen compiler-clang-lto
sys-libs/libomp compiler-clang-lto
dev-libs/libclc compiler-clang-lto
dev-libs/re2 compiler-clang-lto
dev-ml/re compiler-clang-lto
media-libs/mesa compiler-clang-lto
dev-lang/ispc compiler-clang-lto

sys-devel/llvm-roc compiler-clang-lto

dev-libs/rocclr compiler-clang-lto
sci-libs/rocFFT compiler-clang-lto
sci-libs/rocBLAS compiler-clang-lto
sci-libs/rocPRIM compiler-clang-lto
sci-libs/rocRAND compiler-clang-lto
dev-util/rocm-smi compiler-clang-lto
dev-util/rocminfo compiler-clang-lto
dev-util/roctracer compiler-clang-lto
dev-libs/rocm-comgr compiler-clang-lto
dev-util/rocm-cmake compiler-clang-lto
dev-libs/rocr-runtime compiler-clang-lto
dev-libs/rocm-hostcall compiler-clang-lto
dev-util/rocm-clang-ocl compiler-clang-lto
dev-libs/rocm-device-libs compiler-clang-lto
dev-libs/rocm-opencl-runtime compiler-clang-lto
Comment 7 dawgg 2022-07-06 18:33:00 UTC
with USE="-clang" it compiled cleanly today.
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-06 20:23:04 UTC
(In reply to xdev52 from comment #6)
> (In reply to Sam James from comment #5)
> > You should not need to recursively recompile with Clang as its output should
> > be ABI compatible with GCC. You probably dangerously have default-libcxx on
> > or similar.
> 
> Indeed. What you suggest? Turn this flags (default-compiler-rt
> default-libcxx default-lld llvm-libunwind) off?
> 

default-libcxx is the only dangerous one there.

>  sys-devel/clang-14.0.6:14::gentoo  USE="default-compiler-rt default-libcxx
> default-lld llvm-libunwind (pie) static-analyzer xml -debug -doc -test
> -verify-sig"
> 
> Wanted to have independly from gcc compilation environment but it gives some
> troubles with re2(chromium and qtwebengine sharing lib) and samba(libunwind
> issue) package too. 
> 

If you want to go full blown libcxx, you'd need to build your entire system with it, and the transition is dangerous.
Comment 9 xdev52 2022-07-07 11:34:15 UTC
So, this bug only exists when using Clang flag set on during libreoffice compilation and system has @world set flags mostly for Clang but coexisting with GCC:
default-libcxx

(these below are recursively must be also set on for default-libcxx @world)
default-compiler-rt
llvm-libunwind
libunwind

then all of it muse be disabled and compilation should be ok? I need to check it first but just set -clang gives proper compilation for libreoffice

It's not a bug but configure gives not proper error explanation. It' not contribs-lib missing but dev-cpp/clucene is compiled using GCC and Clang has active default-libcxx.
Comment 10 xdev52 2022-07-08 12:21:18 UTC
recompiled clang with "-default-libcxx" and rest of packages and libreoffice with "clang" flag compiled well.

So this "bug" only appears when for Clang is set flag on "default-libcxx".
Comment 11 Jory A. Pratt gentoo-dev 2022-07-13 23:49:34 UTC
(In reply to xdev52 from comment #10)
> recompiled clang with "-default-libcxx" and rest of packages and libreoffice
> with "clang" flag compiled well.
> 
> So this "bug" only appears when for Clang is set flag on "default-libcxx".

Your assumptions are incorrect this bug happens even when -clang is set.
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-14 02:53:04 UTC
(In reply to Jory A. Pratt from comment #11)
> (In reply to xdev52 from comment #10)
> > recompiled clang with "-default-libcxx" and rest of packages and libreoffice
> > with "clang" flag compiled well.
> > 
> > So this "bug" only appears when for Clang is set flag on "default-libcxx".
> 
> Your assumptions are incorrect this bug happens even when -clang is set.

The error is kind of generic. Are you getting the same ld.lld: error: undefined symbol spew...?
Comment 13 Seryoga Leshii 2023-05-06 12:10:26 UTC
It can be avoided by several ways:
- By building clucene with a patch that removes the use of binary_function
- By adding -D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES to CXXFLAGS and using custom-cflags use-flag while building libreoffice (and clucene)
- By building both with GCC.
Comment 14 Alec Ari 2023-05-20 05:42:39 UTC
I added -D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES to clucene because it wouldn't compile otherwise.

I now have to add that to libreoffice as well to get past the configure issue about contribs-lib missing? Just making sure I understand correctly because I don't think that adding -D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES to libreoffice would get past the configure check. When ./configure reports a missing library, it's almost always because something is actually missing.
Comment 15 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-20 05:44:55 UTC
(In reply to Alec Ari from comment #14)
> I added -D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES to clucene because it
> wouldn't compile otherwise.
> 
> I now have to add that to libreoffice as well to get past the configure
> issue about contribs-lib missing? Just making sure I understand correctly
> because I don't think that adding -D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES to
> libreoffice would get past the configure check. When ./configure reports a
> missing library, it's almost always because something is actually missing.

It's not really missing here, it just tries to build a test program against it and fails, so concludes it must be missing (or otherwise broken).

In any case, the issue is clear, we need to patch clucene. The only reason I haven't Just Done It yet is that these deprecated (removed) functions are in their *public* headers, which means patching them out is probably going to break ABI.
Comment 16 Alec Ari 2023-05-20 06:07:34 UTC
(In reply to Sam James from comment #15)
> (In reply to Alec Ari from comment #14)
> > I added -D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES to clucene because it
> > wouldn't compile otherwise.
> > 
> > I now have to add that to libreoffice as well to get past the configure
> > issue about contribs-lib missing? Just making sure I understand correctly
> > because I don't think that adding -D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES to
> > libreoffice would get past the configure check. When ./configure reports a
> > missing library, it's almost always because something is actually missing.
> 
> It's not really missing here, it just tries to build a test program against
> it and fails, so concludes it must be missing (or otherwise broken).
> 
> In any case, the issue is clear, we need to patch clucene. The only reason I
> haven't Just Done It yet is that these deprecated (removed) functions are in
> their *public* headers, which means patching them out is probably going to
> break ABI.

Sam! Thank you! -D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES added to libreoffice fixes this issue (mitigates for the time being, heh good enough for me)
Comment 17 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-20 06:08:33 UTC
no problem! I really do hope to get it sorted soon, it's just a thorny one because it's worse than normal. Thanks!
Comment 18 Larry the Git Cow gentoo-dev 2023-06-28 21:14:38 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1ba9c12d6ed1d6054c055bea8480e2d0132ae8eb

commit 1ba9c12d6ed1d6054c055bea8480e2d0132ae8eb
Author:     LinuxUserGD <hugegameartgd@gmail.com>
AuthorDate: 2023-04-10 22:01:01 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-06-28 21:13:55 +0000

    dev-cpp/clucene: fix removed std::binary_function in c++17
    
    Closes: https://bugs.gentoo.org/853298
    Closes: https://bugs.gentoo.org/869170
    Signed-off-by: LinuxUserGD <hugegameartgd@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/30547
    Signed-off-by: Sam James <sam@gentoo.org>

 ...2.3.3.4-r8.ebuild => clucene-2.3.3.4-r9.ebuild} |   1 +
 .../clucene-2.3.3.4-fix-binary-function.patch      | 199 +++++++++++++++++++++
 2 files changed, 200 insertions(+)