-- Looking for pthread.h -- Looking for pthread.h - not found CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:218 (message): Could NOT find Threads (missing: Threads_FOUND) Call Stack (most recent call first): /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:582 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake/Modules/FindThreads.cmake:234 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) Source/cmake/WebKitFindPackage.cmake:104 (_find_package) Source/cmake/OptionsGTK.cmake:49 (find_package) Source/cmake/WebKitCommon.cmake:58 (include) CMakeLists.txt:173 (include) -- Configuring incomplete, errors occurred! See also "/var/tmp/portage/net-libs/webkit-gtk-2.30.4-r1/work/webkit-gtk-2.30.4_build/CMakeFiles/CMakeOutput.log". See also "/var/tmp/portage/net-libs/webkit-gtk-2.30.4-r1/work/webkit-gtk-2.30.4_build/CMakeFiles/CMakeError.log". --- from stderr log: Determining if the include file pthread.h exists failed with the following output: Change Dir: /var/tmp/portage/net-libs/webkit-gtk-2.30.4-r1/work/webkit-gtk-2.30.4_build/CMakeFiles/CMakeTmp Run Build Command(s):/usr/bin/ninja cmTC_e808f && [1/2] Building C object CMakeFiles/cmTC_e808f.dir/CheckIncludeFile.c.o [2/2] Linking C executable cmTC_e808f FAILED: cmTC_e808f : && /usr/lib/ccache/bin/x86_64-pc-linux-gnu-gcc-10.2.0 -fcolor-diagnostics -Wextra -Wall -Wno-expansion-to-defined -Wno-psabi -Wno-maybe-uninitialized -Wwrite-strings -Wundef -Wpointer-arith -Wmissing-format-attribute -Wformat-security -Wcast-align -march=znver2 --param l1-cache-size=32 --param l1-cache-line-size=64 -O2 -pipe -frecord-gcc-switches -fno-strict-aliasing -fno-exceptions -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -Wl,--no-keep-memory -fuse-ld=gold -Wl,--disable-new-dtags CMakeFiles/cmTC_e808f.dir/CheckIncludeFile.c.o -o cmTC_e808f && : x86_64-pc-linux-gnu-gcc-10.2.0: error: unrecognized command-line option ‘-fcolor-diagnostics’ ninja: build stopped: subcommand failed.
Created attachment 679419 [details] emerge-info.txt
Created attachment 679422 [details] /var/log/portage/net-libs:webkit-gtk-2.30.4-r1:20201225-084555.log
Created attachment 679425 [details] CMakeError.log
Created attachment 679437 [details] CMakeOutput.log
It seems to consider -fcolor-diagnostics to be working but I have no clue why. The logs aren't exactly designed to be useful.
I suspect this ccache-related again, see bug #758614
It just unconditionally tries to add them when using ninja: # Ninja tricks compilers into turning off color support. if (CMAKE_GENERATOR STREQUAL "Ninja") WEBKIT_PREPEND_GLOBAL_COMPILER_FLAGS(-fcolor-diagnostics -fdiagnostics-color=always) endif () But all of those are indeed checked if supported by compiler (this is the C++ version, C is the same): # Prepends flags to CMAKE_CXX_FLAGS if supported by the C++ compiler. Almost all # flags should be prepended to allow the user to override them. macro(WEBKIT_PREPEND_GLOBAL_CXX_FLAGS) foreach (_flag ${ARGN}) check_cxx_compiler_flag("${_flag}" CXX_COMPILER_SUPPORTS_${_flag}) if (CXX_COMPILER_SUPPORTS_${_flag}) set(CMAKE_CXX_FLAGS "${_flag} ${CMAKE_CXX_FLAGS}") endif () endforeach () endmacro() # Prepends flags to CMAKE_C_FLAGS and CMAKE_CXX_FLAGS if supported by the C # or C++ compiler, respectively. Almost all flags should be prepended to allow # the user to override them. macro(WEBKIT_PREPEND_GLOBAL_COMPILER_FLAGS) WEBKIT_PREPEND_GLOBAL_C_FLAGS(${ARGN}) WEBKIT_PREPEND_GLOBAL_CXX_FLAGS(${ARGN}) endmacro() And it seems to work per the output log: Source file was: int main() { return 0; } Performing C SOURCE FILE Test C_COMPILER_SUPPORTS_-fcolor-diagnostics succeeded with the following output: Change Dir: /var/tmp/portage/net-libs/webkit-gtk-2.30.4-r1/work/webkit-gtk-2.30.4_build/CMakeFiles/CMakeTmp Run Build Command(s):/usr/bin/ninja cmTC_ed170 && [1/2] Building C object CMakeFiles/cmTC_ed170.dir/src.c.o <command-line>: warning: ISO C99 requires whitespace after the macro name [2/2] Linking C executable cmTC_ed170 Source file was: int main(void) { return 0; } Performing C++ SOURCE FILE Test CXX_COMPILER_SUPPORTS_-fcolor-diagnostics succeeded with the following output: Change Dir: /var/tmp/portage/net-libs/webkit-gtk-2.30.4-r1/work/webkit-gtk-2.30.4_build/CMakeFiles/CMakeTmp Run Build Command(s):/usr/bin/ninja cmTC_28ac8 && [1/2] Building CXX object CMakeFiles/cmTC_28ac8.dir/src.cxx.o <command-line>: warning: ISO C++11 requires whitespace after the macro name [2/2] Linking CXX executable cmTC_28ac8 Source file was: int main() { return 0; }
Note that none of this changed between 2.30.3 and 2.30.4 in WebKit cmake files
while I spotted successes in the CMakeOutput.lg file as pasted into previous comment, CMakeError.log has the opposite in it: Source file was: int main() { return 0; } Performing C SOURCE FILE Test C_COMPILER_SUPPORTS_-fdiagnostics-color=always failed with the following output: Change Dir: /var/tmp/portage/net-libs/webkit-gtk-2.30.4-r1/work/webkit-gtk-2.30.4_build/CMakeFiles/CMakeTmp Run Build Command(s):/usr/bin/ninja cmTC_4a87f && [1/2] Building C object CMakeFiles/cmTC_4a87f.dir/src.c.o <command-line>: warning: ISO C99 requires whitespace after the macro name [2/2] Linking C executable cmTC_4a87f FAILED: cmTC_4a87f : && /usr/lib/ccache/bin/x86_64-pc-linux-gnu-gcc-10.2.0 -fcolor-diagnostics -Wextra -Wall -Wno-expansion-to-defined -Wno-psabi -Wno-maybe-uninitialized -Wwrite-strings -Wundef -Wpointer-arith -Wmissing-format-attribute -Wformat-security -Wcast-align -march=znver2 --param l1-cache-size=32 --param l1-cache-line-size=64 -O2 -pipe -frecord-gcc-switches -fno-strict-aliasing -fno-exceptions -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -Wl,--no-keep-memory CMakeFiles/cmTC_4a87f.dir/src.c.o -o cmTC_4a87f && : x86_64-pc-linux-gnu-gcc-10.2.0: error: unrecognized command-line option '-fcolor-diagnostics' ninja: build stopped: subcommand failed. Source file was: int main(void) { return 0; } Performing C++ SOURCE FILE Test CXX_COMPILER_SUPPORTS_-fdiagnostics-color=always failed with the following output: Change Dir: /var/tmp/portage/net-libs/webkit-gtk-2.30.4-r1/work/webkit-gtk-2.30.4_build/CMakeFiles/CMakeTmp Run Build Command(s):/usr/bin/ninja cmTC_2b0e9 && [1/2] Building CXX object CMakeFiles/cmTC_2b0e9.dir/src.cxx.o <command-line>: warning: ISO C++11 requires whitespace after the macro name [2/2] Linking CXX executable cmTC_2b0e9 FAILED: cmTC_2b0e9 : && /usr/lib/ccache/bin/x86_64-pc-linux-gnu-g++-10.2.0 -fcolor-diagnostics -Wextra -Wall -Wno-expansion-to-defined -Wno-noexcept-type -Wno-psabi -Wno-maybe-uninitialized -Wwrite-strings -Wundef -Wpointer-arith -Wmissing-format-attribute -Wformat-security -Wcast-align -march=znver2 --param l1-cache-size=32 --param l1-cache-line-size=64 -O2 -pipe -frecord-gcc-switches -fno-strict-aliasing -fno-exceptions -fno-rtti -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -Wl,--no-keep-memory CMakeFiles/cmTC_2b0e9.dir/src.cxx.o -o cmTC_2b0e9 && : x86_64-pc-linux-gnu-g++-10.2.0: error: unrecognized command-line option '-fcolor-diagnostics' ninja: build stopped: subcommand failed.
So -fcolor-diagnostics is not supported by gcc, while -fdiagnostics-color=always is in fact supported by gcc10. But then for you it seems to start using the not supported version, instead of the supported one. For me all this is working just fine: -- Performing Test C_COMPILER_SUPPORTS_-fcolor-diagnostics -- Performing Test C_COMPILER_SUPPORTS_-fcolor-diagnostics - Failed -- Performing Test C_COMPILER_SUPPORTS_-fdiagnostics-color=always -- Performing Test C_COMPILER_SUPPORTS_-fdiagnostics-color=always - Success -- Performing Test CXX_COMPILER_SUPPORTS_-fcolor-diagnostics -- Performing Test CXX_COMPILER_SUPPORTS_-fcolor-diagnostics - Failed -- Performing Test CXX_COMPILER_SUPPORTS_-fdiagnostics-color=always -- Performing Test CXX_COMPILER_SUPPORTS_-fdiagnostics-color=always - Success and then compilation uses the working one, like this: [21/4615] /usr/bin/x86_64-pc-linux-gnu-g++ -DBUILDING_GTK__=1 -DBUILDING_WITH_CMAKE=1 -DBUILDING_bmalloc -DBWRAP_EXECUTABLE=\"/usr/bin/bwrap\" -DDBUS_PROXY_EXECUTABLE=\"/usr/bin/xdg-dbus-proxy\" -DGETTEXT_PACKAGE=\"WebKit2GTK-4.0\" -DHAVE_CONFIG_H=1 -DJSC_GLIB_API_ENABLED -DSVN_REVISION=\"tarball\" -DWEBKITGTK_API_VERSION_STRING=\"4.0\" -I/tmp/portage/net-libs/webkit-gtk-2.30.4-r1/work/webkitgtk-2.30.4/Source/bmalloc -DNDEBUG -fdiagnostics-color=always -Wextra -Wall -Wno-expansion-to-defined -Wno-noexcept-type -Wno-psabi -Wno-maybe-uninitialized -Wwrite-strings -Wundef -Wpointer-arith -Wmissing-format-attribute -Wformat-security -Wcast-align -O2 -pipe -march=native -fno-omit-frame-pointer -ggdb2 -frecord-gcc-switches -fno-strict-aliasing -fno-exceptions -fno-rtti -fPIC -std=c++17 -MD -MT Source/bmalloc/CMakeFiles/bmalloc.dir/bmalloc/IsoTLS.cpp.o -MF Source/bmalloc/CMakeFiles/bmalloc.dir/bmalloc/IsoTLS.cpp.o.d -o Source/bmalloc/CMakeFiles/bmalloc.dir/bmalloc/IsoTLS.cpp.o -c /tmp/portage/net-libs/webkit-gtk-2.30.4-r1/work/webkitgtk-2.30.4/Source/bmalloc/bmalloc/IsoTLS.cpp
Indeed it was caused by ccache. Clearing the cache resolved it.
It seems webkit-gtk gets hit by ccache issues way too much in different situations; I wonder how comes
I confirm ccache is related here - error disappeared after disabling ccache in make.conf .
*** Bug 758614 has been marked as a duplicate of this bug. ***
I just hit the same problem, > CCACHE_RECACHE=yes emerge -a1 net-libs/webkit-gtk allowed me to pass.
Created attachment 733951 [details] build.log (amd64/musl, 2.32.3) Encountered the same or a very similar issue on musl, however without ccache. Building with MYCMAKEARGS="-DUSE_LD_GOLD:BOOL=OFF" as in bug #670372 is a succesful workaround. Don't know why the gold linker is used here the first place...
Created attachment 733953 [details] CMakeError.log (amd64/musl, 2.32.3)
Created attachment 733955 [details] CMakeOutput.log (amd64/musl, 2.32.3)
*** Bug 814083 has been marked as a duplicate of this bug. ***
Doesn't help me: CCACHE_RECACHE=yes emerge -a1 net-libs/webkit-gtk same error. Btw I'm not using ccache
(In reply to Oleg Korsak from comment #20) > Doesn't help me: > CCACHE_RECACHE=yes emerge -a1 net-libs/webkit-gtk > > same error. Btw I'm not using ccache If you are not using distcc or ccache, please file a new bug with the full log.
Response by a webkitgtk upstream person to someone hitting "c++: error: unrecognized command-line option ‘-fcolor-diagnostics’" outside Gentoo: "That's a ccache bug, somehow it gets confused and thinks you are using clang instead of gcc or vice-versa. Best uninstall ccache, or alternatively delete both the cache and your build directory whenever you see it"
Are you using ccache-4.6 or newer by any chance? Could be bug #841812 then.