Skip to content

Commit 48a9968

Browse files
committed
Merge #19558: build: split pthread flags out of ldflags and dont use when building libconsensus
fc9278d build: AX_PTHREAD serial 27 (fanquake) 15c27c4 build: split PTHREAD_* flags out of AM_LDFLAGS (fanquake) 68e3e22 scripted-diff: add FUZZ_SUITE_LDFLAGS_COMMON (fanquake) afecde8 build: add PTHREAD_LIBS to LDFLAGS configure output (fanquake) Pull request description: TLDR: Split pthread flags out of ldflags, and stop using them when building libconsensus. Building libconsensus on Linux using Clang currently warns. i.e: ```bash ./autogen.sh ./configure --disable-tests --disable-bench --with-utils=no --with-daemon=no --with-gui=no --disable-wallet --with-libs=yes CC=clang CXX=clang++ make V=1 -j6 ... -Wl,-z -Wl,relro -Wl,-z -Wl,now -pthread -Wl,-soname -Wl,libbitcoinconsensus.so.0 -o .libs/libbitcoinconsensus.so.0.0.0 clang: warning: argument unused during compilation: '-pthread' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-pthread' [-Wunused-command-line-argument] ``` Besides wanting to quiet the warnings, after digging into this it seemed we could clean up how we are passing around the pthread flags. I also learnt a bit more about how libtools builds shared libraries, and that passing `-pthread` on the link line wouldn't be enough to link against pthreads anyways, due to libtools usage of -nostdlib (see [related discussion where we build DLLs](https://github.com/bitcoin/bitcoin/blob/476436b2dec254bb988f8c7a6cbec1d7bb7cecfd/configure.ac#L603)). This can be demonstrated with a patch to libconsensus: ```patch diff --git a/src/script/bitcoinconsensus.cpp b/src/script/bitcoinconsensus.cpp index 15e2040..10bf3582f 100644 --- a/src/script/bitcoinconsensus.cpp +++ b/src/script/bitcoinconsensus.cpp @@ -10,6 +10,8 @@ #include <script/interpreter.h> #include <version.h> +#include <pthread.h> + namespace { /** A class that deserializes a single CTransaction one time. */ @@ -127,3 +129,10 @@ unsigned int bitcoinconsensus_version() // Just use the API version for now return BITCOINCONSENSUS_API_VER; } + +void *func_pthread(void *x) { return x; } + +void f() { + pthread_t t; + pthread_create(&t,0,func_pthread,0); +} ``` After building, you'll find you have a `libbitcoinconsensus.so` using pthread symbols, but which isn't linked against libpthread: ```bash ldd -r src/.libs/libbitcoinconsensus.so linux-vdso.so.1 (0x00007ffe49378000) libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f553cee7000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f553cda2000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f553cd88000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f553cbc5000) /lib64/ld-linux-x86-64.so.2 (0x00007f553d15d000) undefined symbol: pthread_create (src/.libs/libbitcoinconsensus.so) ``` This libtool behaviour has been known about for some time, i.e this [thread from 2005](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460), describes the same issue. The suggestion from libtool maintainers at the time is to add `-lpthread` to LDFLAGS. Also worth noting is that some of the users in those threads were also using the `AX_PTHREADS` macro, same as us, to determine how to compile with/link against pthreads. This macro has [recently been updated](https://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=commitdiff;h=2fb904589643eb6ca6122f834891b58d1d51b347), with reference to this issue. You can compare the output from the version we currently use, to the new version: ```bash # our ax_pthread macro: PTHREAD_CFLAGS = -pthread PTHREAD_LIBS = PTHREAD_CC = gcc / clang # the new ax_pthread macro PTHREAD_CFLAGS = -pthread PTHREAD_LIBS = -lpthread PTHREAD_CC = gcc / clang ``` Note that as part of this PR I've also added `PTHREAD_LIBS` to the split out flags. Although we weren't using it anywhere previously (and wouldn't have seemed to matter for the most part, given it was likely empty for most builders), the macro assumes it's use. i.e: > NOTE: You are assumed to not only compile your program with these flags, > but also to link with them as well. For example, you might link with > $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS ACKs for top commit: laanwj: Code review ACK fc9278d hebasto: re-ACK fc9278d, only rebased and renamed s/`AM_PTHREAD_FLAGS`/`PTHREAD_FLAGS`/ since my [previous](bitcoin/bitcoin#19558 (review)) review.. kallewoof: ACK fc9278d Tree-SHA512: 7c0a5b0f0de4f54b1d7dce0e69020b341c37a383bb7c715867cc96c648774a557b1ddb42eb1b676f7bb2b822b69795bec14dc6272362d80662a21f10cb80331c
2 parents a336518 + fc9278d commit 48a9968

