Bug 1492664 - generate portable URLs for Android mach commands; r=nalexander
[gecko.git] / build / cargo-linker
blob31864d2a86e81b38064d574ca8d0dcdf02d301a1
1 #!/bin/sh
3 # If you want to use a custom linker with Cargo, Cargo requires that you
4 # specify it in Cargo.toml or via the matching environment variable.
5 # Passing extra options to the linker is possible with Cargo via
6 # RUSTFLAGS='-C link-args', but testing showed that doing this reliably
7 # was difficult.
9 # Our solution to these problems is to use this wrapper script. We pass
10 # in the LD and the LDFLAGS to use via environment variables. Note that
11 # we do *not* quote either MOZ_CARGO_WRAP variable:
13 # * MOZ_CARGO_WRAP_LD is equivalent to CC on Unix-y platforms, and CC
14 # frequently has additional arguments in addition to the compiler
15 # itself.
16 # * MOZ_CARGO_WRAP_LDFLAGS contains space-separated arguments to pass,
17 # and not quoting it ensures that either of those arguments is passed
18 # as a separate argument to the actual LD.
20 # $@ is doubly quoted for the eval. See bug 1418598.
22 eval ${MOZ_CARGO_WRAP_LD} ${MOZ_CARGO_WRAP_LDFLAGS} '"$@"'