diff --git a/src/tools/compiletest/src/header/needs.rs b/src/tools/compiletest/src/header/needs.rs index 20d3fd473433..7bc7e4b86803 100644 --- a/src/tools/compiletest/src/header/needs.rs +++ b/src/tools/compiletest/src/header/needs.rs @@ -261,6 +261,11 @@ fn find_dlltool(config: &Config) -> bool { let path = std::env::var_os("PATH").expect("missing PATH environment variable"); let path = std::env::split_paths(&path).collect::>(); + // dlltool is used ony by GNU based `*-*-windows-gnu` + if !(config.matches_os("windows") && config.matches_env("gnu") && config.matches_abi("")) { + return false; + } + // On Windows, dlltool.exe is used for all architectures. // For non-Windows, there are architecture specific dlltool binaries. let dlltool_found = if cfg!(windows) {