File tree

7 files changed

+288
-263
lines changed

7 files changed

+288
-263
lines changed

build-aux/m4/ax_pthread.m4

Lines changed: 125 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ===========================================================================
2-
# http://www.gnu.org/software/autoconf-archive/ax_pthread.html
2+
# https://www.gnu.org/software/autoconf-archive/ax_pthread.html
33
# ===========================================================================
44
#
55
# SYNOPSIS
@@ -55,6 +55,7 @@
5555
#
5656
# Copyright (c) 2008 Steven G. Johnson <[email protected]>
5757
# Copyright (c) 2011 Daniel Richard G. <[email protected]>
58+
# Copyright (c) 2019 Marc Stevens <[email protected]>
5859
#
5960
# This program is free software: you can redistribute it and/or modify it
6061
# under the terms of the GNU General Public License as published by the
@@ -67,7 +68,7 @@
6768
# Public License for more details.
6869
#
6970
# You should have received a copy of the GNU General Public License along
70-
# with this program. If not, see <http://www.gnu.org/licenses/>.
71+
# with this program. If not, see <https://www.gnu.org/licenses/>.
7172
#
7273
# As a special exception, the respective Autoconf Macro's copyright owner
7374
# gives unlimited permission to copy, distribute and modify the configure
@@ -82,7 +83,7 @@
8283
# modified version of the Autoconf Macro, you may extend this special
8384
# exception to the GPL to apply to your modified version as well.
8485

85-
#serial 23
86+
#serial 27
8687

