From 6cccaeba716354e79136cd801dcb395318821aac Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Wed, 17 Aug 2022 10:12:25 +0900 Subject: [PATCH] Ensure stable file prefixes in the *_gnu import libraries For some reason, the import libraries currently in the repository don't match what running the tool_gnu command produces, due to the use of different prefixes. This adjusts the command to produce the same prefixes as the ones currently in the import libraries from the repository. --- crates/tools/gnu/src/main.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/tools/gnu/src/main.rs b/crates/tools/gnu/src/main.rs index b5ed0e4ba4..61a38b360a 100644 --- a/crates/tools/gnu/src/main.rs +++ b/crates/tools/gnu/src/main.rs @@ -82,6 +82,13 @@ EXPORTS cmd.arg(format!("{}.def", library)); cmd.arg("-l"); cmd.arg(format!("lib{}.a", library)); + // Ensure consistency in the prefixes used by dlltool. + cmd.arg("-t"); + if library.contains(".") { + cmd.arg(format!("{}_", library).replace(".", "_").replace("-", "_")); + } else { + cmd.arg(format!("{}_dll_", library).replace("-", "_")); + } cmd.output().unwrap(); // Work around lack of determinism in dlltool output.