Search code examples
adagnat

Enabling "--enable-stdcall-fixup" flag with gnatmake?


I'm using gnatmake to build my Ada project and I get the following warning:

Warning: resolving _LoadLibraryA by linking to _LoadLibraryA@4
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
Warning: resolving _GetProcAddress by linking to _GetProcAddress@8

I'm trying to pass --endable-stdcall-fixup to gnatmake but claims it's not a switch, how can I pass linker options through gnatmake?

gnatmake --enable-stdcall-fixup main.adb
gnatmake: invalid switch: --enable-stdcall-fixup

(1) EDIT:

Upon using the changes suggested by the answer, I still get the same error, yet it appears to be correctly passing to the linker this time.

gnatmake main.adb -f -largs --enable-stdcall-fixup
gcc -c main.adb
gcc -c winapi.ads
gnatbind -x main.ali
gnatlink main.ali --enable-stdcall-fixup
Warning: resolving _LoadLibraryA by linking to _LoadLibraryA@4
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
Warning: resolving _GetProcAddress by linking to _GetProcAddress@8

Solution

  • Try -largs opts

    From gnatmake --help:

    To pass an arbitrary switch to the Compiler, Binder or Linker:
    -cargs opts opts are passed to the compiler
    -bargs opts opts are passed to the binder
    -largs opts opts are passed to the linker
    -margs opts opts are passed to gnatmake