8788
AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
8889
AC_DEFUN([AX_PTHREAD], [
@@ -123,10 +124,12 @@ fi
123124
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
124125
# libraries is broken (non-POSIX).
125126
126-
# Create a list of thread flags to try. Items starting with a "-" are
127-
# C compiler flags, and other items are library names, except for "none"
128-
# which indicates that we try without any flags at all, and "pthread-config"
129-
# which is a program returning the flags for the Pth emulation library.
127+
# Create a list of thread flags to try. Items with a "," contain both
128+
# C compiler flags (before ",") and linker flags (after ","). Other items
129+
# starting with a "-" are C compiler flags, and remaining items are
130+
# library names, except for "none" which indicates that we try without
131+
# any flags at all, and "pthread-config" which is a program returning
132+
# the flags for the Pth emulation library.
130133
131134
ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
132135
@@ -194,14 +197,47 @@ case $host_os in
194197
# that too in a future libc.) So we'll check first for the
195198
# standard Solaris way of linking pthreads (-mt -lpthread).
196199
197-
ax_pthread_flags="-mt,pthread pthread $ax_pthread_flags"
200+
ax_pthread_flags="-mt,-lpthread pthread $ax_pthread_flags"
198201
;;
199202
esac
200203
204+
# Are we compiling with Clang?
205+
206+
AC_CACHE_CHECK([whether $CC is Clang],
207+
[ax_cv_PTHREAD_CLANG],
208+
[ax_cv_PTHREAD_CLANG=no
209+
# Note that Autoconf sets GCC=yes for Clang as well as GCC
210+
if test "x$GCC" = "xyes"; then
211+
AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG],
212+
[/* Note: Clang 2.7 lacks __clang_[a-z]+__ */
213+
# if defined(__clang__) && defined(__llvm__)
214+
AX_PTHREAD_CC_IS_CLANG
215+
# endif
216+
],
217+
[ax_cv_PTHREAD_CLANG=yes])
218+
fi
219+
])
220+
ax_pthread_clang="$ax_cv_PTHREAD_CLANG"
221+
222+
201223
# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC)
202224
225+
# Note that for GCC and Clang -pthread generally implies -lpthread,
226+
# except when -nostdlib is passed.
227+
# This is problematic using libtool to build C++ shared libraries with pthread:
228+
# [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460
229+
# [2] https://bugzilla.redhat.com/show_bug.cgi?id=661333
230+
# [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468555
231+
# To solve this, first try -pthread together with -lpthread for GCC
232+
203233
AS_IF([test "x$GCC" = "xyes"],
204-
[ax_pthread_flags="-pthread -pthreads $ax_pthread_flags"])
234+
[ax_pthread_flags="-pthread,-lpthread -pthread -pthreads $ax_pthread_flags"])
235+
236+
# Clang takes -pthread (never supported any other flag), but we'll try with -lpthread first
237+
238+
AS_IF([test "x$ax_pthread_clang" = "xyes"],
239+
[ax_pthread_flags="-pthread,-lpthread -pthread"])
240+
205241
206242
# The presence of a feature test macro requesting re-entrant function
207243
# definitions is, on some systems, a strong hint that pthreads support is
@@ -224,25 +260,86 @@ AS_IF([test "x$ax_pthread_check_macro" = "x--"],
224260
[ax_pthread_check_cond=0],
225261
[ax_pthread_check_cond="!defined($ax_pthread_check_macro)"])
226262
227-
# Are we compiling with Clang?
228263
229-
AC_CACHE_CHECK([whether $CC is Clang],
230-
[ax_cv_PTHREAD_CLANG],
231-
[ax_cv_PTHREAD_CLANG=no
232-
# Note that Autoconf sets GCC=yes for Clang as well as GCC
233-
if test "x$GCC" = "xyes"; then
234-
AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG],
235-
[/* Note: Clang 2.7 lacks __clang_[a-z]+__ */
236-
# if defined(__clang__) && defined(__llvm__)
237-
AX_PTHREAD_CC_IS_CLANG
238-
# endif
239-
],
240-
[ax_cv_PTHREAD_CLANG=yes])
241-
fi
242-
])
243-
ax_pthread_clang="$ax_cv_PTHREAD_CLANG"
264+
if test "x$ax_pthread_ok" = "xno"; then
265+
for ax_pthread_try_flag in $ax_pthread_flags; do
266+
267+
case $ax_pthread_try_flag in
268+
none)
269+
AC_MSG_CHECKING([whether pthreads work without any flags])
270+
;;
271+
272+
*,*)
273+
PTHREAD_CFLAGS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\1/"`
274+
PTHREAD_LIBS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\2/"`
275+
AC_MSG_CHECKING([whether pthreads work with "$PTHREAD_CFLAGS" and "$PTHREAD_LIBS"])
276+
;;
277+
278+
-*)
279+
AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag])
280+
PTHREAD_CFLAGS="$ax_pthread_try_flag"
281+
;;
282+
283+
pthread-config)
284+
AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no])
285+
AS_IF([test "x$ax_pthread_config" = "xno"], [continue])
286+
PTHREAD_CFLAGS="`pthread-config --cflags`"
287+
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
288+
;;
289+
290+
*)
291+
AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag])
292+
PTHREAD_LIBS="-l$ax_pthread_try_flag"
293+
;;
294+
esac
295+
296+
ax_pthread_save_CFLAGS="$CFLAGS"
297+
ax_pthread_save_LIBS="$LIBS"
298+
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
299+
LIBS="$PTHREAD_LIBS $LIBS"
300+
301+
# Check for various functions. We must include pthread.h,
302+
# since some functions may be macros. (On the Sequent, we
303+
# need a special flag -Kthread to make this header compile.)
304+
# We check for pthread_join because it is in -lpthread on IRIX
305+
# while pthread_create is in libc. We check for pthread_attr_init
306+
# due to DEC craziness with -lpthreads. We check for
307+
# pthread_cleanup_push because it is one of the few pthread
308+
# functions on Solaris that doesn't have a non-functional libc stub.
309+
# We try pthread_create on general principles.
310+
311+
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>
312+
# if $ax_pthread_check_cond
313+
# error "$ax_pthread_check_macro must be defined"
314+
# endif
315+
static void *some_global = NULL;
316+
static void routine(void *a)
317+
{
318+
/* To avoid any unused-parameter or
319+
unused-but-set-parameter warning. */
320+
some_global = a;
321+
}
322+
static void *start_routine(void *a) { return a; }],
323+
[pthread_t th; pthread_attr_t attr;
324+
pthread_create(&th, 0, start_routine, 0);
325+
pthread_join(th, 0);
326+
pthread_attr_init(&attr);
327+
pthread_cleanup_push(routine, 0);
328+
pthread_cleanup_pop(0) /* ; */])],
329+
[ax_pthread_ok=yes],
330+
[])
331+
332+
CFLAGS="$ax_pthread_save_CFLAGS"
333+
LIBS="$ax_pthread_save_LIBS"
334+
335+
AC_MSG_RESULT([$ax_pthread_ok])
336+
AS_IF([test "x$ax_pthread_ok" = "xyes"], [break])
337+
338+
PTHREAD_LIBS=""
339+
PTHREAD_CFLAGS=""
340+
done
341+
fi
244342
245-
ax_pthread_clang_warning=no
246343
247344
# Clang needs special handling, because older versions handle the -pthread
248345
# option in a rather... idiosyncratic way
@@ -261,11 +358,6 @@ if test "x$ax_pthread_clang" = "xyes"; then
261358
# -pthread does define _REENTRANT, and while the Darwin headers
262359
# ignore this macro, third-party headers might not.)
263360
264-
PTHREAD_CFLAGS="-pthread"
265-
PTHREAD_LIBS=
266-
267-
ax_pthread_ok=yes
268-
269361
# However, older versions of Clang make a point of warning the user
270362
# that, in an invocation where only linking and no compilation is
271363
# taking place, the -pthread option has no effect ("argument unused
@@ -320,78 +412,7 @@ if test "x$ax_pthread_clang" = "xyes"; then
320412
321413
fi # $ax_pthread_clang = yes
322414
323-
if test "x$ax_pthread_ok" = "xno"; then
324-
for ax_pthread_try_flag in $ax_pthread_flags; do
325-
326-
case $ax_pthread_try_flag in
327-
none)
328-
AC_MSG_CHECKING([whether pthreads work without any flags])
329-
;;
330-
331-
-mt,pthread)
332-
AC_MSG_CHECKING([whether pthreads work with -mt -lpthread])
333-
PTHREAD_CFLAGS="-mt"
334-
PTHREAD_LIBS="-lpthread"
335-
;;
336-
337-
-*)
338-
AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag])
339-
PTHREAD_CFLAGS="$ax_pthread_try_flag"
340-
;;
341-
342-
pthread-config)
343-
AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no])
344-
AS_IF([test "x$ax_pthread_config" = "xno"], [continue])
345-
PTHREAD_CFLAGS="`pthread-config --cflags`"
346-
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
347-
;;
348415
349-
*)
350-
AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag])
351-
PTHREAD_LIBS="-l$ax_pthread_try_flag"
352-
;;
353-
esac
354-
355-
ax_pthread_save_CFLAGS="$CFLAGS"
356-
ax_pthread_save_LIBS="$LIBS"
357-
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
358-
LIBS="$PTHREAD_LIBS $LIBS"
359-
360-
# Check for various functions. We must include pthread.h,
361-
# since some functions may be macros. (On the Sequent, we
362-
# need a special flag -Kthread to make this header compile.)
363-
# We check for pthread_join because it is in -lpthread on IRIX
364-
# while pthread_create is in libc. We check for pthread_attr_init
365-
# due to DEC craziness with -lpthreads. We check for
366-
# pthread_cleanup_push because it is one of the few pthread
367-
# functions on Solaris that doesn't have a non-functional libc stub.
368-
# We try pthread_create on general principles.
369-
370-
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>
371-
# if $ax_pthread_check_cond
372-
# error "$ax_pthread_check_macro must be defined"
373-
# endif
374-
static void routine(void *a) { a = 0; }
375-
static void *start_routine(void *a) { return a; }],
376-
[pthread_t th; pthread_attr_t attr;
377-
pthread_create(&th, 0, start_routine, 0);
378-
pthread_join(th, 0);
379-
pthread_attr_init(&attr);
380-
pthread_cleanup_push(routine, 0);
381-
pthread_cleanup_pop(0) /* ; */])],
382-
[ax_pthread_ok=yes],
383-
[])
384-
385-
CFLAGS="$ax_pthread_save_CFLAGS"
386-
LIBS="$ax_pthread_save_LIBS"
387-
388-
AC_MSG_RESULT([$ax_pthread_ok])
389-
AS_IF([test "x$ax_pthread_ok" = "xyes"], [break])
390-
391-
PTHREAD_LIBS=""
392-
PTHREAD_CFLAGS=""
393-
done
394-
fi
395416
396417
# Various other checks:
397418
if test "x$ax_pthread_ok" = "xyes"; then
@@ -438,7 +459,8 @@ if test "x$ax_pthread_ok" = "xyes"; then
438459
AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
439460
[ax_cv_PTHREAD_PRIO_INHERIT],
440461
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],
441-
[[int i = PTHREAD_PRIO_INHERIT;]])],
462+
[[int i = PTHREAD_PRIO_INHERIT;
463+
return i;]])],
442464
[ax_cv_PTHREAD_PRIO_INHERIT=yes],
443465
[ax_cv_PTHREAD_PRIO_INHERIT=no])
444466
])

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1684,10 +1684,10 @@ echo " target os = $TARGET_OS"
16841684
echo " build os = $build_os"
16851685
echo
16861686
echo " CC = $CC"
1687-
echo " CFLAGS = $CFLAGS"
1687+
echo " CFLAGS = $PTHREAD_CFLAGS $CFLAGS"
16881688
echo " CPPFLAGS = $DEBUG_CPPFLAGS $HARDENED_CPPFLAGS $CPPFLAGS"
16891689
echo " CXX = $CXX"
16901690
echo " CXXFLAGS = $DEBUG_CXXFLAGS $HARDENED_CXXFLAGS $WARN_CXXFLAGS $NOWARN_CXXFLAGS $ERROR_CXXFLAGS $GPROF_CXXFLAGS $CXXFLAGS"
1691-
echo " LDFLAGS = $PTHREAD_CFLAGS $HARDENED_LDFLAGS $GPROF_LDFLAGS $LDFLAGS"
1691+
echo " LDFLAGS = $PTHREAD_LIBS $HARDENED_LDFLAGS $GPROF_LDFLAGS $LDFLAGS"
16921692
echo " ARFLAGS = $ARFLAGS"
16931693
echo

