From c5817a0dafc67882f15730ee818fbcdba1b7b915 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Wed, 13 Jan 2021 09:48:45 -0500 Subject: [PATCH 1/2] m4: Change LIBS order of TOR_SEARCH_LIBRARY() 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 --- acinclude.m4 | 4 ++-- changes/ticket33624 | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 changes/ticket33624 diff --git a/acinclude.m4 b/acinclude.m4 index 5ecdf1d5c2..e6389ea1d4 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -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 @@ -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 diff --git a/changes/ticket33624 b/changes/ticket33624 new file mode 100644 index 0000000000..eded3b4dee --- /dev/null +++ b/changes/ticket33624 @@ -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. + From 8230d2ba3b9d571df4c7a425daa872d41a4f3180 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Thu, 14 Jan 2021 09:25:46 -0500 Subject: [PATCH 2/2] configure: Don't print disable option for module that can't be disabled This is currently for the dircache module that can not be disabled by itself, it is only disabled from the relay module. Thus, we should not print in the configure summary the disable option. Signed-off-by: David Goulet --- configure.ac | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 6d50dc9508..41c627021a 100644 --- a/configure.ac +++ b/configure.ac @@ -357,6 +357,12 @@ dnl --- dnl All our modules. m4_define(MODULES, relay dirauth dircache) +# Some modules are only disabled through another option. For those, we don't +# want to print the help in the summary at the end of the configure. Any entry +# in the following set will not print the "--disable-module-NAME" command in +# the summary. +m4_set_add_all([MODULES_WITH_NO_OPTIONS], [dircache]) + dnl Relay module. AC_ARG_ENABLE([module-relay], AS_HELP_STRING([--disable-module-relay], @@ -2821,7 +2827,9 @@ PPRINT_SUBTITLE([Modules]) m4_foreach_w([mname], MODULES, [ AM_COND_IF(m4_join([], [BUILD_MODULE_], m4_toupper([]mname[])), value=1, value=0) - PPRINT_PROP_BOOL([mname (--disable-module-mname)], $value) + m4_set_contains([MODULES_WITH_NO_OPTIONS], mname, + PPRINT_PROP_BOOL([mname], $value), + PPRINT_PROP_BOOL([mname (--disable-module-mname)], $value)) ] )