tor/link_rust.sh.in
Nick Mathewson bd9ebb3763 Use a rust build script to set linker options correctly for tests.
We need this trick because some of our Rust tests depend on our C
code, which in turn depend on other native libraries, which thereby
pulls a whole mess of our build system into "cargo test".

To solve this, we add a build script (build.rs) to set most of the
options that we want based on the contents of config.rust.  Some
options can't be set, and need to go to the linker directly: we use
a linker replacement (link_rust.sh) for these.  Both config.rust and
link_rust.sh are generated by autoconf for us.

This patch on its own should enough to make the crypto test build,
but not necessarily enough to make it pass.
2018-06-19 12:01:13 -04:00

11 lines
355 B
Bash

#!/bin/sh
#
# A linker script used when building Rust tests. Autoconf makes link_rust.sh
# from link_rust_sh.in, and uses it to pass extra options to the linker
# when linking Rust stuff.
#
# We'd like to remove the need for this, but build.rs doesn't let us pass
# -static-libasan and -static-libubsan to the linker.
"$CCLD" @RUST_LINKER_OPTIONS@ "$@"