]> git.lizzy.rs Git - rust.git/commit
auto merge of #16904 : inrustwetrust/rust/link-path-order, r=alexcrichton
authorbors <bors@rust-lang.org>
Sun, 7 Sep 2014 19:06:28 +0000 (19:06 +0000)
committerbors <bors@rust-lang.org>
Sun, 7 Sep 2014 19:06:28 +0000 (19:06 +0000)
commit86730e43c0dd83f946deb88ccbdaaa49817b1136
tree942ef73a79eb106b2d65ef5dcf4eaa233a06abd2
parentd7502ac2d6c64958be672991c33a1404ea5f040e
parente7a000e717b06d7010c872efb1ed395fe8d8857d
auto merge of #16904 : inrustwetrust/rust/link-path-order, r=alexcrichton

Issue can be reproduced by the following:
```
$ cat main.rs
fn main() {}
$ rustc -Z print-link-args -Lfoo -Lbar main.rs
```
Run the rustc command a few times and observe that the order of the '-L' 'foo' '-L' 'bar' options randomly changes.

Actually hit this issue in practice on Windows when specifying two -L directories to rustc, one with rust-sdl2 in it and one with the C SDL2.dll. Since Windows file systems aren't case-sensitive, gcc randomly attempted to link against the rust sdl2.dll instead of SDL2.dll if that -L directory happened to come first.

The randomness was due to addl_lib_search_paths being a HashSet. Changed it to a Vec instead which maintains the ordering.
Unsure how to test this though since it is random by nature; suggestions very welcome.