Created attachment 725305 [details] Darktable build.log Building media-gfx/darktable (versions 3.4.1 and 3.6.0) fails due to dev-util/cmake-3.21.0 creating a bad ninja.build. With dev-util/cmake-3.20.5 darktable builds fine. The issue appears in libxcf.a LINK_FLAGS part in /var/tmp/portage/media-gfx/darktable-3.6.0/work/darktable-3.6.0_build/build.ninja: # Link the static library bin/external/libxcf/libxcf.a build bin/external/libxcf/libxcf.a: C_STATIC_LIBRARY_LINKER__xcf_RELWITHDEBINFO bin/external/libxcf/CMakeFiles/xcf.dir/xcf.c.o bin/external/libxcf/CM akeFiles/xcf.dir/xcf_names.c.o LANGUAGE_COMPILE_FLAGS = -march=native -O3 -pipe -msse3 -Wall -Wformat -Wformat-security -Wshadow -Wtype-limits -Wvla -Wold-style-declaration -Wno- unknown-pragmas -Wno-error=varargs -Wno-format-truncation -Wno-error=address-of-packed-member LINK_FLAGS = -Wl,--no-as-needed and the build fails because LINK_FLAGS gets passed to /usr/bin/x86_64-pc-linux-gnu-ar. My emerge --info shows LTO items but this bug reproduces with LTO configurations removed. Darktable does require a gcc built with USE flag "graphite", though.
Created attachment 725308 [details] emerge --info
Reproduced. Looks to me like another case of problems propagating Gentoo CMake settings to a a full CMake project embedded as a dependency into another one. I say "another" because there has been at least one case like that before, in >=sci-libs/pastix-6. It feels like this should be something we should ultimately handle on dev-util/cmake side, in the meantime however I'll apply a workaround to media-gfx/darktable.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=10f3f7f638cbe55958959df5d83597c090ba5f25 commit 10f3f7f638cbe55958959df5d83597c090ba5f25 Author: Marek Szuba <marecki@gentoo.org> AuthorDate: 2021-07-21 19:37:08 +0000 Commit: Marek Szuba <marecki@gentoo.org> CommitDate: 2021-07-21 19:45:05 +0000 media-gfx/darktable: strip down compilation of bundled libxcf Needed to make cmake-3.21/ninja stop trying to pass LDFLAGS to ar. Since stripping src/external/libxcf/CMakeLists.txt to the bare minimum results in a patch about the same size as the file itself, just inject the necessary lines to src/external/CMakeLists.txt and ignore the one in libxcf. Tested on both 3.4.1 and 3.6.0, with cmake versions 3.18.5 and 3.21.0; all combinations seem to build fine. Closes: https://bugs.gentoo.org/803053 Signed-off-by: Marek Szuba <marecki@gentoo.org> media-gfx/darktable/darktable-3.4.1.ebuild | 1 + media-gfx/darktable/darktable-3.6.0.ebuild | 1 + .../files/darktable-3.4.1_libxcf-cmake.patch | 20 ++++++++++++++++++++ 3 files changed, 22 insertions(+)