Skip to content

Commit

Permalink
Swap order of linking ssl/crypto
Browse files Browse the repository at this point in the history
GNU linkers will sometimes aggressively try to strip objects and archives from a
linker command line in a left-to-right fashion. When a linker hits an object
file that doesn't satisfy any unresolved symbols, it will discard the object and
not re-visit it. This means that currently if symbols are depended upon in
libssl then some of the dependencies of libssl (in libcrypto) may have already
been stripped, causing a link error.

By swapping the order of what's linked it reflects the natural flow of
dependencies and the linker should figure everything out for us.
  • Loading branch information
alexcrichton committed Sep 1, 2015
1 parent e28b73e commit bf16c19
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions openssl-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ fn main() {
Some(ref v) => v.split(":").collect(),
None => if target.contains("windows") {
if get_mingw_in_path().is_some() && lib_dir.is_none() && include_dir.is_none() {
vec!("eay32", "ssleay32")
vec!["ssleay32", "eay32"]
} else {
vec!("eay32", "ssl32")
vec!["ssl32", "eay32"]
}
} else {
vec!("crypto", "ssl")
vec!["ssl", "crypto"]
}
};

Expand Down

0 comments on commit bf16c19

Please sign in to comment.