summaryrefslogtreecommitdiff
path: root/lto-plugin/configure.ac
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2022-07-14 09:51:33 +0200
committerMartin Liska <mliska@suse.cz>2022-07-14 13:26:21 +0200
commit29f40a8047fa9b6ccde2174ca126b78a535e1a61 (patch)
tree2cc86628d3374288c99cec8bf729f7cedce24998 /lto-plugin/configure.ac
parentb0f02eeb906b6351099ac97066ef74b6167d9ecb (diff)
lto-plugin: use -pthread only for detected targets
Use -pthread only if we are going to use pthread functionality. PR bootstrap/106156 lto-plugin/ChangeLog: * Makefile.am: Use ac_lto_plugin_extra_ldflags for AM_LDFLAGS. * configure.ac: Use AC_SUBST(ac_lto_plugin_extra_ldflags). * Makefile.in: Regenerate. * configure: Regenerate.
Diffstat (limited to 'lto-plugin/configure.ac')
-rw-r--r--lto-plugin/configure.ac5
1 files changed, 5 insertions, 0 deletions
diff --git a/lto-plugin/configure.ac b/lto-plugin/configure.ac
index 18eb4f60b0a..e69a7bd9ec0 100644
--- a/lto-plugin/configure.ac
+++ b/lto-plugin/configure.ac
@@ -89,6 +89,7 @@ AM_CONDITIONAL(LTO_PLUGIN_USE_SYMVER_SUN, [test "x$lto_plugin_use_symver" = xsun
# Check for thread headers.
use_locking=no
+ac_lto_plugin_extra_ldflags=
case $target in
riscv*)
@@ -102,8 +103,12 @@ esac
if test x$use_locking = xyes; then
AC_CHECK_HEADER(pthread.h,
[AC_DEFINE(HAVE_PTHREAD_LOCKING, 1, [Define if the system provides pthread locking mechanism.])])
+
+ ac_lto_plugin_extra_ldflags="-pthread"
fi
+AC_SUBST(ac_lto_plugin_extra_ldflags)
+
AM_PROG_LIBTOOL
ACX_LT_HOST_FLAGS
AC_SUBST(target_noncanonical)