[tor-bugs] #27273 [- Select a component]: ASan fails to link on Travis due to rustc and linker arguments

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed Aug 22 18:57:53 UTC 2018


#27273: ASan fails to link on Travis due to rustc and linker arguments
--------------------------------------+--------------------
     Reporter:  alexcrichton          |      Owner:  (none)
         Type:  defect                |     Status:  new
     Priority:  Medium                |  Milestone:
    Component:  - Select a component  |    Version:
     Severity:  Normal                |   Keywords:
Actual Points:                        |  Parent ID:
       Points:                        |   Reviewer:
      Sponsor:                        |
--------------------------------------+--------------------
 In helping to debug https://trac.torproject.org/projects/tor/ticket/25386
 I've found that a number of the link errors are attributable to the linker
 invocation on Travis. The recent `link_rust.sh` script is definitely
 necessary I think, except that I believe it needs a few tweaks:

 * The `-lasan` argument should be replaced with `-fsanitizer=address` I
 believe to ensure that the C compiler links all of its relevant libraries
 (as they may have different names and different numbers of libs on some
 platforms I think).
 * Second, the Rust compiler by default passes `-nodefaultlibs` to the
 linker which means that the linker script also passes this along. It
 looks, however, like this is incompatible with `-fsanitizer=address`,
 causing link errors. This argument should be safe to strip out though.

 The first bullet was easy enough to fix locally and the second bullet was
 fixable by changing `link_rust.sh` to a `bash` script and then using
 something like:

 {{{
 linker_args="$@"
 $CCLD @RUST_LINKER_OPTIONS@ ${linker_args//-nodefaultlibs/}
 }}}

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/27273>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list