From cfa4eb2fc5eac917d979c01ecd572654d50b8055 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Mon, 14 Feb 2022 16:52:26 +0000 Subject: [PATCH] Merge of r1896278 from trunk: *) mod_tls: Fix a linkage issue with rustls when compiled with rust 1.55, 1.56 or 1.57. This prevents the loading of the module because of an undefined symbol: fmaf See https://github.com/rustls/rustls-ffi/issues/133 [Christophe Jaillet] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1898077 13f79535-47bb-0310-9956-ffa450edef68 --- modules/tls/config2.m4 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/tls/config2.m4 b/modules/tls/config2.m4 index 4750b6aadcc..af97178866b 100644 --- a/modules/tls/config2.m4 +++ b/modules/tls/config2.m4 @@ -144,6 +144,19 @@ is usually linked shared and requires loading. ], $tls_objs, , most, [ MOD_TLS_LINK_LIBS="-lrustls" ;; esac + + # Some rustls versions need an extra -lm when linked + # See https://github.com/rustls/rustls-ffi/issues/133 + rustls_version=`rustc --version` + case "$rustls_version" in + *1.55*) need_lm="yes" ;; + *1.56*) need_lm="yes" ;; + *1.57*) need_lm="yes" ;; + esac + if test "$need_lm" = "yes" ; then + MOD_TLS_LINK_LIBS="$MOD_TLS_LINK_LIBS -lm" + fi + # The only symbol which needs to be exported is the module # structure, so ask libtool to hide everything else: APR_ADDTO(MOD_TLS_LDADD, [$MOD_TLS_LINK_LIBS -export-symbols-regex tls_module]) -- 2.47.2