After the upgrade to media-libs/zxing-cpp-2.0.0 libreoffice is picked by @preserved-rebuild as needing rebuild, but it fails to emerge letto@localhost: ~ $ sudo emerge -av @preserved-rebuild These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild R ] app-office/libreoffice-7.4.3.2::gentoo USE="branding clang dbus kde mariadb pdfimport vulkan -accessibility -base -bluetooth -coinmp -cups -custom-cflags -debug -eds -firebird -googledrive -gstreamer -gtk -java -ldap -odk -postgres -test" LIBREOFFICE_EXTENSIONS="-nlpsolver -scripting-beanshell -scripting-javascript -wiki-publisher" PYTHON_SINGLE_TARGET="python3_10 -python3_8 -python3_9 -python3_11" 0 KiB ... configure: error: zxing headers not found. Reproducible: Always
Created attachment 848048 [details] build.log
Created attachment 848050 [details] emerge --info
Created attachment 848052 [details] config.log
commit 05c841fbf1f173837c1078ebf9b1ae076317413f Author: Andreas Sturmlechner <asturm@gentoo.org> Date: Mon Jan 9 22:09:42 2023 +0100 app-office/libreoffice: backport patch for >=zxing-cpp-1.4.0 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org> I guess this wasn't enough for you.
From config.log: ``` configure:38268: checking which libzxing to use configure:38271: result: external configure:38290: checking for MultiFormatWriter.h configure:38290: x86_64-pc-linux-gnu-clang++ -c -march=x86-64 -O2 -pipe -I/usr/include/ZXing conftest.cpp >&5 In file included from conftest.cpp:129: In file included from /usr/include/ZXing/MultiFormatWriter.h:8: In file included from /usr/include/ZXing/BarcodeFormat.h:9: In file included from /usr/include/ZXing/Flags.h:8: /usr/include/ZXing/BitHacks.h:17:16: warning: nested namespace definition is a C++17 extension; define each namespace separately [-Wc++17-extensions] namespace ZXing::BitHacks { ^~~~~~~~~~ { namespace BitHacks In file included from conftest.cpp:129: In file included from /usr/include/ZXing/MultiFormatWriter.h:8: /usr/include/ZXing/BarcodeFormat.h:59:56: error: use of undeclared identifier 'str'; did you mean 'std'? BarcodeFormat BarcodeFormatFromString(std::string_view str); ^~~ std /usr/lib/gcc/x86_64-pc-linux-gnu/12/include/g++-v12/bits/streambuf_iterator.h:38:11: note: 'std' declared here namespace std _GLIBCXX_VISIBILITY(default) ^ In file included from conftest.cpp:129: In file included from /usr/include/ZXing/MultiFormatWriter.h:8: /usr/include/ZXing/BarcodeFormat.h:59:56: error: expected ')' BarcodeFormat BarcodeFormatFromString(std::string_view str); ^ /usr/include/ZXing/BarcodeFormat.h:59:38: note: to match this '(' BarcodeFormat BarcodeFormatFromString(std::string_view str); ^ /usr/include/ZXing/BarcodeFormat.h:59:44: error: no member named 'string_view' in namespace 'std' BarcodeFormat BarcodeFormatFromString(std::string_view str); ~~~~~^ /usr/include/ZXing/BarcodeFormat.h:68:58: error: use of undeclared identifier 'str'; did you mean 'std'? BarcodeFormats BarcodeFormatsFromString(std::string_view str); ^~~ std /usr/lib/gcc/x86_64-pc-linux-gnu/12/include/g++-v12/bits/streambuf_iterator.h:38:11: note: 'std' declared here namespace std _GLIBCXX_VISIBILITY(default) ^ In file included from conftest.cpp:129: In file included from /usr/include/ZXing/MultiFormatWriter.h:8: /usr/include/ZXing/BarcodeFormat.h:68:58: error: expected ')' BarcodeFormats BarcodeFormatsFromString(std::string_view str); ^ /usr/include/ZXing/BarcodeFormat.h:68:40: note: to match this '(' BarcodeFormats BarcodeFormatsFromString(std::string_view str); ^ /usr/include/ZXing/BarcodeFormat.h:68:46: error: no member named 'string_view' in namespace 'std' BarcodeFormats BarcodeFormatsFromString(std::string_view str); ~~~~~^ In file included from conftest.cpp:129: In file included from /usr/include/ZXing/MultiFormatWriter.h:9: /usr/include/ZXing/CharacterSet.h:56:42: error: no type named 'string_view' in namespace 'std' CharacterSet CharacterSetFromString(std::string_view name); ~~~~~^ 1 warning and 7 errors generated. configure:38290: $? = 1 ```
Is this just a missing <string_view> include in the header?
(In reply to Sam James from comment #6) > Is this just a missing <string_view> include in the header? no, nevermind, it's there
It seems to rather be an issue with compiler settings. This is the first error that appears: > warning: nested namespace definition is a C++17 extension; define each > namespace separately [-Wc++17-extensions]
I would've assumed if it identified it as an extension, it would've errored out if it wasn't going to allow it anyway, but that might be a bad assumption.
Building zxing-2.0.0 works fine when configured like this: 'cmake .. -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++' This automatically adds -std=c++17 which seems to be missing from LO's conftest and therefore goes splat.
The reason it seems to work with gcc but not clang-15 is that gcc (>=11) defaults to std=c++17 whereas clang-15 still defaults to std=c++14 (clang-16 will default to std=c++17 as well). We might So LO's conftests will have to explicitly configure with std=c++17.
So I put this into /etc/portage/env/force_cpp17.conf: ========= ## CFLAGS: CFLAGS="-march=native -pipe -ggdb -O2 -ftree-vectorize" CXXFLAGS="-std=c++17 ${CFLAGS}" CFLAGS="-std=c18 ${CFLAGS}" LDFLAGS="${LDFLAGS} ${CFLAGS}" ======== And added "media-libs/zxing-cpp force_cpp17.conf" to /etc/portage/package.env/gentoo.env. I checked the zxing-2.0.0 build log (after a re-merge, of course) and the "-std=c++17" is in every compiler call. -------- ebuild /usr/portage/app-office/libreoffice/libreoffice-7.4.3.2.ebuild clean configure still ended in: configure: error: zxing headers not found.
(In reply to Sven Eden from comment #12) > configure: error: zxing headers not found. To make this clear: I use gcc-12, this issue is therefore not a clang-only thing. Upgrade zxing-cpp to 2.0.0 and libreoffice configure fails. Maybe it works with gcc-11... hang on... Nope, same result: "configure: error: zxing headers not found."
(In reply to Sven Eden from comment #13) > (In reply to Sven Eden from comment #12) > > configure: error: zxing headers not found. > > To make this clear: I use gcc-12, this issue is therefore not a clang-only > thing. Upgrade zxing-cpp to 2.0.0 and libreoffice configure fails. > > Maybe it works with gcc-11... > hang on... > Nope, same result: "configure: error: zxing headers not found." Please share the build.log & config.log from *your* run. Is it with USE=clang or USE=-clang? Also, keep in mind that you can't downgrade GCC for anything C++ anyway.
(In reply to Sven Eden from comment #13) > (In reply to Sven Eden from comment #12) > > configure: error: zxing headers not found. > > To make this clear: I use gcc-12, this issue is therefore not a clang-only > thing. Upgrade zxing-cpp to 2.0.0 and libreoffice configure fails. > > Maybe it works with gcc-11... > hang on... > Nope, same result: "configure: error: zxing headers not found." Interesting, thanks for checking! This means there might be more to the issue. Let me try with gcc as well.
Please note that LO[-clang] w/ zxing-2.0.0 was tested successfully with latest ~arch GCC-12 by me.
(In reply to Holger Hoffstätte from comment #15) > (In reply to Sven Eden from comment #13) > > (In reply to Sven Eden from comment #12) > > > configure: error: zxing headers not found. > > > > To make this clear: I use gcc-12, this issue is therefore not a clang-only > > thing. Upgrade zxing-cpp to 2.0.0 and libreoffice configure fails. > > > > Maybe it works with gcc-11... > > hang on... > > Nope, same result: "configure: error: zxing headers not found." > > Interesting, thanks for checking! This means there might be more to the > issue. Let me try with gcc as well. After Andreas' comment I didn't try with gcc but instead also created a config to force std=c++17 (yes, with USE=clang) and the conftest still fails: configure:38290: x86_64-pc-linux-gnu-clang++ -c -pipe -O2 -march=native -I/usr/include/ZXing conftest.cpp >&5 So it seems simply injecting CXXFLAGS into the ebuild does not work. The config.log says: .. CXX='x86_64-pc-linux-gnu-clang++' CXXCPP='x86_64-pc-linux-gnu-clang++ -E' CXXFLAGS='-pipe -O2 -march=native' CXXFLAGS_CXX11='-std=c++17' .. So something is funky with clang.
I added -std=c++17 to /etc/clang/clang++.cfg and .. .. checking whether to use zxing... yes checking which libzxing to use... external checking for MultiFormatWriter.h... yes checking for main in -lZXing... yes .. This is clearly the best solution :D
I emerged just fine with gcc-12 (deleted clang use flag)
Hello there! I an affected also, but seems in a bit another way. After release version media-libs/zxing-cpp-2.0.0 it is impossible to compile app-office/libreoffice because it falls with error: [CXX] cui/source/options/connpoolconfig.cxx /var/tmp/portage/app-office/libreoffice-7.5.0.1/work/libreoffice-7.5.0.1/cui/source/dialogs/QrCodeGenDialog.cxx:30:10: fatal error: BitArray.h: No such file or directory 30 | #include <BitArray.h> | ^~~~~~~~~~~~ compilation terminated.
7.5.0.1 is not provided by Gentoo ebuild repository so you are wrong in this bug in the first place. As such, this version simply does not contain that fix yet.
i suspect the reason setting CXXFLAGS doesn't work is because in configure.ac there are lots of tests which saves it to a variable and is supposed to reset it back but i think somewhere in the chain it gets forgotton, when i added -std=c++17 to CXXFLAGS variable in that file directly above the test for ZXING headers it gets past the checks this is what i did but is not a proper fix CXXFLAGS="$save_CXXFLAGS -std=c++17 -I$i/ZXing" AC_CHECK_HEADER(MultiFormatWriter.h, [ZXING_CFLAGS=-I$i/ZXing; break]
Created attachment 848227 [details, diff] ebuild.patch A quick and dirty patch to the ebuild that works-around the issue.
As Marius suggested I successfully compiled LO using gcc-12 with USE=-clang and noticed, that installed size grown by 6% (qsize -b): clang compiled 365597071 bytes gcc compiled 389798631 bytes - just an oddity. # app-office/libreoffice-7.4.3.2: 8842 files (8699 unique), 497 non-files, ...
Also happens for LO 7.4.4.2. The ebuild patch works for the configuration step, but compilation breaks.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c530f3090fb695e76a9f0376c0597418523d70e4 commit c530f3090fb695e76a9f0376c0597418523d70e4 Author: Sam James <sam@gentoo.org> AuthorDate: 2023-01-13 19:07:13 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-01-13 19:08:06 +0000 app-office/libreoffice: fix build w/ USE=clang & clang <16 Closes: https://bugs.gentoo.org/890324 Signed-off-by: Sam James <sam@gentoo.org> ...libreoffice-7.4.4.2-zxing-cpp-1.4.0-c++17.patch | 36 ++++++++++++++++++++++ app-office/libreoffice/libreoffice-7.4.4.2.ebuild | 1 + 2 files changed, 37 insertions(+)