Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Tor Tor
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 325
    • Issues 325
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 30
    • Merge requests 30
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • The Tor Project
  • Core
  • TorTor
  • Issues
  • #27273
Closed
Open
Issue 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