LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-31-2019, 02:06 PM   #1
Holering
Member
 
Registered: Feb 2010
Distribution: Slackware - Gentoo - Debian
Posts: 197

Rep: Reputation: 22
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.

Last edited by Holering; 01-01-2020 at 03:49 PM. Reason: resolved
 
Old 01-01-2020, 04:15 PM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,258
Blog Entries: 24

Rep: Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193
Thankks for returning with your own solution so that others may benefit!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
copied files from SOURCE to TARGET but now want to rsync SOURCE to existing TARGET teddymills1 Linux - Newbie 3 10-28-2019 07:07 AM
Installation (Linux) RISCV GNU Toolchain error: C compiler cannot create executables, recipe for target 'configure-target-libgomp' failed riscv Linux - Newbie 2 03-23-2017 08:36 AM
How do I find the target directory (not the target fs) of a mount -bind raananh Linux - Newbie 2 01-13-2013 09:18 AM
iptables: rule with RETURN target just after a rule with ACCEPT target Nerox Linux - Networking 6 09-04-2011 03:33 PM
Making a symlink follow its target when the target moves pwabrahams Linux - Software 3 03-08-2011 07:04 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration