Created attachment 53216 [details] move -pthread from LDFLAGS to AM_LDFLAGS (prior autoreconf) Hi. "lto-plugin: make claim_file_handler thread-safe" [1] uses LDFLAGS="-pthread" at configure.ac. Unfortunately, LDFLAGS is not passed from configure to the Makefile recipe that links liblto_plugin.la. Perhaps just move -pthread to AM_LDFLAGS at Makefile.in? AC_CHECK_HEADER does not use LDFLAGS anyway. It is implicitly used by other checks but I wonder if that just makes things more misleading (a missing pthread library, that is). Also, it seems that pretty much every library has a different way of checking and setting -pthread, -lpthread et. al. [1] https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=2669cae081c852bc8bde1647d671aa66930cc556
Thanks for the fix, please send the patch to gcc-patches mailing list.
The master branch has been updated by Martin Liska <marxin@gcc.gnu.org>: https://gcc.gnu.org/g:51debf7f857dddfb4dd2493867d2648041e7d8de commit r13-1377-g51debf7f857dddfb4dd2493867d2648041e7d8de Author: Pekka Seppänen <pexu@gcc.mail.kapsi.fi> Date: Tue Jun 28 17:14:09 2022 +0300 lto: pass -pthread to AM_LDFLAGS [PR 106118] Move -pthread from configure.ac to Makefile.in so that it is passed to AM_LDFLAGS. PR lto/106118 lto-plugin/ChangeLog: * configure.ac: Move -pthread from here... * Makefile.am: ...to here. * configure: Regenerate. * Makefile.in: Likewise.
Should be fixed now.
(In reply to Martin Liška from comment #3) > Should be fixed now. This patch is just wrong. Since windows simply does not provide libpthread.a you have win32, posix, and mcf 3 kinds of threads. Plus a lot of single-thread targets. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106170