diff options
author | Ben Wolsieffer <benwolsieffer@gmail.com> | 2022-06-12 13:03:25 -0400 |
---|---|---|
committer | Yt <happysalada@proton.me> | 2022-06-14 20:09:33 -0400 |
commit | a6bbe3f79452892ef0eabc8c2b72d3d3c015e32c (patch) | |
tree | 829759aa6d99379528668871baaf165a0f8a5040 /pkgs/build-support/rust/build-rust-crate/lib.sh | |
parent | 48480ea46ad4cb60a78fd02e4fb29eab11502bcf (diff) | |
download | nixpkgs-a6bbe3f79452892ef0eabc8c2b72d3d3c015e32c.tar nixpkgs-a6bbe3f79452892ef0eabc8c2b72d3d3c015e32c.tar.gz nixpkgs-a6bbe3f79452892ef0eabc8c2b72d3d3c015e32c.tar.bz2 nixpkgs-a6bbe3f79452892ef0eabc8c2b72d3d3c015e32c.tar.lz nixpkgs-a6bbe3f79452892ef0eabc8c2b72d3d3c015e32c.tar.xz nixpkgs-a6bbe3f79452892ef0eabc8c2b72d3d3c015e32c.tar.zst nixpkgs-a6bbe3f79452892ef0eabc8c2b72d3d3c015e32c.zip |
buildRustCrate: pass link flags when building libraries
With Rust 1.61, it is necessary to link to external static/dynamic libaries when building the rlib that uses them, rather than when linking the final binary. In fact, it is no longer necessary to specify the libraries to link when building the final binary, but the library search path flags must still be included.
Diffstat (limited to 'pkgs/build-support/rust/build-rust-crate/lib.sh')
-rw-r--r-- | pkgs/build-support/rust/build-rust-crate/lib.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pkgs/build-support/rust/build-rust-crate/lib.sh b/pkgs/build-support/rust/build-rust-crate/lib.sh index d4927b025aa..39f7d53f6f7 100644 --- a/pkgs/build-support/rust/build-rust-crate/lib.sh +++ b/pkgs/build-support/rust/build-rust-crate/lib.sh @@ -16,6 +16,7 @@ build_lib() { --out-dir target/lib \ -L dependency=target/deps \ --cap-lints allow \ + $LINK \ $LIB_RUSTC_OPTS \ $BUILD_OUT_DIR \ $EXTRA_BUILD \ @@ -97,7 +98,6 @@ setup_link_paths() { if [[ ! -z "$i" ]]; then for library in $i; do echo "-l $library" >> target/link - echo "-l $library" >> target/link.final done fi done |