Skip to content

Commit bf16c19

Browse files
committed
Swap order of linking ssl/crypto
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.
1 parent e28b73e commit bf16c19

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

openssl-sys/build.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ fn main() {
3636
Some(ref v) => v.split(":").collect(),
3737
None => if target.contains("windows") {
3838
if get_mingw_in_path().is_some() && lib_dir.is_none() && include_dir.is_none() {
39-
vec!("eay32", "ssleay32")
39+
vec!["ssleay32", "eay32"]
4040
} else {
41-
vec!("eay32", "ssl32")
41+
vec!["ssl32", "eay32"]
4242
}
4343
} else {
44-
vec!("crypto", "ssl")
44+
vec!["ssl", "crypto"]
4545
}
4646
};
4747

0 commit comments

Comments
 (0)