[PATCH 1/5] random: Don't assume that _WIN64 implies x86_64

Martin Storsjö martin at martin.st
Thu Mar 22 22:05:51 CET 2018


On Thu, 22 Mar 2018, Jussi Kivilinna wrote:

> On 22.03.2018 10:56, Martin Storsjö wrote:
>> This fixes building this file for windows on aarch64.
>> Signed-off-by: Martin Storsjö <martin at martin.st>
> Thanks for the patches. There is few generic things that needs to be done
> before these can be applied:
> - Check signing off DCO part in doc/HACKING

Thanks - this should done now, hopefully the signatures should be fine 
even though I don't have a really proper mail+PGP setup.

> - Add ChangeLog entries to beginning of commit log, see existing commit
>   messages for example.

Ok, will try to - I'll resend patches with this taken care of.

> I'm interested in testing these patches myself. Can you give some pointers
> for how to cross-compile libgcrypt for windows/aarch64?

Absolutely. First off, you need llvm-mingw: 

The first step in this consists of building a recent pinned version of 
LLVM+clang, which takes a nontrivial amount of time (a bit over 30 min on 
an average machine), but I think a prebuilt version of the recent 6.0.0 
release [1] should also be fine. (I can't think of any changes since the 
6.0 branch that would be relevant for gcrypt.) If you use a prebuilt 
clang, you can skip the build-llvm.sh step.

After building that, you should have a set of 
{i686,x86_64,armv7,aarch64}-w64-mingw32-<tool> tools just like in normal 
mingw setups.

For these patches, I'm configuring with --host=aarch64-w64-mingw32 and 
nothing else.

In case you're interested in testing building in armv7 mode, you'll run 
into similar issues as for aarch64 (the ELF specific .type/.size aren't 
supported etc), but the build for that target succeeded out of the box so 
there wasn't quite as much need for patches there. One main caveat to know 
about windows on armv7 is that it's thumb-only, which can be an issue if 
there's assembly that isn't ready to be assembled in that mode.

If you actually want to try running binaries as well, you can actually get 
surprisingly far with running things in wine on aarch64 linux. For best 
results, you need a wine built with a recent clang (>= clang 5.0) with 
a patch [2] that isn't yet merged in upstream wine.

// Martin

[1] http://releases.llvm.org/download.html#6.0.0
[2] https://source.winehq.org/patches/data/136484

More information about the Gcrypt-devel mailing list