Rustc build doesn't pass RUSTFLAGS "-L native=/path" to linker commands with -lffi #48409
Labels
A-linkage
Area: linking into static, shared libraries and binaries
C-bug
Category: This is a bug.
E-needs-mcve
Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
T-cargo
Relevant to the cargo team, which will review and decide on the PR/issue.
Carried over from rust-lang/cargo#4452 per @alexcrichton
I have
libffi
in a non-standard location. I setRUSTFLAGS
to contain-L native=/path
when buildingrustc
itself. Cargo passes this-L
path when compiling individual objects, but does not pass the-L
path when attempting to link anything that also gets-lffi
on the linker command line. The end result is that the link fails because-lffi
can't be found.edit: I worked around this by making a wrapper to
gcc
that passes the-L
rule and passing it as the--default-linker
option.Example breakage, when
RUSTFLAGS
has-L native=/path
:The text was updated successfully, but these errors were encountered: