diff mbox series

[1/1] package/htpdate: fix static openssl build

Message ID 20220128174540.2502417-1-fontaine.fabrice@gmail.com
State Superseded
Headers show
Series [1/1] package/htpdate: fix static openssl build | expand

Commit Message

Fabrice Fontaine Jan. 28, 2022, 5:45 p.m. UTC
Fix the following static build failure with openssl raised since bump to
version 1.3.3 in commit 163509a8e0d558e6339c5489f072dfe805e0cc34:

/home/buildroot/autobuild/instance-3/output-1/host/opt/ext-toolchain/bin/../lib/gcc/sh4-buildroot-linux-uclibc/10.3.0/../../../../sh4-buildroot-linux-uclibc/bin/ld: /home/buildroot/autobuild/instance-3/output-1/host/sh4-buildroot-linux-uclibc/sysroot/usr/lib/libssl.a(rec_layer_d1.o): in function `DTLS_RECORD_LAYER_new':
rec_layer_d1.c:(.text+0x124): undefined reference to `CRYPTO_malloc'

Fixes:
 - http://autobuild.buildroot.org/results/75ad8515916dfa056b17c97fdd95c7eb4d83a304

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...-config-to-determine-openssl-LDFLAGS.patch | 43 +++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 package/htpdate/0001-Use-pkg-config-to-determine-openssl-LDFLAGS.patch
diff mbox series

Patch

diff --git a/package/htpdate/0001-Use-pkg-config-to-determine-openssl-LDFLAGS.patch b/package/htpdate/0001-Use-pkg-config-to-determine-openssl-LDFLAGS.patch
new file mode 100644
index 0000000000..c229ca6d89
--- /dev/null
+++ b/package/htpdate/0001-Use-pkg-config-to-determine-openssl-LDFLAGS.patch
@@ -0,0 +1,43 @@ 
+From 81fd178abed833defce18562e8122d5c85822ccb Mon Sep 17 00:00:00 2001
+From: Titouan Christophe <titouan.christophe@railnova.eu>
+Date: Fri, 28 Jan 2022 18:37:24 +0100
+Subject: [PATCH] Use pkg-config to determine openssl LDFLAGS
+
+Depending on its build configuration, openssl might not be compiled with
+dynamic zlib support, and programs that link against openssl need to link
+against zlib as well, as illustrated in this build failure:
+http://autobuild.buildroot.net/results/ae9/ae946ca72238840b3eaa5fe823e8d620618f7462/
+
+Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu>
+[Retrieved (and slightly updated) from:
+https://github.com/angeloc/htpdate/commit/72fcf9f82770e927e058a2eaa327d0eecb1e3c8d]
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Upstream status: https://github.com/twekkel/htpdate/pull/17]
+---
+ Makefile | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 4796efa..46c8681 100644
+--- a/Makefile
++++ b/Makefile
+@@ -4,6 +4,7 @@ mandir = ${prefix}/share/man
+ 
+ CC     ?= gcc
+ CFLAGS += -Wall -std=c11 -pedantic -O2
++PKG_CONFIG ?= pkg-config
+ 
+ INSTALL ?= install -c
+ STRIP   ?= strip -s
+@@ -14,7 +15,7 @@ htpdate: htpdate.c
+ 	$(CC) $(CFLAGS) -o htpdate htpdate.c
+ 
+ https: htpdate.c
+-	$(CC) $(CFLAGS) -DENABLE_HTTPS -o htpdate htpdate.c -lssl
++	$(CC) $(CFLAGS) -DENABLE_HTTPS -o htpdate htpdate.c  $(shell $(PKG_CONFIG) --libs libssl)
+ 
+ install: all
+ 	$(STRIP) htpdate
+-- 
+2.34.1
+