src/Makefile.am

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44

55
DIST_SUBDIRS = secp256k1 univalue
66

7-
AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS) $(HARDENED_LDFLAGS) $(GPROF_LDFLAGS) $(SANITIZER_LDFLAGS)
7+
AM_LDFLAGS = $(LIBTOOL_LDFLAGS) $(HARDENED_LDFLAGS) $(GPROF_LDFLAGS) $(SANITIZER_LDFLAGS)
88
AM_CXXFLAGS = $(DEBUG_CXXFLAGS) $(HARDENED_CXXFLAGS) $(WARN_CXXFLAGS) $(NOWARN_CXXFLAGS) $(ERROR_CXXFLAGS) $(GPROF_CXXFLAGS) $(SANITIZER_CXXFLAGS)
99
AM_CPPFLAGS = $(DEBUG_CPPFLAGS) $(HARDENED_CPPFLAGS)
1010
AM_LIBTOOLFLAGS = --preserve-dup-deps
11+
PTHREAD_FLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
1112
EXTRA_LIBRARIES =
1213

1314
if EMBEDDED_UNIVALUE
@@ -566,7 +567,7 @@ nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h
566567
bitcoin_daemon_sources = bitcoind.cpp
567568
bitcoin_bin_cppflags = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
568569
bitcoin_bin_cxxflags = $(AM_CXXFLAGS) $(PIE_FLAGS)
569-
bitcoin_bin_ldflags = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
570+
bitcoin_bin_ldflags = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS)
570571

