<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/src/test/run-make/use-extern-for-plugins/foo.rs, branch 1.4.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.4.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.4.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2015-02-06T21:53:39+00:00</updated>
<entry>
<title>rustc: Don't fall back to -L if using --extern</title>
<updated>2015-02-06T21:53:39+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2015-02-06T21:40:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=48b6aef6605794a9da0d9254960a91bbea0a0737'/>
<id>urn:sha1:48b6aef6605794a9da0d9254960a91bbea0a0737</id>
<content type='text'>
The compiler would previously fall back to using `-L` and normal lookup paths if
a `--extern` path was specified but it did not match (wrong architecture, for
example). This commit removes this behavior and forces the hand of the crate
loader to *always* use the `--extern` path if specified, no matter whether it is
correct or not.

This fixes a bug today where the compiler's own libraries are favored in cross
compilation by accident. For example when a crate using the crates.io version of
`log` was cross compiled, Cargo would compile `log` for the target architecture.
When loading the macros, however, the compiler currently favors using the *host*
architecture (for plugins), and because the `--extern log=...` pointed at an
rlib for the target architecture, that lookup failed. The crate loader  then
fell back on `-L` paths to find the compiler-used `log` crate (the wrong one!)
and then a compile failure happened because the logging macros are slightly
different.
</content>
</entry>
</feed>
