Latest changes to poppler breaks build against Clang and libc++15

Etna - etna at outlook.sg
Sun Jan 12 01:50:04 UTC 2025


Hello all, attempting to build the latest checkout against Debian 12 on a self-compiled LLVM15, libc++15 and clang-15 returns the following error:

-----------
/home/etna/Tmpdir/libreoffice/build/workdir/UnpackedTarball/poppler/poppler/Dict.cc:116:30: error: no member named 'sort' in namespace 'std::ranges'
                std::ranges::sort(that->entries, CmpDictEntry {});
                ~~~~~~~~~~~~~^
/home/etna/Tmpdir/libreoffice/build/workdir/UnpackedTarball/poppler/poppler/Dict.cc:123:39: error: no member named 'lower_bound' in namespace 'std::ranges'
        const auto pos = std::ranges::lower_bound(entries, key, std::less<> {}, &DictEntry::first);
                         ~~~~~~~~~~~~~^
[CXX] workdir/UnpackedTarball/poppler/poppler/PageTransition.cc
[CXX] workdir/UnpackedTarball/poppler/poppler/Parser.cc
2 errors generated.
make[1]: *** [/home/etna/Tmpdir/libreoffice/solenv/gbuild/LinkTarget.mk:403: /home/etna/Tmpdir/libreoffice/build/workdir/GenCxxObject/UnpackedTarball/poppler/poppler/Dict.o] Error 1
make[1]: *** Waiting for unfinished jobs....
/home/etna/Tmpdir/libreoffice/build/workdir/UnpackedTarball/poppler/poppler/Catalog.cc:708:22: error: no member named 'sort' in namespace 'std::ranges'
        std::ranges::sort(entries, [](const auto &first, const auto &second) { return first->name.cmp(&second->name) < 0; });
        ~~~~~~~~~~~~~^
/home/etna/Tmpdir/libreoffice/build/workdir/UnpackedTarball/poppler/poppler/Catalog.cc:757:31: error: no member named 'lower_bound' in namespace 'std::ranges'
    auto entry = std::ranges::lower_bound(entries, name, EntryGooStringComparer {});
                 ~~~~~~~~~~~~~^
2 errors generated.
make[1]: *** [/home/etna/Tmpdir/libreoffice/solenv/gbuild/LinkTarget.mk:399: /home/etna/Tmpdir/libreoffice/build/workdir/GenCxxObject/UnpackedTarball/poppler/poppler/Catalog.o] Error 1
/home/etna/Tmpdir/libreoffice/build/workdir/UnpackedTarball/poppler/poppler/Annot.cc:7502:29: error: no member named 'find' in namespace 'std::ranges'
    auto idx = std::ranges::find(annots, annot);
               ~~~~~~~~~~~~~^
1 error generated.
make[1]: *** [/home/etna/Tmpdir/libreoffice/solenv/gbuild/LinkTarget.mk:399: /home/etna/Tmpdir/libreoffice/build/workdir/GenCxxObject/UnpackedTarball/poppler/poppler/Annot.o] Error 1
/home/etna/Tmpdir/libreoffice/build/workdir/UnpackedTarball/poppler/poppler/Gfx.cc:2548:22: error: no type named 'sort' in namespace 'std::ranges'
        std::ranges::sort(bboxIntersections);
        ~~~~~~~~~~~~~^
/home/etna/Tmpdir/libreoffice/build/workdir/UnpackedTarball/poppler/poppler/Gfx.cc:2649:22: error: no type named 'sort' in namespace 'std::ranges'
        std::ranges::sort(s);
        ~~~~~~~~~~~~~^
/home/etna/Tmpdir/libreoffice/build/workdir/UnpackedTarball/poppler/poppler/Gfx.cc:2790:26: error: no type named 'sort' in namespace 'std::ranges'
            std::ranges::sort(s);
            ~~~~~~~~~~~~~^
/home/etna/Tmpdir/libreoffice/build/workdir/UnpackedTarball/poppler/poppler/GlobalParams.cc:369:30: error: no member named 'find' in namespace 'std::ranges'
            if (std::ranges::find(filesToIgnore, fi->path->toStr()) == filesToIgnore.end()) {
                ~~~~~~~~~~~~~^
/home/etna/Tmpdir/libreoffice/build/workdir/UnpackedTarball/poppler/poppler/GfxFont.cc:1871:22: error: no member named 'sort' in namespace 'std::ranges'
        std::ranges::sort(widths.exceps, cmpWidthExcepFunctor());
        ~~~~~~~~~~~~~^
/home/etna/Tmpdir/libreoffice/build/workdir/UnpackedTarball/poppler/poppler/GlobalParams.cc:380:34: error: no member named 'find' in namespace 'std::ranges'
                if (std::ranges::find(filesToIgnore, fi->path->toStr()) == filesToIgnore.end()) {
                    ~~~~~~~~~~~~~^
/home/etna/Tmpdir/libreoffice/build/workdir/UnpackedTarball/poppler/poppler/GlobalParams.cc:392:34: error: no member named 'find' in namespace 'std::ranges'
                if (std::ranges::find(filesToIgnore, fi->path->toStr()) == filesToIgnore.end()) {
                    ~~~~~~~~~~~~~^
/home/etna/Tmpdir/libreoffice/build/workdir/UnpackedTarball/poppler/poppler/GfxFont.cc:1919:22: error: no member named 'sort' in namespace 'std::ranges'
        std::ranges::sort(widths.excepsV, cmpWidthExcepVFunctor());
        ~~~~~~~~~~~~~^
/home/etna/Tmpdir/libreoffice/build/workdir/UnpackedTarball/poppler/poppler/GlobalParams.cc:740:18: error: no member named 'replace' in namespace 'std::ranges'
    std::ranges::replace(fontName, '-', ' ');
    ~~~~~~~~~~~~~^
3 errors generated.
make[1]: *** [/home/etna/Tmpdir/libreoffice/solenv/gbuild/LinkTarget.mk:399: /home/etna/Tmpdir/libreoffice/build/workdir/GenCxxObject/UnpackedTarball/poppler/poppler/Gfx.o] Error 1
/home/etna/Tmpdir/libreoffice/build/workdir/UnpackedTarball/poppler/poppler/GlobalParams.cc:1123:38: error: no member named 'find' in namespace 'std::ranges'
                    if (std::ranges::find(filesToIgnore, sFilePath) == filesToIgnore.end()) {
                        ~~~~~~~~~~~~~^
2 errors generated.
make[1]: *** [/home/etna/Tmpdir/libreoffice/solenv/gbuild/LinkTarget.mk:399: /home/etna/Tmpdir/libreoffice/build/workdir/GenCxxObject/UnpackedTarball/poppler/poppler/GfxFont.o] Error 1
5 errors generated.
make[1]: *** [/home/etna/Tmpdir/libreoffice/solenv/gbuild/LinkTarget.mk:399: /home/etna/Tmpdir/libreoffice/build/workdir/GenCxxObject/UnpackedTarball/poppler/poppler/GlobalParams.o] Error 1
make: *** [Makefile:296: build] Error 2
-----------

By some blind Googling luck, it seems adding the -fexperimental-library flag to clang++ in CXX and CXXFLAGS worked around the issue, but is there anyway this can be addressed without having to use the flag?

Also, just a wild guess: does the patchset in core/external/poppler/clang-std-ranges.patch.1 have anything to do with this?

Thank you.


More information about the LibreOffice mailing list