From 6baa3d316e9ec69d0b835ab11b45442046503e73 Mon Sep 17 00:00:00 2001 From: Simonas Kazlauskas Date: Fri, 27 Aug 2021 13:34:06 +0300 Subject: [PATCH 1/2] Actually test i686-pc-windows-msvc with clang-cl Was missing a --target... --- .github/workflows/test.yml | 2 +- psm/build.rs | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a5c045c..fb897a9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -72,7 +72,7 @@ jobs: - uses: actions-rs/cargo@v1 with: command: test - args: --manifest-path=${{ matrix.manifest }} -- --nocapture + args: --target=${{ matrix.rust_target }} --manifest-path=${{ matrix.manifest }} -- --nocapture env: CC: ${{ matrix.clang_cl }} diff --git a/psm/build.rs b/psm/build.rs index 07baeb8..47cfa66 100644 --- a/psm/build.rs +++ b/psm/build.rs @@ -36,7 +36,6 @@ fn find_assembly( } ("x86", _, "windows", _) => Some(("src/arch/x86_windows_gnu.s", false)), ("x86_64", _, "windows", _) => Some(("src/arch/x86_64_windows_gnu.s", false)), - ("x86", _, _, _) => Some(("src/arch/x86.s", true)), ("x86_64", _, _, _) => Some(("src/arch/x86_64.s", true)), ("arm", _, _, _) => Some(("src/arch/arm_aapcs.s", true)), From a965b5e9c76234a1175a9fc179afe8143a361a49 Mon Sep 17 00:00:00 2001 From: Simonas Kazlauskas Date: Fri, 27 Aug 2021 13:40:32 +0300 Subject: [PATCH 2/2] Just use masm on msvc targets. A careful reading of the sources for `cc` suggest that `cc` should end up looking for `ml.exe` regardless of the `CC` set as long as the target has `msvc` in it and the file being compiled has `.asm` extension. --- psm/build.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/psm/build.rs b/psm/build.rs index 47cfa66..01a13bf 100644 --- a/psm/build.rs +++ b/psm/build.rs @@ -73,15 +73,7 @@ fn main() { let mut cfg = cc::Build::new(); let msvc = cfg.get_compiler().is_like_msvc(); - let clang_cl = cfg - .get_compiler() - .path() - .file_name() - .and_then(|f| f.to_str()) - .map(|f| f.contains("clang-cl")) - .unwrap_or(false); - let masm = msvc && !clang_cl; - let asm = if let Some((asm, canswitch)) = find_assembly(&arch, &endian, &os, &env, masm) { + let asm = if let Some((asm, canswitch)) = find_assembly(&arch, &endian, &os, &env, msvc) { println!("cargo:rustc-cfg=asm"); if canswitch { println!("cargo:rustc-cfg=switchable_stack")