blob: 2b05e1893dbf29d2b158fc42f17bf68d502cbcbb [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001From f37fa9a41f248fa41dd74a41c66cb41a291c03d2 Mon Sep 17 00:00:00 2001
Patrick Williamsc0f7c042017-02-23 20:41:17 -06002From: Andre McCurdy <armccurdy@gmail.com>
3Date: Fri, 16 Sep 2016 12:18:23 -0700
4Subject: [PATCH] fix libtomcrypt/libtommath ordering
5
6To prevent build failures when using system libtom libraries and
7linking with --as-needed, LIBTOM_LIBS should be in the order
8-ltomcrypt -ltommath, not the other way around, ie libs should be
9prepended to LIBTOM_LIBS as they are found, not appended.
10
11Note that LIBTOM_LIBS is not used when linking with the bundled
12libtom libs.
13
Brad Bishopd7bf8c12018-02-25 22:55:05 -050014Upstream-Status: Backport [ https://github.com/mkj/dropbear/commit/f9e6bc2aecab0f4b5b529e07a92cc63c8a66cd4b ]
Patrick Williamsc0f7c042017-02-23 20:41:17 -060015
16Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Brad Bishopd7bf8c12018-02-25 22:55:05 -050017Signed-off-by: Dengke Du <dengke.du@windriver.com>
Patrick Williamsc0f7c042017-02-23 20:41:17 -060018---
19 configure.ac | 8 ++++----
20 1 file changed, 4 insertions(+), 4 deletions(-)
21
22diff --git a/configure.ac b/configure.ac
Brad Bishopd7bf8c12018-02-25 22:55:05 -050023index 245408d..d624853 100644
Patrick Williamsc0f7c042017-02-23 20:41:17 -060024--- a/configure.ac
25+++ b/configure.ac
Brad Bishopd7bf8c12018-02-25 22:55:05 -050026@@ -393,16 +393,16 @@ AC_ARG_ENABLE(bundled-libtom,
Patrick Williamsc0f7c042017-02-23 20:41:17 -060027 AC_MSG_NOTICE(Forcing bundled libtom*)
28 else
29 BUNDLED_LIBTOM=0
30- AC_CHECK_LIB(tommath, mp_exptmod, LIBTOM_LIBS="$LIBTOM_LIBS -ltommath",
31+ AC_CHECK_LIB(tommath, mp_exptmod, LIBTOM_LIBS="-ltommath $LIBTOM_LIBS",
32 [AC_MSG_ERROR([Missing system libtommath and --disable-bundled-libtom was specified])] )
33- AC_CHECK_LIB(tomcrypt, register_cipher, LIBTOM_LIBS="$LIBTOM_LIBS -ltomcrypt",
34+ AC_CHECK_LIB(tomcrypt, register_cipher, LIBTOM_LIBS="-ltomcrypt $LIBTOM_LIBS",
35 [AC_MSG_ERROR([Missing system libtomcrypt and --disable-bundled-libtom was specified])] )
36 fi
37 ],
38 [
39 BUNDLED_LIBTOM=0
40- AC_CHECK_LIB(tommath, mp_exptmod, LIBTOM_LIBS="$LIBTOM_LIBS -ltommath", BUNDLED_LIBTOM=1)
41- AC_CHECK_LIB(tomcrypt, register_cipher, LIBTOM_LIBS="$LIBTOM_LIBS -ltomcrypt", BUNDLED_LIBTOM=1)
42+ AC_CHECK_LIB(tommath, mp_exptmod, LIBTOM_LIBS="-ltommath $LIBTOM_LIBS", BUNDLED_LIBTOM=1)
43+ AC_CHECK_LIB(tomcrypt, register_cipher, LIBTOM_LIBS="-ltomcrypt $LIBTOM_LIBS", BUNDLED_LIBTOM=1)
44 ]
45 )
46
47--
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500482.8.1
Patrick Williamsc0f7c042017-02-23 20:41:17 -060049