LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   How do I target win32-arm? (https://www.linuxquestions.org/questions/programming-9/how-do-i-target-win32-arm-4175666821/)

Holering 12-31-2019 02:06 PM

How do I target win32-arm?
 
Trying to build static target win32-arm for unsupported Windows 8.1 RT in test mode (aka desktop program). How do build for this?

I've read about installing mingw crossover for Linux, but they all seem to target win32 x86 & x86_64. How do I target win32 arm (armv7a)?

Do I have to rebuild mingw crossover for arm?

Thanks and kind regards!

edit:


Looked more into this and found out GCC still has problems targeting mingw32-ARM, but there's LLVM which doesn't.

https://github.com/mstorsjo/llvm-mingw/releases This project targets both armv7 and aarch64 in addition to x86; each variant for download appears to target all four targets with crossover. Prebuilt docker Linux images are also available.


mstorsjo llvm-mingw says,
Quote:

LLVM MinGW

This is a recipe for reproducibly building a LLVM/Clang/LLD based mingw-w64 toolchain.

Benefits of a LLVM based MinGW toolchain are:

Support for targeting ARM/ARM64 (while GCC obviously does support these architectures, it doesn't support Windows on ARM)
A single toolchain targeting all four architectures (i686, x86_64, armv7 and arm64) instead of separate compiler binaries for each architecture
Support for generating debug info in PDB format
Support for Address Sanitizer and Undefined Behaviour Sanitizer
Clang on its own can also be used as compiler in the normal GNU binutils based environments though, so the main difference lies in replacing binutils with LLVM based tools.
Other useful software is winelib https://wiki.winehq.org/Winelib and winemaker https://wiki.winehq.org/Winemaker

Non-gnu cross building software from x86 Visual Studio 2017 instructions are here https://pete.akeo.ie/2017/05/compili...ions-with.html. Visual Studio needs configuration
Code:

<WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>
and define
Code:

_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
. Windows SDK 10.0.15063.0 or newer should have 8.1 dlls for arm. More instructions and for Visual Studio 2012 here (also explains converting and getting libs from local RT install https://www.reddit.com/r/WindowsRT/c..._programs_for/. DirectX 9 dlls for arm can be found in the "Windows Hardware Kit" and appear to work.

edit 2:

Downloaded mstorsjo llvm-mingw-20191230-armv7.zip from github releases. Extracted to root of second hard drive partition on Windows 8.1 RT and added resulting directory location with subfolder "bin" to user "Path" environment variable. Tried one of the llvm-mingw programs and got error about program cannot execute so I signed it thinking the binaries need signing. Now I'm getting a different error, "The program can’t start because api-ms-win-crt-heap-l1-1-0.dll is missing from your computer.". Looks like Visual C++ redistributable 2015 or newer needs installed; specifically vc_redist.arm.exe. Unfortunately Microsoft took it down from their servers or forgot to upload it alongside x86, so now I have to install Visual Studio 2015 or newer on a x86 machine and go to the install directory to find the file in one of the subfolders. Hopefully it will work afterward...

Can anyone upload vc_redist.arm.exe from Visual Studio 2015 or newer? Thanks for any help.


Edit 01-01-2020
Finally! You don't really need vc_redist.arm.exe so I'll explain how to install llvm-mingw for Windows 8.1 RT ARM. Install order will be from least to greatest as described.

1st, install windows8.1-kb2919442-arm_506ed7113697c597c2859d295d562fa4311834ec.msu http://download.windowsupdate.com/c/...a4311834ec.msu
2nd, install windows8.1-kb2919355-arm_a6119d3e5ddd1a233a09dd79d91067de7b826f85.msuhttp://download.windowsupdate.com/ms...de7b826f85.msu
3rd, install Windows8.1-KB2999226-arm.msu from zip file WindowsUCRT.zip v1.0 https://www.microsoft.com/en-us/down....aspx?id=48234
4th, download and extract llvm-mingw-20191230-armv7.zip to a directory location without spaces and set the location with bin subdirectory in your user "Path" environment variable https://github.com/mstorsjo/llvm-min...1230-armv7.zip
5th, sign all files extracted from llvm-mingw-20191230-armv7.zip and make sure Windows 8.1 RT is in test mode. If Windows 8.1 RT is not in test mode, use command prompt or powershell with administrator mode and use bcdedit with a Unicode cedilla latin character to change Windows 8.1 into test mode and restart; you can use this powershell example
Code:

bcdedit /set '{current}' loadoptions '/TŅSTSIGNING'
. That's it.

Some Windows updates are criticized for preventing the "Test Mode" feature from functioning. Enable test mode before installing any updates for this to work, and don't install any more updates after these previously mentioned for WindowsUCRT.

astrogeek 01-01-2020 04:15 PM

Thankks for returning with your own solution so that others may benefit!


All times are GMT -5. The time now is 11:32 PM.