xref: /OK3568_Linux_fs/buildroot/package/sslh/0001-Makefile-fix-static-linking-with-pcre.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1From 0d9e004d324cc030c173de04c40db51a0f22bb5c Mon Sep 17 00:00:00 2001
2From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
3Date: Thu, 15 Oct 2020 07:58:05 +0200
4Subject: [PATCH] Makefile: fix static linking with pcre
5
6Static build with pcre is broken since version 1.19b and
7https://github.com/yrutschle/sslh/commit/cb90cc97ae64a445242e517847c6e44b7003eda4
8because -lpcre has been replaced by -lpcreposix which will result in
9the following static build failure:
10
11/srv/storage/autobuild/run/instance-1/output-1/host/bin/mipsel-linux-gcc -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os   -static -static -o echosrv echosrv.o probe.o common.o tls.o  -lpcreposix -lconfig -lcap
12/srv/storage/autobuild/run/instance-1/output-1/host/opt/ext-toolchain/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/8.3.0/../../../../mipsel-buildroot-linux-uclibc/bin/ld: /srv/storage/autobuild/run/instance-1/output-1/host/mipsel-buildroot-linux-uclibc/sysroot/usr/lib/libpcreposix.a(libpcreposix_la-pcreposix.o): in function `regfree':
13pcreposix.c:(.text+0x120): undefined reference to `pcre_free'
14
15So append -lpcre after -lpcreposix
16
17Fixes:
18 - http://autobuild.buildroot.org/results/a601824fc0c205a6a940e0f9f079ce2c39840605
19
20Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
21[Upstream status: https://github.com/yrutschle/sslh/pull/280]
22---
23 Makefile | 2 +-
24 1 file changed, 1 insertion(+), 1 deletion(-)
25
26diff --git a/Makefile b/Makefile
27index 986cf1c..ecadc22 100644
28--- a/Makefile
29+++ b/Makefile
30@@ -43,7 +43,7 @@ endif
31
32 ifneq ($(strip $(USELIBPCRE)),)
33 	CPPFLAGS+=-DLIBPCRE
34-	LIBS:=$(LIBS) -lpcreposix
35+	LIBS:=$(LIBS) -lpcreposix -lpcre
36 endif
37
38 ifneq ($(strip $(USELIBCONFIG)),)
39--
402.28.0
41
42