Skip to content

Add target thumbv7a-pc-windows-msvc#53621

Merged
bors merged 4 commits intorust-lang:masterfrom
jordanrh1:windows-arm
Sep 13, 2018
Merged

Add target thumbv7a-pc-windows-msvc#53621
bors merged 4 commits intorust-lang:masterfrom
jordanrh1:windows-arm

Conversation

@jordanrh1
Copy link
Copy Markdown

This is an early draft of support for Windows/ARM. To test it,

  1. Install Visual Studio 2017 and Windows SDK version 17134.
  2. Obtain Update vcxproj file for VS2017 alexcrichton/xz2-rs#35, Support windows/arm target compiler-builtins#256, and the fix for LLVM Bug 38620.
  3. Open a command prompt and run
set CC_thumbv7a-pc-windows-msvc=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\bin\HostX64\arm\CL.exe
set CFLAGS_thumbv7a-pc-windows-msvc=/D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1 /nologo
c:\python27\python.exe x.py build --host x86_64-pc-windows-msvc --build x86_64-pc-windows-msvc --target thumbv7a-pc-windows-msvc

It will build the stage 2 compiler, but fail building stage 2 test. To build an executable targeting windows/arm,

  1. Copy build\x86_64-pc-windows-msvc\stage0\bin\cargo.exe to build\x86_64-pc-windows-msvc\stage2\bin
  2. Open a command prompt and run
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
set PATH=build\x86_64-pc-windows-msvc\stage2\bin;%PATH%
cargo new hello
cd hello
cargo build --target thumbv7a-pc-windows-msvc –release

Copy target\thumbv7a-pc-windows-msvc\release\hello.exe to your platform and run.

There are a number of open issues that I'm hoping to get help with:

  • Error when compiling the test crate: error: cannot link together two panic runtimes: panic_abort and panic_unwind
  • Warnings when building the compiler_builtins crate: warning: cl : Command line warning D9002 : ignoring unknown option '-fvisibility=hidden'. It looks like the build system is passing GCC-style flags to MSVC.
  • How to specify the LIBPATH entries for ARM. Right now they are hardcoded as absolute paths in the target spec.

This pull request depends on

This PR updates #52659

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants