Skip to content
Snippets Groups Projects
Commit adbdeafa authored by Nick Mathewson's avatar Nick Mathewson :game_die:
Browse files

More sophisticated attempt at detecting working linker options

On some platforms, the linker is perfectly happy to produce binaries
that won't run if you give it the wrong set of flags.  So when not
cross-compiling, try to link-and-run a little test program, rather
than just linking it.

Possible fix for 6173.
parent 26855fe2
No related branches found
No related tags found
No related merge requests found
......@@ -71,9 +71,14 @@ AC_DEFUN([TOR_CHECK_LDFLAGS], [
CFLAGS="$CFLAGS -pedantic -Werror"
LDFLAGS="$LDFLAGS $2 $1"
LIBS="$LIBS $3"
AC_TRY_LINK([], [return 0;],
AC_RUN_IFELSE([
#include <stdio.h>
int main(int argc, char **argv) { fputs("", stdout); return 0; }],
[AS_VAR_SET(VAR,yes)],
[AS_VAR_SET(VAR,no)])
[AS_VAR_SET(VAR,no)],
[AC_TRY_LINK([], [return 0;],
[AS_VAR_SET(VAR,yes)],
[AS_VAR_SET(VAR,no)])])
CFLAGS="$tor_saved_CFLAGS"
LDFLAGS="$tor_saved_LDFLAGS"
LIBS="$tor_saved_LIBS"
......
o Major bugfixes:
- Make our linker option detection code more robust against linkers
where a bad combination of options completes successfully but
makes an unrunnable binary. Fixes bug 6173; bugfix on 0.2.3.17-beta.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment