Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not compile or run UWP branch targeting thumbv7a-uwp-windows-msvc #23

Closed
bdbai opened this issue Aug 6, 2020 · 5 comments
Closed

Comments

@bdbai
Copy link

bdbai commented Aug 6, 2020

As I am trying building with target thumbv7a-uwp-windows-msvc, compilation failed:

error[E0570]: The ABI `"stdcall"` is not supported for the current target
  --> C:\Users\bdbai\.cargo\registry\src\github.com-1ecc6299db9ec823\com-0.2.0\src\interfaces\iclass_factory.rs:12:1
   |
12 | #[com_interface("00000001-0000-0000-c000-000000000046")]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0570]: The ABI `"stdcall"` is not supported for the current target
 --> C:\Users\bdbai\.cargo\registry\src\github.com-1ecc6299db9ec823\com-0.2.0\src\interfaces\iunknown.rs:8:1
  |
8 | #[com_interface("00000000-0000-0000-C000-000000000046")]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

It looked like a problem with com-rs and had been reported (see microsoft/com-rs#92 (comment)). Then I checked out the commit before using com-rs at 946a74, a similar error came out:

error[E0570]: The ABI `"stdcall"` is not supported for the current target
 --> src\uwp\interop.rs:2:1
2 | / extern "stdcall" {
3 | |     fn RoInitialize(init_type: RoInitType) -> winrt::ErrorCode;
4 | | }
  | |_^

Fixed by changing stdcall to system. After that, I managed to package and deployed it to a ARM device, a panic immediately occurred without previous stack trace.
image
(A screenshot of the call stack recovered from a minidump)

Further investigation is required to make it run on an ARM device.

@robmikh
Copy link
Owner

robmikh commented Aug 6, 2020

Thanks for trying this out! I wonder if this is also the case with ARM64, I can give that a try over the weekend.

The problem with using the pre-com-rs version is that it's mainly duct tape and paper clips (I heavily mutilated some of the stuff you were doing in your firstuwp-rs project, it was a great help!). We might have to experiment with a modified version of com-rs, or wait for implementing types to be supported in Rust/WinRT.

@robmikh
Copy link
Owner

robmikh commented Aug 7, 2020

Well, unfortunately after switching to a new machine and a newer version of Visual Studio 2019, I'm no longer able to build the rust toolchain. It looks like there's an issue building llvm, hopefully it gets resolved soon and I can look at this again.

I seem to be having the same problem this person is: https://users.rust-lang.org/t/rust-bootstrap-fails-on-windows/45162

@bdbai
Copy link
Author

bdbai commented Aug 8, 2020

Well, unfortunately after switching to a new machine and a newer version of Visual Studio 2019, I'm no longer able to build the rust toolchain.

Try Xargo instead? It only requires a nightly toolchain.

@robmikh
Copy link
Owner

robmikh commented Aug 18, 2020

This is mainly for my own tracking, but the issue of compiling llvm with MSVC seems to be recorded here:
https://bugs.llvm.org/show_bug.cgi?id=47160

@robmikh
Copy link
Owner

robmikh commented Aug 1, 2021

To finally close the loop on this, I gave this a try again and it worked.

@robmikh robmikh closed this as completed Aug 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants