https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/ Issue: media-libs/lib3mf-2.2.0 fails to compile (HARDENED-SYSTEM). Discovered on: amd64 (internal ref: hardened_tinderbox) NOTE: (HARDENED-SYSTEM) in the summary means that the bug was found on a machine that runs an hardened profile with -D_FORTIFY_SOURCE=3 and -D_GLIBCXX_ASSERTIONS (https://www.gentoo.org/support/news-items/2023-01-01-hardening-fortify-assertions.html) but this bug MAY or MAY NOT BE related to the changes related to hardened.
Created attachment 852352 [details] build.log build log and emerge --info
Error(s) that match a know pattern in addition to what has been reported in the summary: FAILED: Tests/CPP_Bindings/CMakeFiles/Test_CPP_Bindings.dir/Source/AllTests.cpp.o FAILED: Tests/CPP_Bindings/CMakeFiles/Test_CPP_Bindings.dir/Source/Attachments.cpp.o FAILED: Tests/CPP_Bindings/CMakeFiles/Test_CPP_Bindings.dir/Source/BaseMaterialGroup.cpp.o FAILED: Tests/CPP_Bindings/CMakeFiles/Test_CPP_Bindings.dir/Source/BeamLattice.cpp.o FAILED: Tests/CPP_Bindings/CMakeFiles/Test_CPP_Bindings.dir/Source/BeamSets.cpp.o FAILED: Tests/CPP_Bindings/CMakeFiles/Test_CPP_Bindings.dir/Source/BuildItems.cpp.o FAILED: Tests/CPP_Bindings/CMakeFiles/Test_CPP_Bindings.dir/Source/ColorGroup.cpp.o FAILED: Tests/CPP_Bindings/CMakeFiles/Test_CPP_Bindings.dir/Source/CompositeMaterials.cpp.o FAILED: Tests/CPP_Bindings/CMakeFiles/Test_CPP_Bindings.dir/Source/EncryptionMethods.cpp.o FAILED: Tests/CPP_Bindings/CMakeFiles/Test_CPP_Bindings.dir/Source/MeshObject.cpp.o FAILED: Tests/CPP_Bindings/CMakeFiles/Test_CPP_Bindings.dir/Source/MetaData.cpp.o /usr/include/gtest/internal/gtest-port.h:270:2: error: #error C++ versions less than C++14 are not supported.
-std=c++11 is being added to CXXFLAGS. Forcing a C++ dialect lower than the compiler default via CXXFLAGS isn't really something that should be guarded against. Most modern C++ code would likely fail to compile if -std=c++98 were added globally to CXXFLAGS. GCC defaults to C++17 and Clang to C++14 (soon to be C++17). Given that, I would consider this bug invalid.
Never mind. I was building with clang and for some reason the Makefile emits -std=c++11 with GCC.
The CMakeLists.txt file sets C++11 for GNU compilers and on Darwin. I can test, whether filtering this flag builds with gcc.
This issue isn't even hardened dependent. It triggers on a non-hardened system as well, if current gtest-1.13.0 is used.
Thanks for reporting the issue upstream. I tend not to bother given the expected push-back to unbundling, but they do include a USE_INCLUDED_GTEST cmake flag so it looks like it's supported.
Yes they have this cmake option, but don't ship the submodule with their tarballs. This option is only meaningful if you build from the git repo, aka a live ebuild.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5cc37b8d342de65e1dec5744d9b600c101e14078 commit 5cc37b8d342de65e1dec5744d9b600c101e14078 Author: Peter Levine <plevine457@gmail.com> AuthorDate: 2023-02-18 10:36:33 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-02-22 16:14:13 +0000 media-libs/lib3mf: fix bug #895180 Remove the lines in CMakeLists.txt that emit -std=c++11 (as wall as emitting -O2) to enable the compiler default, which builds against the latest GTest with both clang-16.0.0_pre20230107 and gcc-12.2.1_p20230121-r1. Closes: https://bugs.gentoo.org/895180 Closes: https://github.com/gentoo/gentoo/pull/29644 Signed-off-by: Peter Levine <plevine457@gmail.com> Signed-off-by: Sam James <sam@gentoo.org> ...ib3mf-2.2.0-0001-remove-std-and-opt-flags.patch | 30 ++++++++++++++++++++++ media-libs/lib3mf/lib3mf-2.2.0.ebuild | 3 ++- 2 files changed, 32 insertions(+), 1 deletion(-)