From eb5a671c346f76918c63da5bc1cf9f8aa3454929 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 4 Mar 2020 08:31:47 +0100 Subject: [PATCH] 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. (cherry picked from commit c0bbdc196ded7b6d28221ca9b96f0cf8b41203ab) Signed-off-by: Willy Tarreau --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 569c5e9..f9d9507 100644 --- a/Makefile +++ b/Makefile @@ -517,14 +517,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 -- 1.7.10.4