Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 928152

Summary: app-office/libreoffice failed to build, error: ‘free’ is not a member of ‘std’
Product: Gentoo Linux Reporter: look
Component: Current packagesAssignee: Gentoo Office Team <office>
Status: RESOLVED FIXED    
Severity: normal CC: dev, look, stffn.mobil
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/36049
Whiteboard: fixed in 7.6.6.3
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 914580    
Attachments: The emerge --info output
The build environment.
The build log.

Description look 2024-03-30 06:47:49 UTC
Hello. I have just switched profiles and libreoffice built just fine for me before switching. Now I get the error:

/var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/store/source/storbase.hxx: In static member function ‘static void store::OStorePageObject::operator delete(void*)’:
/var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/store/source/storbase.hxx:529:14: error: ‘free’ is not a member of ‘std’
  529 |         std::free (p);
      |              ^~~~
make[1]: *** [/var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/solenv/gbuild/LinkTarget.mk:334: /var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/workdir/CxxObject/store/source/stordir.o] Error 1
make[1]: *** [/var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/solenv/gbuild/LinkTarget.mk:334: /var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/workdir/CxxObject/store/source/storlckb.o] Error 1
make[1]: *** [/var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/solenv/gbuild/LinkTarget.mk:334: /var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/workdir/CxxObject/store/source/storbios.o] Error 1
make[1]: *** [/var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/solenv/gbuild/LinkTarget.mk:334: /var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/workdir/CxxObject/store/source/stortree.o] Error 1
make[1]: *** [/var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/solenv/gbuild/LinkTarget.mk:334: /var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/workdir/CxxObject/store/source/stordata.o] Error 1
make[1]: *** [/var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/solenv/gbuild/LinkTarget.mk:334: /var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/workdir/CxxObject/store/source/storpage.o] Error 1
make[1]: *** [/var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/solenv/gbuild/LinkTarget.mk:334: /var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/workdir/CxxObject/store/source/lockbyte.o] Error 1
rm /var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/workdir/CustomTarget/i18npool/breakiterator/line.brk /var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/workdir/CustomTarget/i18npool/breakiterator/dict_word_prepostdash.txt /var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/workdir/CustomTarget/i18npool/breakiterator/edit_word_he.txt /var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/workdir/CustomTarget/i18npool/breakiterator/edit_word_hu.txt /var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/workdir/CustomTarget/i18npool/breakiterator/dict_word_nodash.brk /var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/workdir/CustomTarget/i18npool/breakiterator/dict_word_prepostdash.brk /var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/workdir/CustomTarget/i18npool/breakiterator/line.txt /var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/workdir/CustomTarget/i18npool/breakiterator/edit_word.brk /var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/workdir/CustomTarget/i18npool/breakiterator/dict_word.txt /var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/workdir/CustomTarget/i18npool/breakiterator/dict_word_nodash.txt /var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/workdir/CustomTarget/i18npool/breakiterator/dict_word_he.brk /var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/workdir/CustomTarget/i18npool/breakiterator/count_word.brk /var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/workdir/CustomTarget/i18npool/breakiterator/dict_word_hu.txt /var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/workdir/CustomTarget/i18npool/breakiterator/edit_word.txt /var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/workdir/CustomTarget/i18npool/breakiterator/edit_word_he.brk /var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/workdir/CustomTarget/i18npool/breakiterator/dict_word_hu.brk /var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/workdir/CustomTarget/i18npool/breakiterator/edit_word_hu.brk /var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/workdir/CustomTarget/i18npool/breakiterator/count_word.txt /var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/workdir/CustomTarget/i18npool/breakiterator/sent.txt /var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/workdir/CustomTarget/i18npool/breakiterator/sent.brk /var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/workdir/CustomTarget/i18npool/breakiterator/dict_word_he.txt /var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3/workdir/CustomTarget/i18npool/breakiterator/dict_word.brk
make[1]: Leaving directory '/var/tmp/portage/app-office/libreoffice-7.6.6.3/work/libreoffice-7.6.6.3'
make: *** [Makefile:289: build] Error 2
 * ERROR: app-office/libreoffice-7.6.6.3::gentoo failed (compile phase):
 *   emake failed
Comment 1 look 2024-03-30 06:48:17 UTC
Created attachment 889031 [details]
The emerge --info output
Comment 2 look 2024-03-30 06:48:33 UTC
Created attachment 889032 [details]
The build environment.
Comment 3 look 2024-03-30 06:49:56 UTC
Created attachment 889033 [details]
The build log.
Comment 4 foearb 2024-03-30 10:25:00 UTC
I don't know what is exactly causing this, but the problem is GCC 14. If you want to install libreoffice right now, you can switch to GCC 13 for this build.

Without digging any more into it, I would guess that libreoffice depends on some sort of transitive include of a C++ library header (specifically '<cstdlib>'), which puts the naked C functions in the 'std::' namespace, and upstream GCC removed that transitive include. That happens regularly with major releases of the big compilers.
Comment 5 Robert Greener 2024-04-01 19:02:03 UTC
Have submitted a PR that fixes this by backporting a patch from the 24.x branch:

https://github.com/gentoo/gentoo/pull/36049

Have also asked libreoffice if they can backport the patch upstream: https://bugs.documentfoundation.org/show_bug.cgi?id=160464
Comment 6 Larry the Git Cow gentoo-dev 2024-04-03 05:02:00 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8f224f3894ade5676409e39999cf00fc6d0a3ddc

commit 8f224f3894ade5676409e39999cf00fc6d0a3ddc
Author:     Robert Greener <me@r0bert.dev>
AuthorDate: 2024-04-02 20:29:25 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-04-03 04:55:45 +0000

    app-office/libreoffice: Backport patch from 24.x branch to allow GCC 14 compilation
    
    Closes: https://bugs.gentoo.org/928152
    Signed-off-by: Robert Greener <me@r0bert.dev>
    Closes: https://github.com/gentoo/gentoo/pull/36049
    Signed-off-by: Sam James <sam@gentoo.org>

 app-office/libreoffice/libreoffice-7.6.6.3.ebuild | 1 +
 1 file changed, 1 insertion(+)