aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2018-02-17 15:38:26 +0100
committerHauke Mehrtens <hauke@hauke-m.de>2018-03-17 23:22:40 +0100
commit5d3fbd59962981676a61d2c667870d5fbb67535f (patch)
tree451f7d6b61d1e793218e5c3d011a04b0b6633131
parent8cc22fad6afb54d1020ddb2ca24ae7ed6ab5b602 (diff)
downloadupstream-5d3fbd59962981676a61d2c667870d5fbb67535f.tar.gz
upstream-5d3fbd59962981676a61d2c667870d5fbb67535f.tar.bz2
upstream-5d3fbd59962981676a61d2c667870d5fbb67535f.zip
uboot-mxs: fix compile problems related to OpenSSL
Use the UBOOT_MAKE_FLAGS defined in include/u-boot.mk and do not overwrite them to compile the host tools against the shipped LibreSSL. In addition add a patch to fix a compile problem when compiling the tools against LibreSSL caused by differences in the API between OpenSSL 1.1 and LibreSSL. This should fix the compile problems seen in build bot from time to time by not depending on the host libssl-dev package any more but using the LibreSSL version from OpenWrt. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--package/boot/uboot-mxs/Makefile2
-rw-r--r--package/boot/uboot-mxs/patches/002-tools-mxsimage-Support-building-with-LibreSSL.patch35
2 files changed, 36 insertions, 1 deletions
diff --git a/package/boot/uboot-mxs/Makefile b/package/boot/uboot-mxs/Makefile
index 6fde52ef56..cd752bb81a 100644
--- a/package/boot/uboot-mxs/Makefile
+++ b/package/boot/uboot-mxs/Makefile
@@ -35,7 +35,7 @@ UBOOT_TARGETS := \
mx23_olinuxino \
duckbill
-UBOOT_MAKE_FLAGS = $(UBOOT_IMAGE)
+UBOOT_MAKE_FLAGS += $(UBOOT_IMAGE)
define Build/InstallDev
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
diff --git a/package/boot/uboot-mxs/patches/002-tools-mxsimage-Support-building-with-LibreSSL.patch b/package/boot/uboot-mxs/patches/002-tools-mxsimage-Support-building-with-LibreSSL.patch
new file mode 100644
index 0000000000..c99c538635
--- /dev/null
+++ b/package/boot/uboot-mxs/patches/002-tools-mxsimage-Support-building-with-LibreSSL.patch
@@ -0,0 +1,35 @@
+From 74e3ace3495b73f6e592e92eca18175cccdb5a24 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke@hauke-m.de>
+Date: Sat, 17 Feb 2018 15:34:19 +0100
+Subject: [PATCH v2] tools/mxsimage: Support building with LibreSSL
+
+The mxsimage utility fails to compile against LibreSSL because LibreSSL
+says it is OpenSSL 2.0, but it does not support the complete OpenSSL 1.1
+interface.
+
+LibreSSL defines OPENSSL_VERSION_NUMBER with 0x20000000L and therefor
+claims to have an API compatible with OpenSSL 2.0, but it does not
+implement OPENSSL_zalloc() and some other functions in its most recent
+version. OpenSSL implements this function since version 1.1.0.
+
+This commit will activate the compatibility code meant for
+OpenSSL < 1.1.0 also for all versions of LibreSSL, if some version of
+LibreSSL will support these functions in the future the version check
+should be adapted.
+
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+---
+ tools/mxsimage.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/tools/mxsimage.c
++++ b/tools/mxsimage.c
+@@ -26,7 +26,7 @@
+ * OpenSSL 1.1.0 and newer compatibility functions:
+ * https://wiki.openssl.org/index.php/1.1_API_Changes
+ */
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ static void *OPENSSL_zalloc(size_t num)
+ {
+ void *ret = OPENSSL_malloc(num);