Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 774105 - app-shells/fish-3.2.0: configure fails with Could NOT find Threads (missing: Threads_FOUND)
Summary: app-shells/fish-3.2.0: configure fails with Could NOT find Threads (missing: ...
Status: RESOLVED CANTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Georgy Yakovlev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-03 20:37 UTC by Azat Bahawi
Modified: 2021-03-07 06:45 UTC (History)
3 users (show)

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


Attachments
app-shells/fish-3.2.0 build log (fish-3.2.0:20210303-201557.log,6.72 KB, text/x-log)
2021-03-03 20:39 UTC, Azat Bahawi
Details
emerge --info (emerge-info.txt,17.06 KB, text/plain)
2021-03-03 20:40 UTC, Azat Bahawi
Details
ls -la {,/usr}/lib64/libpthread* (ls-libpthread,327 bytes, text/plain)
2021-03-06 08:30 UTC, Azat Bahawi
Details
qlist glibc | grep pthread (qlist-glibc,192 bytes, text/plain)
2021-03-06 08:31 UTC, Azat Bahawi
Details
/tmp/portage/app-shells/fish-3.2.0/work/fish-3.2.0_build/CMakeFiles/CMakeOutput.log (CMakeOutput.log,85.72 KB, text/plain)
2021-03-06 08:32 UTC, Azat Bahawi
Details
/tmp/portage/app-shells/fish-3.2.0/work/fish-3.2.0_build/CMakeFiles/CMakeError.log (CMakeError.log,7.90 KB, text/plain)
2021-03-06 08:32 UTC, Azat Bahawi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Azat Bahawi 2021-03-03 20:37:49 UTC
Configure phase for app-shells/fish-3.2.0 fails with:

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)
  cmake/ConfigureChecks.cmake:63 (find_package)
  CMakeLists.txt:133 (include)

This also happens for the live ebuild as well.

Reproducible: Always

Steps to Reproduce:
1. `emerge \=app-shells/fish-3.2.0`
Actual Results:  
Emerge failed with a CMake error.

Expected Results:  
Emerge succeeded.
Comment 1 Azat Bahawi 2021-03-03 20:39:59 UTC
Created attachment 689241 [details]
app-shells/fish-3.2.0 build log
Comment 2 Azat Bahawi 2021-03-03 20:40:41 UTC
Created attachment 689244 [details]
emerge --info
Comment 3 Georgy Yakovlev archtester gentoo-dev 2021-03-05 20:38:51 UTC
very standard cmake test fails, it's not some 3-rd party module.

> find_package(Threads REQUIRED)


can't reproduce, pthread.h is part of glibc and very unlikely it's missing, a lot more stuff will break if it does.

I have same cmake version and glibc version.


please attach output of

ls -la {,/usr}/lib64/libpthread*

as well as

qlist glibc | grep pthread


also please attach both:

"/tmp/portage/app-shells/fish-3.2.0/work/fish-3.2.0_build/CMakeFiles/CMakeOutput.log".
"/tmp/portage/app-shells/fish-3.2.0/work/fish-3.2.0_build/CMakeFiles/CMakeError.log".
Comment 4 Azat Bahawi 2021-03-06 08:29:39 UTC
(In reply to Georgy Yakovlev from comment #3)
> can't reproduce, pthread.h is part of glibc and very unlikely it's missing,
> a lot more stuff will break if it does.

I agree. For some reason, though, I can build this outside of portage if I just clone the repo and run `cmake` there manually.
Here's the relevant output if I do that:
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE

The error keep persisting only if I try to emerge this package.

Also, I forgot to mention that I can successfully merge app-shells/fish-3.1.2. Pthread check passes there.
Comment 5 Azat Bahawi 2021-03-06 08:30:47 UTC
Created attachment 689592 [details]
ls -la {,/usr}/lib64/libpthread*
Comment 6 Azat Bahawi 2021-03-06 08:31:05 UTC
Created attachment 689595 [details]
qlist glibc | grep pthread
Comment 7 Azat Bahawi 2021-03-06 08:32:07 UTC
Created attachment 689598 [details]
/tmp/portage/app-shells/fish-3.2.0/work/fish-3.2.0_build/CMakeFiles/CMakeOutput.log
Comment 8 Azat Bahawi 2021-03-06 08:32:27 UTC
Created attachment 689601 [details]
/tmp/portage/app-shells/fish-3.2.0/work/fish-3.2.0_build/CMakeFiles/CMakeError.log
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-03-06 09:30:50 UTC
Determining if the include file pthread.h exists failed with the following output:
Change Dir: /tmp/portage/app-shells/fish-3.2.0/work/fish-3.2.0_build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_2cfa8 && [1/2] Building C object CMakeFiles/cmTC_2cfa8.dir/CheckIncludeFile.c.o
[2/2] Linking C executable cmTC_2cfa8
FAILED: cmTC_2cfa8 
: && /usr/bin/x86_64-pc-linux-gnu-gcc -march=native -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=auto -fuse-linker-plugin -falign-functions=32 -pipe -Wl,-O1 -Wl,--as-needed -fdiagnostics-color=always -Wl,-O1 -Wl,--as-needed -march=native -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=auto -fuse-linker-plugin -falign-functions=32 -pipe -fuse-ld=lld   -rdynamic CMakeFiles/cmTC_2cfa8.dir/CheckIncludeFile.c.o -o cmTC_2cfa8   && :
ld.lld: error: undefined symbol: main
>>> referenced by /usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../lib64/Scrt1.o:(_start)
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

Please try with a minimal set of *FLAGS and then bisect the issue. I suspect it’s LTO released but we will see. Your gcc may be broken too?

(Also, does FEATURES=fakeroot actually work?)
Comment 10 Fabio Coatti 2021-03-06 16:07:18 UTC
I have the same issue. Removing LTO from compilation flags fixes the issue, other "aggressive" flags like O3 and graphite causes no harm.
Comment 11 Georgy Yakovlev archtester gentoo-dev 2021-03-07 06:45:17 UTC
ok, changing resolution.
thanks for testing.