diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-06-20 17:53:09 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-06-20 17:53:09 -0400 |
commit | 6c3ad4cae8b967f6dc9ee98f5b01de9e327e9880 (patch) | |
tree | e3ec1443fd9e1977c64b6123a5c73f10b553bee7 /configure.ac | |
parent | 3a640520996ae45ed32f483432af735187bb7ee5 (diff) | |
download | tor-6c3ad4cae8b967f6dc9ee98f5b01de9e327e9880.tar.gz tor-6c3ad4cae8b967f6dc9ee98f5b01de9e327e9880.zip |
Use different RUST_LINKER_OPTIONS for sanitizers
These appear to work for me.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac index f976cdd42d..606bceeda5 100644 --- a/configure.ac +++ b/configure.ac @@ -1128,11 +1128,20 @@ dnl What's more, we need to specify them in a linker script rather than dnl from build.rs: these options aren't allowed in the cargo:rustc-flags dnl variable. RUST_LINKER_OPTIONS="" -if test "x$CFLAGS_ASAN" != "x"; then - RUST_LINKER_OPTIONS="$RUST_LINKER_OPTIONS -static-libasan" -fi -if test "x$CFLAGS_UBSAN" != "x"; then - RUST_LINKER_OPTIONS="$RUST_LINKER_OPTIONS -static-libubsan" +if test "x$have_clang" = "xyes"; then + if test "x$CFLAGS_ASAN" != "x"; then + RUST_LINKER_OPTIONS="$RUST_LINKER_OPTIONS $CFLAGS_ASAN" + fi + if test "x$CFLAGS_UBSAN" != "x"; then + RUST_LINKER_OPTIONS="$RUST_LINKER_OPTIONS $CFLAGS_UBSAN" + fi +else + if test "x$CFLAGS_ASAN" != "x"; then + RUST_LINKER_OPTIONS="$RUST_LINKER_OPTIONS -lasan" + fi + if test "x$CFLAGS_UBSAN" != "x"; then + RUST_LINKER_OPTIONS="$RUST_LINKER_OPTIONS -lubsan" + fi fi AC_SUBST(RUST_LINKER_OPTIONS) |