comp.lang.ada
 help / color / mirror / Atom feed
* Ada, Windows x64 building
@ 2017-05-05  4:30 George J
  2017-05-31 22:54 ` alby.gamper
  0 siblings, 1 reply; 4+ messages in thread
From: George J @ 2017-05-05  4:30 UTC (permalink / raw)


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!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Ada, Windows x64 building
  2017-05-05  4:30 Ada, Windows x64 building George J
@ 2017-05-31 22:54 ` alby.gamper
  2017-06-02  8:19   ` George J
  0 siblings, 1 reply; 4+ messages in thread
From: alby.gamper @ 2017-05-31 22:54 UTC (permalink / raw)


On Friday, May 5, 2017 at 2:30:31 PM UTC+10, George J wrote:
> 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!

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Ada, Windows x64 building
  2017-05-31 22:54 ` alby.gamper
@ 2017-06-02  8:19   ` George J
  2017-06-03  5:27     ` George J
  0 siblings, 1 reply; 4+ messages in thread
From: George J @ 2017-06-02  8:19 UTC (permalink / raw)


> 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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Ada, Windows x64 building
  2017-06-02  8:19   ` George J
@ 2017-06-03  5:27     ` George J
  0 siblings, 0 replies; 4+ messages in thread
From: George J @ 2017-06-03  5:27 UTC (permalink / raw)


[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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-06-03  5:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-05  4:30 Ada, Windows x64 building George J
2017-05-31 22:54 ` alby.gamper
2017-06-02  8:19   ` George J
2017-06-03  5:27     ` George J

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox