This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

cross compilation for windows on arm

Hi All,
I'm trying to cross compile a library from ubuntu on ARM to windows on ARM.

basically, while doing cross compilation we first need toolchains right.
so i have installed the below for ubuntu 
sudo apt install libc6-armel-cross libc6-dev-armel-cross binutils-arm-linux-gnueabi libncurses5-dev build-essential bison flex libssl-dev bc

now i'm trying to get the toolchain for windows but i could find any because in the configuration step which is

./configure --build=build   --host=host

where build = The system on which the package is built.
host=The system where built programs and libraries will run.

i need to specify my host machine config to host prefix right.

could you guys help me how to cross compile for my scenario??

also suggest me the steps if there are any other step for cross compilation.

Thanks in Advance!!

  • Hi @
    Thanks for the reply.

    No, i couldn't find any information over there.


  • Hi !

    AFAIK you don't need to specify --build. GNU Autoconf should automatically choose the right compiler. Building the cross toolchains for running on Windows isn't IMHO good documented, also on the official GNU GCC homepage and there are some configuration options missing.

    You could try to choose for --host the option aarch64-mingw-windows64 (for running a 64 Bit Windows on ARM) or arm-mingw-windows (for 32 Bit Windows).
    Without to specify --target, the target architecture and underlying system is the same as specified in host. A example:

    $ ../binutils-2.42/configure --host=aarch64-mingw-windows64 --target=arm-none-eabi
    checking build system type... x86_64-pc-linux-gnu
    checking host system type... aarch64-mingw-windows64
    checking target system type... arm-none-eabi
    [...]
    $

    This should built the binutils for Windows 64 on AArch64 and targeting ARM (32 Bit) for bare-metal targets. (There might are additional configuration options to set in this example.)

    Hope this helps.

  • Hi 

    Thanks for the reply!!

    Do u know how to install this toolchain aarch64-mingw-windows64 ?

  • Hi !

    Normally you must specify the installation directory with the configuration option --prefix. And the execute make install after make (compiling). Then the directory which was specified with --prefix contains the Windows binaries. A simple copy of this folder on Windows should work.

    I have to admit, that I'm currently don't have tried to compile binutils/GCC for running on Windows.

    But I will try compile it (and test it) until the day. Hope you have the time to wait. :)

  • Hi 
    i understood that if we configure the project with option --prefix, the binaries will be installed in the prefix directory.
    actually what i want to know is the --host option tells where the built programs will run right?
    so in my case i want the built programs to be run on windows ARM! so i want to know what to provide in the --host option.
    when i give the --host as aarch64-mingw-windows64 or aarch64-w64-mingw32 while configuring the project it display it can't able to recognize this option.

    Sure i'll wait!
    Thanks for the kind response :)