]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fix library order in -lmbedtls test.
authorGert Doering <gert@greenie.muc.de>
Thu, 5 May 2016 11:48:16 +0000 (13:48 +0200)
committerGert Doering <gert@greenie.muc.de>
Thu, 5 May 2016 12:29:01 +0000 (14:29 +0200)
-lmbedx509 needs to be before -lmbedcrypto, otherwise you end up with
unresolved symbols mbedtls_pk_load_file and mbedtls_pk_parse_subpubkey
on systems with static mbedtls libraries and a linker that only does
one left-to-right resolving pass through these.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <20160505115050.GA81579@greenie.muc.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/11605
Signed-off-by: Gert Doering <gert@greenie.muc.de>
configure.ac

index 30f6cfcbdbbf7855d13469d772cfb5b767db664c..97ad85606f9a90938bfe34c609f3792b6fd1ba78 100644 (file)
@@ -844,11 +844,11 @@ elif test "${with_crypto_library}" = "mbedtls"; then
 
        if test -z "${MBEDTLS_CFLAGS}" -a -z "${MBEDTLS_LIBS}"; then
                # if the user did not explicitly specify flags, try to autodetect
-               LIBS="${LIBS} -lmbedtls -lmbedcrypto -lmbedx509"
+               LIBS="${LIBS} -lmbedtls -lmbedx509 -lmbedcrypto"
                AC_CHECK_LIB(
                        [mbedtls],
                        [mbedtls_ssl_init],
-                       [MBEDTLS_LIBS="-lmbedtls -lmbedcrypto -lmbedx509"],
+                       [MBEDTLS_LIBS="-lmbedtls -lmbedx509 -lmbedcrypto"],
                        [AC_MSG_ERROR([Could not find mbed TLS.])],
                        [${PKCS11_HELPER_LIBS}]
                )