]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUILD: Makefile: use -pthread not -lpthread when threads are enabled
authorWilly Tarreau <w@1wt.eu>
Wed, 31 May 2023 10:03:33 +0000 (12:03 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 31 May 2023 10:06:41 +0000 (12:06 +0200)
commit7663301ea7ab020d968ec7038413520a9ff560c2
tree4039b32c7568dc032e6cf5b96efa5cd6a6e7bb4c
parent76a98b49053e3e3a177f04b21699807fabf403cb
BUILD: Makefile: use -pthread not -lpthread when threads are enabled

-pthread is normally the right way to enable threads, it involves -lpthread
at the end of the arguments, and also enables -D_REENTRANT=1. We normally
don't care about the subtle difference, but building with a static openssl
library that has threads enabled breaks because -lpthread is placed before
the SSL_LDFLAGS and openssl doesn't find pthread_atfork().

Let's change the flag to -pthread once for all, that's something we've
considered over the last decade without having a good reason to do it
since it didn't bring any value. Now at least it fixes a build issues,
this is a good reason. This doesn't need to be backported since it is
one of the consequences of the new more flexible build options in 2.8.
Makefile