From c0bbdc196ded7b6d28221ca9b96f0cf8b41203ab 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. --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 2d7e0e972..396471062 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