Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 761559 - net-libs/webkit-gtk-2.30.4-r1: Could NOT find Threads (missing: Threads_FOUND) (error: unrecognized command-line option ‘-fcolor-diagnostics’) (ccache related)
Summary: net-libs/webkit-gtk-2.30.4-r1: Could NOT find Threads (missing: Threads_FOUND...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
: 758614 814083 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-12-25 08:52 UTC by Michał Górny
Modified: 2022-06-18 15:22 UTC (History)
8 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge-info.txt (emerge-info.txt,10.19 KB, text/plain)
2020-12-25 08:56 UTC, Michał Górny
Details
/var/log/portage/net-libs:webkit-gtk-2.30.4-r1:20201225-084555.log (net-libs:webkit-gtk-2.30.4-r1:20201225-084555.log,14.23 KB, text/plain)
2020-12-25 08:56 UTC, Michał Górny
Details
CMakeError.log (CMakeError.log,38.89 KB, text/plain)
2020-12-25 08:57 UTC, Michał Górny
Details
CMakeOutput.log (CMakeOutput.log,58.47 KB, text/plain)
2020-12-25 09:19 UTC, Michał Górny
Details
build.log (amd64/musl, 2.32.3) (webkit-gtk-2.32.3:20210818-175232.log,13.80 KB, text/plain)
2021-08-18 18:45 UTC, ernsteiswuerfel
Details
CMakeError.log (amd64/musl, 2.32.3) (CMakeError.log,41.59 KB, text/plain)
2021-08-18 18:46 UTC, ernsteiswuerfel
Details
CMakeOutput.log (amd64/musl, 2.32.3) (CMakeOutput.log,72.16 KB, text/plain)
2021-08-18 18:47 UTC, ernsteiswuerfel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-12-25 08:52:25 UTC
-- 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.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-12-25 08:56:05 UTC
Created attachment 679419 [details]
emerge-info.txt
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-12-25 08:56:37 UTC
Created attachment 679422 [details]
/var/log/portage/net-libs:webkit-gtk-2.30.4-r1:20201225-084555.log
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-12-25 08:57:16 UTC
Created attachment 679425 [details]
CMakeError.log
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-12-25 09:19:56 UTC
Created attachment 679437 [details]
CMakeOutput.log
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-12-25 09:22:37 UTC
It seems to consider -fcolor-diagnostics to be working but I have no clue why.  The logs aren't exactly designed to be useful.
Comment 6 Ionen Wolkens gentoo-dev 2020-12-25 09:40:27 UTC
I suspect this ccache-related again, see bug #758614
Comment 7 Mart Raudsepp gentoo-dev 2020-12-25 11:48:10 UTC
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; }
Comment 8 Mart Raudsepp gentoo-dev 2020-12-25 11:49:27 UTC
Note that none of this changed between 2.30.3 and 2.30.4 in WebKit cmake files
Comment 9 Mart Raudsepp gentoo-dev 2020-12-25 11:50:32 UTC
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.
Comment 10 Mart Raudsepp gentoo-dev 2020-12-25 11:56:02 UTC
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
Comment 11 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-12-25 12:43:39 UTC
Indeed it was caused by ccache.  Clearing the cache resolved it.
Comment 12 Mart Raudsepp gentoo-dev 2020-12-25 13:08:48 UTC
It seems webkit-gtk gets hit by ccache issues way too much in different situations; I wonder how comes
Comment 13 Alexandr Paliy 2020-12-25 22:35:43 UTC
I confirm ccache is related here - error disappeared after disabling ccache in make.conf .
Comment 14 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-03-02 09:51:13 UTC
*** Bug 758614 has been marked as a duplicate of this bug. ***
Comment 15 Thomas Deutschmann (RETIRED) gentoo-dev 2021-03-15 03:18:53 UTC
I just hit the same problem, 

> CCACHE_RECACHE=yes emerge -a1 net-libs/webkit-gtk
allowed me to pass.
Comment 16 ernsteiswuerfel archtester 2021-08-18 18:45:47 UTC
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...
Comment 17 ernsteiswuerfel archtester 2021-08-18 18:46:44 UTC
Created attachment 733953 [details]
CMakeError.log (amd64/musl, 2.32.3)
Comment 18 ernsteiswuerfel archtester 2021-08-18 18:47:22 UTC
Created attachment 733955 [details]
CMakeOutput.log (amd64/musl, 2.32.3)
Comment 19 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-09-20 17:51:03 UTC
*** Bug 814083 has been marked as a duplicate of this bug. ***
Comment 20 Oleg Korsak 2021-10-13 09:06:59 UTC
Doesn't help me:
CCACHE_RECACHE=yes emerge -a1 net-libs/webkit-gtk

same error. Btw I'm not using ccache
Comment 21 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-10-13 10:24:26 UTC
(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.
Comment 22 Mart Raudsepp gentoo-dev 2022-06-18 14:55:16 UTC
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"
Comment 23 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2022-06-18 15:22:28 UTC
Are you using ccache-4.6 or newer by any chance?  Could be bug #841812 then.