From 453569c1c25acfef47298ce0ace7ad5d217b0f38 Mon Sep 17 00:00:00 2001 From: Jackie Huang Date: Sun, 22 Mar 2020 21:39:54 +0800 Subject: [PATCH] erlang: fix to build with openssl10 erlang R18B03 is not compatibel with openssl 1.1.x, previously the ssl reladted features were disabled, but it's required by rabbitmq-server 3.6.5 which is used by stx 3.0. To align with stx 3.0, we need to build erlang with compatible openssl version so that we can upgrade rabbitmq-server to 3.6.5. The commit includes the following changes to that goal: - Add dependency on openssl10 1.0.2 instead of openssl 1.1.1d - Add bbappend for openssl10 1.0.2 to handle sysroot conflicts with openssl 1.1.1d. - Handle the openssl10 lib and herders in do_configure_prepend so erlang builds successfaully with ssl enabled. - Fix two QA warnings. fix #250 Signed-off-by: Jackie Huang --- .../openssl/openssl10_1.0.2r.bbappend | 15 +++++++ .../erlang/erlang-native_R16B03-1.bbappend | 19 +++++++++ .../erlang/erlang_R16B03-1.bbappend | 24 +++++++++++ ...rts-configure.in-avoid-RPATH-warning.patch | 40 +++++++++++++++++++ 4 files changed, 98 insertions(+) create mode 100644 recipes-connectivity/openssl/openssl10_1.0.2r.bbappend create mode 100644 recipes-devtools/erlang/erlang-native_R16B03-1.bbappend create mode 100644 recipes-devtools/erlang/files/erts-configure.in-avoid-RPATH-warning.patch diff --git a/recipes-connectivity/openssl/openssl10_1.0.2r.bbappend b/recipes-connectivity/openssl/openssl10_1.0.2r.bbappend new file mode 100644 index 0000000..7f84e57 --- /dev/null +++ b/recipes-connectivity/openssl/openssl10_1.0.2r.bbappend @@ -0,0 +1,15 @@ + +SYSROOT_PREPROCESS_FUNCS += "openssl10_avoid_conflict" + +openssl10_avoid_conflict () { + # For libaries + mkdir -p ${SYSROOT_DESTDIR}${libdir}/openssl10 + mv ${SYSROOT_DESTDIR}${libdir}/lib* ${SYSROOT_DESTDIR}${libdir}/engines \ + ${SYSROOT_DESTDIR}${libdir}/ssl ${SYSROOT_DESTDIR}${libdir}/pkgconfig \ + ${SYSROOT_DESTDIR}${libdir}/openssl10 + + # For headers + mv ${SYSROOT_DESTDIR}${includedir}/openssl ${SYSROOT_DESTDIR}${includedir}/openssl10 + + rm -rf ${SYSROOT_DESTDIR}${bindir} ${SYSROOT_DESTDIR}${sysconfdir} +} diff --git a/recipes-devtools/erlang/erlang-native_R16B03-1.bbappend b/recipes-devtools/erlang/erlang-native_R16B03-1.bbappend new file mode 100644 index 0000000..c5f1a50 --- /dev/null +++ b/recipes-devtools/erlang/erlang-native_R16B03-1.bbappend @@ -0,0 +1,19 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +# erlang < 20.0 is not compatibel with OpenSSL 1.1.x +DEPENDS += "openssl10-native" +DEPENDS_remove += "openssl-native" + +SRC_URI += "file://erts-configure.in-avoid-RPATH-warning.patch" + +EXTRA_OECONF = '--with-ssl' + +do_configure_prepend () { + if [ -d ${STAGING_INCDIR}/openssl10 ]; then + rm -rf ${STAGING_INCDIR}/openssl + ln -sf ${STAGING_INCDIR}/openssl10 ${STAGING_INCDIR}/openssl + fi + if [ -d ${STAGING_LIBDIR}/openssl10 ]; then + cp -rf ${STAGING_LIBDIR}/openssl10/* ${STAGING_LIBDIR} + fi +} diff --git a/recipes-devtools/erlang/erlang_R16B03-1.bbappend b/recipes-devtools/erlang/erlang_R16B03-1.bbappend index 715864f..866cfca 100644 --- a/recipes-devtools/erlang/erlang_R16B03-1.bbappend +++ b/recipes-devtools/erlang/erlang_R16B03-1.bbappend @@ -1,5 +1,29 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/files:" +# erlang < 20.0 is not compatibel with OpenSSL 1.1.x +DEPENDS += "openssl10" +DEPENDS_remove += "openssl" + SRC_URI += " \ file://fix-install-ownership.patch \ " + +do_configure_prepend () { + export erl_xcomp_sysroot=${STAGING_DIR_HOST} + + if [ -d ${STAGING_INCDIR}/openssl10 ]; then + rm -rf ${STAGING_INCDIR}/openssl + ln -sf ${STAGING_INCDIR}/openssl10 ${STAGING_INCDIR}/openssl + fi + if [ -d ${STAGING_LIBDIR}/openssl10 ]; then + cp -rf ${STAGING_LIBDIR}/openssl10/* ${STAGING_LIBDIR} + fi + sed -i -e 's/opensslconf.h/opensslconf-64.h/' \ + ${STAGING_INCDIR}/openssl/rc4.h \ + ${STAGING_INCDIR}/openssl/rc2.h +} + +do_install_append () { + # Fix the do_package_qa issue + chown -R root:root ${D} +} diff --git a/recipes-devtools/erlang/files/erts-configure.in-avoid-RPATH-warning.patch b/recipes-devtools/erlang/files/erts-configure.in-avoid-RPATH-warning.patch new file mode 100644 index 0000000..5fa15e0 --- /dev/null +++ b/recipes-devtools/erlang/files/erts-configure.in-avoid-RPATH-warning.patch @@ -0,0 +1,40 @@ +From fe07e40ed72021225fce05dc1557fd83200d4506 Mon Sep 17 00:00:00 2001 +From: Jackie Huang +Date: Mon, 23 Mar 2020 13:00:10 +0800 +Subject: [PATCH] erts/configure.in: avoid RPATH warning + +Signed-off-by: Jackie Huang +--- + erts/configure | 2 +- + erts/configure.in | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/erts/configure b/erts/configure +index 6940143..a70d5a3 100755 +--- a/erts/configure ++++ b/erts/configure +@@ -37534,7 +37534,7 @@ fi + + + +-std_ssl_locations="/usr/local /usr/sfw /usr /opt/local /usr/pkg /usr/local/openssl /usr/lib/openssl /usr/openssl /usr/local/ssl /usr/lib/ssl /usr/ssl" ++std_ssl_locations="/usr/local /usr/sfw /opt/local /usr/pkg /usr/local/openssl /usr/lib/openssl /usr/openssl /usr/local/ssl /usr/lib/ssl /usr/ssl" + + + # Check whether --with-ssl-zlib or --without-ssl-zlib was given. +diff --git a/erts/configure.in b/erts/configure.in +index da4bf65..82e7d54 100644 +--- a/erts/configure.in ++++ b/erts/configure.in +@@ -3843,7 +3843,7 @@ AC_SUBST(STATIC_KERBEROS_LIBS) + AC_SUBST(SSL_LINK_WITH_ZLIB) + AC_SUBST(STATIC_ZLIB_LIBS) + +-std_ssl_locations="/usr/local /usr/sfw /usr /opt/local /usr/pkg /usr/local/openssl /usr/lib/openssl /usr/openssl /usr/local/ssl /usr/lib/ssl /usr/ssl" ++std_ssl_locations="/usr/local /usr/sfw /opt/local /usr/pkg /usr/local/openssl /usr/lib/openssl /usr/openssl /usr/local/ssl /usr/lib/ssl /usr/ssl" + + AC_ARG_WITH(ssl-zlib, + AS_HELP_STRING([--with-ssl-zlib=PATH], +-- +2.7.4 +