571572
if TARGET_WINDOWS
572573
bitcoin_daemon_sources += bitcoind-res.rc
@@ -603,7 +604,7 @@ bitcoin_node_LDADD = $(LIBBITCOIN_SERVER) $(bitcoin_bin_ldadd)
603604
bitcoin_cli_SOURCES = bitcoin-cli.cpp
604605
bitcoin_cli_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(EVENT_CFLAGS)
605606
bitcoin_cli_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
606-
bitcoin_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
607+
bitcoin_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS)
607608

608609
if TARGET_WINDOWS
609610
bitcoin_cli_SOURCES += bitcoin-cli-res.rc
@@ -622,7 +623,7 @@ bitcoin_cli_LDADD += $(BOOST_LIBS) $(EVENT_LIBS)
622623
bitcoin_tx_SOURCES = bitcoin-tx.cpp
623624
bitcoin_tx_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
624625
bitcoin_tx_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
625-
bitcoin_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
626+
bitcoin_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS)
626627

627628
if TARGET_WINDOWS
628629
bitcoin_tx_SOURCES += bitcoin-tx-res.rc

src/Makefile.bench.include

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ bench_bench_bitcoin_SOURCES += bench/wallet_balance.cpp
7575
endif
7676

7777
bench_bench_bitcoin_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) $(MINIUPNPC_LIBS)
78-
bench_bench_bitcoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
78+
bench_bench_bitcoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS)
7979

