3
0
Fork 0
forked from mirrors/nixpkgs

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.
This commit is contained in:
Ben Wolsieffer 2022-06-12 13:03:25 -04:00 committed by Yt
parent 48480ea46a
commit a6bbe3f794

View file

@ -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