Skip to content

Commit

Permalink
m4: Change LIBS order of TOR_SEARCH_LIBRARY()
Browse files Browse the repository at this point in the history
Some gcc versions do explode if the order of the linker flags are not correct.
One issue was statically building OpenSSL which would require that "-lssl
-lcrypto" be put _before_ the "-lpthread -ldl" flags.

I have not such problem with GCC 10 but does with GCC 9.

Closes #33624

Signed-off-by: David Goulet <[email protected]>
  • Loading branch information
dgoulet-tor committed Jan 13, 2021
1 parent c931eae commit c5817a0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ AC_CACHE_CHECK([for $1 directory], tor_cv_library_$1_dir, [
for tor_trydir in "$try$1dir" "(system)" "$prefix" /usr/local /usr/pkg $8; do
LDFLAGS="$tor_saved_LDFLAGS"
LIBS="$tor_saved_LIBS $3"
LIBS="$3 $tor_saved_LIBS"
CPPFLAGS="$tor_saved_CPPFLAGS"
if test -z "$tor_trydir" ; then
Expand Down Expand Up @@ -219,7 +219,7 @@ AC_CACHE_CHECK([for $1 directory], tor_cv_library_$1_dir, [
CPPFLAGS="$tor_saved_CPPFLAGS"
]) dnl end cache check
LIBS="$LIBS $3"
LIBS="$3 $LIBS"
if test "$tor_cv_library_$1_dir" != "(system)"; then
TOR_EXTEND_CODEPATH($tor_cv_library_$1_dir)
fi
Expand Down
5 changes: 5 additions & 0 deletions changes/ticket33624
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
o Minor bugfixes (configure, static build):
- Change our search library configure macro linker flag order so it works
for certain compilers that need the right order. Fixes bug 33624; bugfix
on 0.1.1.0-alpha.

0 comments on commit c5817a0

Please sign in to comment.