build/cargo-linker
author Cosmin Sabou <csabou@mozilla.com>
Mon, 18 Feb 2019 23:53:31 +0000
changeset 459819 2653d42f3448989d53a749e17e8a2bc7805d843a
parent 392763 69465fa861e14da6b903ec4f154abf355e5d6d79
child 465532 3a444460cb6c3db935838ce735f1e6edceb55dfa
permissions -rwxr-xr-x
Bug 1489496 - Disable browser_bug567127.js on windows !debug due to frequent failures. r=jmaher Differential Revision: https://phabricator.services.mozilla.com/D20125

#!/bin/sh

# If you want to use a custom linker with Cargo, Cargo requires that you
# specify it in Cargo.toml or via the matching environment variable.
# Passing extra options to the linker is possible with Cargo via
# RUSTFLAGS='-C link-args', but testing showed that doing this reliably
# was difficult.
#
# Our solution to these problems is to use this wrapper script.  We pass
# in the LD and the LDFLAGS to use via environment variables.  Note that
# we do *not* quote either MOZ_CARGO_WRAP variable:
#
# * MOZ_CARGO_WRAP_LD is equivalent to CC on Unix-y platforms, and CC
#   frequently has additional arguments in addition to the compiler
#   itself.
# * MOZ_CARGO_WRAP_LDFLAGS contains space-separated arguments to pass,
#   and not quoting it ensures that either of those arguments is passed
#   as a separate argument to the actual LD.
#
# $@ is doubly quoted for the eval. See bug 1418598.

eval ${MOZ_CARGO_WRAP_LD} ${MOZ_CARGO_WRAP_LDFLAGS} '"$@"'