BUILD: Makefile: include librt before libpthread
authorWilly Tarreau <w@1wt.eu>
Wed, 4 Mar 2020 07:31:47 +0000 (08:31 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 1 May 2020 15:09:20 +0000 (17:09 +0200)
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 <w@1wt.eu>

Makefile

index 569c5e9..f9d9507 100644 (file)
--- 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