Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Trac Trac
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Service Desk
    • Milestones
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • Legacy
  • TracTrac
  • Issues
  • #27273
Closed (moved) (moved)
Open
Created Aug 22, 2018 by Trac@tracbot

ASan fails to link on Travis due to rustc and linker arguments

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/}

Trac:
Username: alexcrichton

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking