Use -m option instead of looking for a cross-compiling version of dlltool

This commit is contained in:
Daniel Paoliello 2023-02-22 09:58:47 -08:00
parent 439292bc79
commit a90f342b03
9 changed files with 87 additions and 14 deletions

View file

@ -16,6 +16,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
zlib1g-dev \
lib32z1-dev \
xz-utils \
mingw-w64 \
&& rm -rf /var/lib/apt/lists/*

View file

@ -22,6 +22,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
zlib1g-dev \
xz-utils \
nodejs \
mingw-w64 \
&& rm -rf /var/lib/apt/lists/*
COPY scripts/sccache.sh /scripts/

View file

@ -23,6 +23,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
zlib1g-dev \
xz-utils \
nodejs \
mingw-w64 \
&& rm -rf /var/lib/apt/lists/*
# Install powershell (universal package) so we can test x.ps1 on Linux

View file

@ -25,6 +25,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
zlib1g-dev \
xz-utils \
nodejs \
mingw-w64 \
&& rm -rf /var/lib/apt/lists/*
# Install powershell (universal package) so we can test x.ps1 on Linux

View file

@ -16,6 +16,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libssl-dev \
pkg-config \
xz-utils \
mingw-w64 \
&& rm -rf /var/lib/apt/lists/*
COPY scripts/sccache.sh /scripts/

View file

@ -964,6 +964,19 @@ pub fn make_test_description<R: Read>(
.join(if config.host.contains("windows") { "rust-lld.exe" } else { "rust-lld" })
.exists();
fn is_on_path(file: &'static str) -> impl Fn() -> bool {
move || env::split_paths(&env::var_os("PATH").unwrap()).any(|dir| dir.join(file).is_file())
}
// On Windows, dlltool.exe is used for all architectures.
#[cfg(windows)]
let (has_i686_dlltool, has_x86_64_dlltool) =
(is_on_path("dlltool.exe"), is_on_path("dlltool.exe"));
// For non-Windows, there are architecture specific dlltool binaries.
#[cfg(not(windows))]
let (has_i686_dlltool, has_x86_64_dlltool) =
(is_on_path("i686-w64-mingw32-dlltool"), is_on_path("x86_64-w64-mingw32-dlltool"));
iter_header(path, src, &mut |revision, ln| {
if revision.is_some() && revision != cfg {
return;
@ -1031,6 +1044,8 @@ pub fn make_test_description<R: Read>(
reason!(config.debugger == Some(Debugger::Gdb) && ignore_gdb(config, ln));
reason!(config.debugger == Some(Debugger::Lldb) && ignore_lldb(config, ln));
reason!(!has_rust_lld && config.parse_name_directive(ln, "needs-rust-lld"));
reason!(config.parse_name_directive(ln, "needs-i686-dlltool") && !has_i686_dlltool());
reason!(config.parse_name_directive(ln, "needs-x86_64-dlltool") && !has_x86_64_dlltool());
should_fail |= config.parse_name_directive(ln, "should-fail");
});