8080
CLEAN_BITCOIN_BENCH = bench/*.gcda bench/*.gcno $(GENERATED_BENCH_FILES)
8181

src/Makefile.qt.include

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ endif
322322
bitcoin_qt_ldadd += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) $(LIBLEVELDB_SSE42) $(LIBMEMENV) \
323323
$(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(BDB_LIBS) $(MINIUPNPC_LIBS) $(LIBSECP256K1) \
324324
$(EVENT_PTHREADS_LIBS) $(EVENT_LIBS)
325-
bitcoin_qt_ldflags = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
325+
bitcoin_qt_ldflags = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS)
326326
bitcoin_qt_libtoolflags = $(AM_LIBTOOLFLAGS) --tag CXX
327327

328328
qt_bitcoin_qt_CPPFLAGS = $(bitcoin_qt_cppflags)

src/Makefile.qttest.include

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBIT
5757
$(LIBLEVELDB_SSE42) $(LIBMEMENV) $(BOOST_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) $(QT_LIBS) \
5858
$(QR_LIBS) $(BDB_LIBS) $(MINIUPNPC_LIBS) $(LIBSECP256K1) \
5959
$(EVENT_PTHREADS_LIBS) $(EVENT_LIBS)
60-
qt_test_test_bitcoin_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
60+
qt_test_test_bitcoin_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS)
6161
qt_test_test_bitcoin_qt_CXXFLAGS = $(AM_CXXFLAGS) $(QT_PIE_FLAGS)
6262

6363
CLEAN_BITCOIN_QT_TEST = $(TEST_QT_MOC_CPP) qt/test/*.gcda qt/test/*.gcno

0 commit comments

Comments
 (0)