Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Ada, Windows x64 building

557 views
Skip to first unread message

George J

unread,
May 5, 2017, 12:30:31 AM5/5/17
to
Hi all!Have anybody experience with building x64 dll on Windows?
I have Windows7 x64, GNAT GPL 2016. I've spent all yesterday evening in trying to build x64 dll. x86 builds well, but when i add

...for Default_Switches ("Ada") use ("-m64")

i've got an error (don't remember original text)

gnat1 : gcc key -m64 doesn't support ...(smth like this)

then I replaced orig gnat/bin,lib files by files from mingw64 and got other ununderstandable errors.

So i'd like to know, how can i build Windows x64 binaries with Ada. I think it is impossible with GNAT GPL 2016.
Thanks!

alby....@gmail.com

unread,
May 31, 2017, 6:54:26 PM5/31/17
to
Hi George

You are correct, you cant build x64 applications using GNAT GPL 20xx.
However, you can however build/compile your own GNAT version using mingw64.

I find it easiest to cross compile/build GNAT on Linux, and then copy the
final distribution onto windows. Their are some detailed instructions on
how to do this on the mingw64 website. They also have some pre-build
distributions, BUT not all of them include GNAT/Ada

Alex

George J

unread,
Jun 2, 2017, 4:19:47 AM6/2/17
to
> Hi George
>
> You are correct, you cant build x64 applications using GNAT GPL 20xx.
> However, you can however build/compile your own GNAT version using mingw64.
>
> I find it easiest to cross compile/build GNAT on Linux, and then copy the
> final distribution onto windows. Their are some detailed instructions on
> how to do this on the mingw64 website. They also have some pre-build
> distributions, BUT not all of them include GNAT/Ada
>
> Alex

Alex, thanks a lot! I'll try this way.

George J

unread,
Jun 3, 2017, 1:27:27 AM6/3/17
to
[SOLVED]
So,thanks to Alex,yesterday i began trying in building x64 app in Windows with GNAT GPS. So i found solution. If any interested in it, there is some steps (according to this article (rus) http://www.ada-ru.org/start)
1. download and install msys2 from http://www.msys2.org/
2. run x64 msys shell and install ada compiler :
pacman -S mingw-w64-x86_64-gcc-ada
2.1 if you want x64 gdb debugger :
pacman -S mingw-w64-x86_64-gdb
3. there are some other components to install :
pacman -S mingw-w64-x86_64-gprbuild-gpl
pacman -S mingw-w64-x86_64-aws
pacman -S mingw-w64-x86_64-asis
pacman -S mingw-w64-x86_64-matreshka

after that you have to set environment variable PATH to the destination "\mingw64\bin" (for example C:\msys64\mingw64\bin), because gnat1.exe need libraries from there. And reboot, sometime it necessary;)

then you have to find file toolchains.py in your gnat directory (ex. : C:\GNAT\2016\share\gps\support\core )
and add toolchain for the x64 building as in this example:
<toolchain name="gnat_x64">
<gnat_driver>C:\msys64\mingw64\bin\gnat</gnat_driver>
<gnat_list>C:\msys64\mingw64\bin\gnatls</gnat_list>
<debugger>C:\msys64\mingw64\bin\gdb</debugger>
<cpp_filt>c++filt</cpp_filt>
<compiler lang="ada">C:\msys64\mingw64\bin\gnatmake</compiler>
<compiler lang="c">C:\msys64\mingw64\bin\gcc</compiler>
<compiler lang="c++">C:\msys64\mingw64\bin\g++</compiler>
<compiler lang="asm">C:\msys64\mingw64\bin\gcc</compiler>
</toolchain>
of course you have to paste your own paths.

Then you create your project or open current with GNAT GPS. Go to Project->Properties->Toolchain, press "Add", open combobox and find your new toolchain (for ex. gnat_x64). When your checked it, make it active and check if paths right (GNAT Driver, GNAT List, Debugger, Compilers.. all must destinate to your x64 mingw paths as you have set in toolchains.py)

after this you can set -m64 flag, or not set, as you wish. If you run debug mode and make Debug->Data->Display Registers you'll see x64 registers.
All done.
0 new messages