lostfox
lostfox

Reputation: 9

How to get gnatmake to create a mapfile for an Ada .dll?

So, I am trying to get gnatmake to give me a map file for a dll I am building.

But it i resisting every effort to do so. --create-map-file is only for executable, and it does make one for that, but I cannot get it to take for a .dll.

I have tried -M --print-map -M save.map but I am not getting anything to come out.

Thoughts?

Upvotes: -1

Views: 145

Answers (1)

DeeDee
DeeDee

Reputation: 5941

You could try to build the DLL using gnatdll. Here's a (very simplistic) example (without initialization/finalizing code):

Makefile

all:
    gnatmake -v demo.adb
    gnatdll -v -d demo.dll .\demo.ali -largs -Wl,-Map,demo.map

demo.ads

package Demo is

   function Add (X, Y : Integer) return Integer
     with Export, Convention => C;

end Demo;

demo.adb

package body Demo is
   
   ---------
   -- Add --
   ---------
   
   function Add (X, Y : Integer) return Integer is
   begin
      return X + Y;
   end Add;

end Demo;

demo.def

LIBRARY   LIBDEMO
EXPORTS
    add

output (directory contents after build)

demo.adb
demo.ads
demo.ali
demo.def
demo.dll
demo.map         <<<<<<  A .map file
demo.o
libdemo.dll.a
Makefile

Upvotes: 2

Related Questions