2

I am working on a project for a Windows library in Ada that must be compiled in a DLL, starting from a .gpr project via GPRBuild. I was able to produce a working DLL for Windows, but now I want to specify the base address for the location of the DLL. At the moment I was able to set the DLL location through the editbin utility but I would like to integrate this step directly in the .gpr file. I have tried to use the Library_Options attribute:

for Library_Options use ("-Wl,--disable-auto-image-base", "-Wl,--image-base=0x20000000");

But it does not seem to help. Is it somehow possible to do what I want directly after compilation or is it really necessary to use an external script?

  • 1
    Specify verbose mode to see what's going awry; consider using `make` to invoke `gprbuild`, as suggested [here](https://docs.adacore.com/gprbuild-docs/html/gprbuild_ug/building_with_gprbuild.html). – trashgod Aug 31 '20 at 16:46
  • Since GNAT for Windows is MinGW-based, [this thread](http://mingw.5.n7.nabble.com/How-can-I-set-my-own-image-base-td8505.html) could be of help. You can override the default specs file with your own, see [here](http://www.mingw.org/wiki/SpecsFileHOWTO). – flyx Sep 01 '20 at 08:57
  • You can also try running the linker command standalone in a shell or CMD prompt : if you can get the arguments to work that way, then feeding them through a gpr file is a separate problem. –  Sep 01 '20 at 15:35

0 Answers0