From: Willy Tarreau Date: Wed, 4 Mar 2020 07:31:47 +0000 (+0100) Subject: BUILD: Makefile: include librt before libpthread X-Git-Tag: v2.2-dev4~85 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c0bbdc196ded7b6d28221ca9b96f0cf8b41203ab;p=thirdparty%2Fhaproxy.git BUILD: Makefile: include librt before libpthread Statically building on for i386/x86_64 on linux+glibc 2.18 fails in rt with undefined references to pthread_attr_init and a few others. Let's just swap the two libs in order to fix this. --- diff --git a/Makefile b/Makefile index 2d7e0e9728..396471062b 100644 --- a/Makefile +++ b/Makefile @@ -508,14 +508,14 @@ ifneq ($(USE_DL),) OPTIONS_LDFLAGS += -ldl endif -ifneq ($(USE_THREAD),) -OPTIONS_LDFLAGS += -lpthread -endif - ifneq ($(USE_RT),) OPTIONS_LDFLAGS += -lrt endif +ifneq ($(USE_THREAD),) +OPTIONS_LDFLAGS += -lpthread +endif + ifneq ($(USE_BACKTRACE),) OPTIONS_LDFLAGS += -Wl,$(if $(EXPORT_SYMBOL),$(EXPORT_SYMBOL),--export-dynamic) endif