[Bug ada/80921] Cross compiling for mingw32 target fails to build Ada shared libraries

keith.marshall at mailinator dot com gcc-bugzilla@gcc.gnu.org
Thu Jun 1 08:19:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80921

--- Comment #6 from Keith Marshall <keith.marshall at mailinator dot com> ---
(In reply to Keith Marshall from comment #5)
> ... a clean configure and build does now produce:
> 
> gcc/ada/rts/libgnarl-6.dll
> gcc/ada/rts/libgnat-6.dll
> 
> but there are no accompanying import libraries, (as there are for other
> DLLs, produced for other languages in the GCC suite).  Definitely an
> improvement, but perhaps not quite the entire solution.

Looking in the build log, (i.e. output from 'make 2>&1 | tee build.log'), I now
see the commands which create these DLLs; in both cases, they invoke:

mingw32-gcc -shared -shared-libgcc ...

which is correct, (although -static-libgcc may be safer); however, both
commands also include the -Wl,-soname,<dllname> linker option, which is wrong. 
AIUI, that option is applicable only for building ELF shared objects, but we
are creating a PECOFF shared object; in this case, the preferred option would
be the PECOFF linker's -Wl,--out-implib,<implibname> option, (and we would
typically omit the DLL version suffix), such that we would produce:

gcc/ada/rts/libgnarl.dll.a
gcc/ada/rts/libgnat.dll.a

to accompany:

gcc/ada/rts/libgnarl-6.dll
gcc/ada/rts/libgnat-6.dll


More information about the Gcc-bugs mailing list