Re: [patch] Fix cygwin ada install [was Re: Yet another issue with gcc current trunk with ada on cygwin]

2012-05-06 Thread Eric Botcazou
 OK, revision 184558 now reverted.

Now on the 4.7 branch as well.

-- 
Eric Botcazou


Re: [patch] Fix cygwin ada install [was Re: Yet another issue with gcc current trunk with ada on cygwin]

2012-05-02 Thread Arnaud Charlet
  Pascal, I'd suggest you go ahead and revert this patch.
 
 This patch has already been reverted by Eric on Apr 10 on gcc-4.7 branch.

I'm talking about the FSF trunk repository.

Arno


Re: [patch] Fix cygwin ada install [was Re: Yet another issue with gcc current trunk with ada on cygwin]

2012-05-02 Thread Pascal Obry

Arno,

 This patch has already been reverted by Eric on Apr 10 on gcc-4.7 branch.
 
 I'm talking about the FSF trunk repository.

Ah ok, but I do not have commit access to this repository. Eric maybe?

-- 
  Pascal Obry
  --
  gpg --keyserver keys.gnupg.net --recv-key F949BD3B


Re: [patch] Fix cygwin ada install [was Re: Yet another issue with gcc current trunk with ada on cygwin]

2012-05-02 Thread Arnaud Charlet
  I'm talking about the FSF trunk repository.
 
 Ah ok, but I do not have commit access to this repository. Eric maybe?

If you send me a patch with changelog, I'll take care of it.

Arno


Re: [patch] Fix cygwin ada install [was Re: Yet another issue with gcc current trunk with ada on cygwin]

2012-05-02 Thread Pascal Obry
Arno,

The ChangeLog:

Revert commit r184558 as breaking Ada runtime.

The pseudo reloc feature works only when linking against
DLL. Remove this pacth as it install the import libraries
for the shared Ada runtime. This breaks any Ada program
using the Ada shared runtime.

With this ChangeLog just revert commit r184558 from FSF tree.

For the record, this is the culprit:


commit 7ef88902afa64e783e9b612bf423fd9d12c668ff
Author: davek davek@138bc75d-0d04-0410-961f-82ee72b054a4
Date:   Fri Feb 24 16:17:01 2012 +

libada/ChangeLog:

* Makefile.in (bindir): Import from autoconf and pass down to
submake.

gcc/ada/ChangeLog:

* gcc-interface/Makefile.in (WIN_SO_PREFIX [windows targets]): New
Windows-specific make variable.
(WIN_SO_INSTALL_DIR [windows targets]): Likewise.
(install-gnatlib): Respect the above during installation when set,
and also install any windows import library that has been built.
(gnatlib-shared-win32): Use WIN_SO_PREFIX to name output DLL and
also
build a corresponding import library.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184558
138bc75d-0d04-0410-96



Thanks.

-- 
  Pascal Obry
  --
  gpg --keyserver keys.gnupg.net --recv-key F949BD3B


Re: [patch] Fix cygwin ada install [was Re: Yet another issue with gcc current trunk with ada on cygwin]

2012-05-02 Thread Arnaud Charlet
OK, revision 184558 now reverted.

Arno
--
Index: gcc/ada/ChangeLog
===
--- gcc/ada/ChangeLog   (revision 187037)
+++ gcc/ada/ChangeLog   (working copy)
@@ -1,3 +1,8 @@
+2012-05-02  Pascal Obry  o...@adacore.com
+
+   Revert
+   2012-02-24  Dave Korn  dave.korn.cyg...@gmail.com
+
 2012-04-30  Jan Hubicka  j...@suse.cz
 
* gcc-interface/utils.c (rest_of_subprog_body_compilation): Update
@@ -1599,7 +1604,7 @@
 
 2012-02-22  Hristian Kirtchev  kirtc...@adacore.com
 
-   * exp_ch7.adb (Create_Finalizer): Suppress elaboration checks on 
+   * exp_ch7.adb (Create_Finalizer): Suppress elaboration checks on
stack-related finalizers.
 
 2012-02-22  Ed Schonberg  schonb...@adacore.com
Index: gcc/ada/gcc-interface/Makefile.in
===
--- gcc/ada/gcc-interface/Makefile.in   (revision 187037)
+++ gcc/ada/gcc-interface/Makefile.in   (working copy)
@@ -1547,19 +1547,16 @@ ifeq ($(strip $(filter-out cygwin% mingw
   # the Cygwin port has always been a CygMing frankenhybrid and it is
   # a long-term project to disentangle them.
   ifeq ($(strip $(filter-out cygwin%,$(osys))),)
-WIN_SO_PREFIX=cyg
 LIBGNAT_TARGET_PAIRS = \
 s-memory.adbs-memory.adb \
 g-socthi.adsg-socthi.ads \
 g-socthi.adbg-socthi.adb
   else
-WIN_SO_PREFIX=lib
 LIBGNAT_TARGET_PAIRS = \
 s-memory.adbs-memory-mingw.adb \
 g-socthi.adsg-socthi-mingw.ads \
 g-socthi.adbg-socthi-mingw.adb
   endif
-  WIN_SO_INSTALL_DIR = $(bindir)
   LIBGNAT_TARGET_PAIRS += \
   a-dirval.adba-dirval-mingw.adb \
   a-excpol.adba-excpol-abort.adb \
@@ -2500,14 +2497,11 @@ install-gnatlib: ../stamp-gnatlib-$(RTSD
 # for shared libraries on some targets, e.g. on HP-UX where the x
 # permission is required.
 # Also install the .dSYM directories if they exist (these directories
-# contain the debug information for the shared libraries on darwin),
-# and the windows import libraries if they exist.
-   libpfx=$(if $(WIN_SO_PREFIX),$(WIN_SO_PREFIX),lib); \
-   librtlobjdir=$(if 
$(WIN_SO_INSTALL_DIR),$(WIN_SO_INSTALL_DIR),$(ADA_RTL_OBJ_DIR)); \
+# contain the debug information for the shared libraries on darwin)
for file in gnat gnarl; do \
-  if [ -f 
$(RTSDIR)/$${libpfx}$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) ]; then \
- $(INSTALL) 
$(RTSDIR)/$${libpfx}$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
-$(DESTDIR)$${librtlobjdir}; \
+  if [ -f $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) ]; 
then \
+ $(INSTALL) 
$(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
+$(DESTDIR)$(ADA_RTL_OBJ_DIR); \
   fi; \
   if [ -f $(RTSDIR)/lib$${file}$(soext) ]; then \
  $(LN_S) lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
@@ -2517,10 +2511,6 @@ install-gnatlib: ../stamp-gnatlib-$(RTSD
  $(CP) -r 
$(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext).dSYM \
$(DESTDIR)$(ADA_RTL_OBJ_DIR); \
   fi; \
-  if [ -f 
$(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext)$(arext) ]; then \
- $(INSTALL_DATA) 
$(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext)$(arext) \
-$(DESTDIR)$(ADA_RTL_OBJ_DIR); \
-  fi; \
done
 # This copy must be done preserving the date on the original file.
for file in $(RTSDIR)/*.ad?; do \
@@ -2726,18 +2716,16 @@ gnatlib-shared-win32:
cd $(RTSDIR); `echo $(GCC_FOR_TARGET) \
 | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` 
-shared -shared-libgcc \
$(PICFLAG_FOR_TARGET) \
-   -o $(WIN_SO_PREFIX)gnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
-   
-Wl,-out-implib,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)$(arext) \
+   -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
$(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
-   
$(SO_OPTS)$(WIN_SO_PREFIX)gnat$(hyphen)$(LIBRARY_VERSION)$(soext) $(MISCLIB)
+   $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) $(MISCLIB)
cd $(RTSDIR); `echo $(GCC_FOR_TARGET) \
 | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` 
-shared -shared-libgcc \
$(PICFLAG_FOR_TARGET) \
-   -o $(WIN_SO_PREFIX)gnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
-   
-Wl,-out-implib,libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext)$(arext) \
+   -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
$(GNATRTL_TASKING_OBJS) \
-   
$(SO_OPTS)$(WIN_SO_PREFIX)gnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
-   $(THREADSLIB) -L. -lgnat$(hyphen)$(LIBRARY_VERSION)
+   $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
+   $(THREADSLIB) 

Re: [patch] Fix cygwin ada install [was Re: Yet another issue with gcc current trunk with ada on cygwin]

2012-04-29 Thread Pascal Obry

Arno,

 Pascal, I'd suggest you go ahead and revert this patch.

This patch has already been reverted by Eric on Apr 10 on gcc-4.7 branch.

-- 
  Pascal Obry
  --
  gpg --keyserver keys.gnupg.net --recv-key F949BD3B


Re: [patch] Fix cygwin ada install [was Re: Yet another issue with gcc current trunk with ada on cygwin]

2012-04-27 Thread Pascal Obry
Le 06/04/2012 17:27, Pascal Obry a écrit :
 
 Back on this! It turn out that this breaks the shared Ada runtime.
 Indeed, exported variables on Ada packages in a DLLs are only accessible
 when linking against DLL (thanks to runtime pseudo reloc).
 
 With the patch applied it is not possible to build any Ada application
 using the shared runtime. This is a very serious problem, the patch
 should be reverted.
 
 Sorry for not having remembered before about this and why linking
 against DLL was so important!
 

PING?

-- 
  Pascal Obry
  --
  gpg --keyserver keys.gnupg.net --recv-key F949BD3B


Re: [patch] Fix cygwin ada install [was Re: Yet another issue with gcc current trunk with ada on cygwin]

2012-04-10 Thread Arnaud Charlet
 Back on this! It turn out that this breaks the shared Ada runtime.
 Indeed, exported variables on Ada packages in a DLLs are only accessible
 when linking against DLL (thanks to runtime pseudo reloc).
 
 With the patch applied it is not possible to build any Ada application
 using the shared runtime. This is a very serious problem, the patch
 should be reverted.

Indeed, that's a blocking issue.

Pascal, could you take care of reverting this change (at least the parts
that are intrusve)? Thanks in advance.

Arno


Re: [patch] Fix cygwin ada install [was Re: Yet another issue with gcc current trunk with ada on cygwin]

2012-04-06 Thread Pascal Obry

Back on this! It turn out that this breaks the shared Ada runtime.
Indeed, exported variables on Ada packages in a DLLs are only accessible
when linking against DLL (thanks to runtime pseudo reloc).

With the patch applied it is not possible to build any Ada application
using the shared runtime. This is a very serious problem, the patch
should be reverted.

Sorry for not having remembered before about this and why linking
against DLL was so important!

-- 
  Pascal Obry
  --
  gpg --keyserver keys.gnupg.net --recv-key F949BD3B


Re: [patch] Fix cygwin ada install [was Re: Yet another issue with gcc current trunk with ada on cygwin]

2012-02-24 Thread Dave Korn
On 22/02/2012 16:25, Pascal Obry wrote:
 Dave,
 
   Pascal, ping?
 
 Sorry for the delay, these message has fallen into the crack!

  No problem, I had plenty to be getting on with in the meantime :)

 Anyway, with these explanations I'm ok with the patch.

  Thanks.  Committed revision 184558.

cheers,
  DaveK



Re: [patch] Fix cygwin ada install [was Re: Yet another issue with gcc current trunk with ada on cygwin]

2012-02-22 Thread Dave Korn
On 09/01/2012 11:56, Eric Botcazou wrote:
   Sorry for the delay guys, I got rather busy over the holidays.  I see
 we're now discussing a patch for next stage 1.
 
 No, not necessarily, the patch is specific to Ada on Windows so the risk is 
 quite low.
 
   It does however solve the problem of wanting the DLL to be in the /bin
 directory, while still needing something to stand in its place in the /lib
 directory so that the linker can find it without the compiler having to put
 -L$prefix/bin in the specs.
 
 This indeed sounds compelling enough.
 
   It's also used on Cygwin and MinGW to address library versioning: the
 actual DLL has a numbered suffix to indicate version, but the import
 library is unnumbered, so you can just say -lblah as usual and
 automatically link against whatever the installed version of the DLL is
 without having to know the version suffix and specify it in the -l option. 
 Ada doesn't need that, as it happens, because it always generates the
 specfile to explicitly include the version number of libgnat/libgnarl in
 the -l option, and doesn't try to keep the shared library compatible across
 point releases of the compiler, but it's how all the other runtimes work on
 Windows; they all put an import library in /lib and the DLL itself into
 /bin.  Ada should work the same way, because otherwise you either need to
 point your PATH into gcc's private dir at runtime, or point your linker
 into /bin at linktime, neither of which are entirely neat solutions.
 
 If all the other runtimes do it, I think we should do it too.  Pacal, what do 
 you think?

  Pascal, ping?

cheers,
  DaveK


Re: [patch] Fix cygwin ada install [was Re: Yet another issue with gcc current trunk with ada on cygwin]

2012-02-22 Thread Pascal Obry
Dave,

   Pascal, ping?

Sorry for the delay, these message has fallen into the crack!

Anyway, with these explanations I'm ok with the patch.

-- 
  Pascal Obry
  --
  gpg --keyserver keys.gnupg.net --recv-key F949BD3B


Re: [patch] Fix cygwin ada install [was Re: Yet another issue with gcc current trunk with ada on cygwin]

2012-01-09 Thread Dave Korn
On 17/12/2011 11:07, Eric Botcazou wrote:
 I am happily using this patch and await this to be committed.
 
 Only after the import library issue is addressed.  What do the other 
 libraries 
 bundled with GCC do here?

  Sorry for the delay guys, I got rather busy over the holidays.  I see we're
now discussing a patch for next stage 1.

  Well, to the point: I thinko'd slightly when I said that import libraries
are preferred; it's the platform convention, and it's the way the MS
toolchain works because it can't link directly against DLLs, but it's not (as
I mistakenly assumed at the time, although did not explicitly state) any more
correct or valid.

  It does however solve the problem of wanting the DLL to be in the /bin
directory, while still needing something to stand in its place in the /lib
directory so that the linker can find it without the compiler having to put
-L$prefix/bin in the specs.

  It's also used on Cygwin and MinGW to address library versioning: the actual
DLL has a numbered suffix to indicate version, but the import library is
unnumbered, so you can just say -lblah as usual and automatically link against
whatever the installed version of the DLL is without having to know the
version suffix and specify it in the -l option.  Ada doesn't need that, as it
happens, because it always generates the specfile to explicitly include the
version number of libgnat/libgnarl in the -l option, and doesn't try to keep
the shared library compatible across point releases of the compiler, but it's
how all the other runtimes work on Windows; they all put an import library in
/lib and the DLL itself into /bin.  Ada should work the same way, because
otherwise you either need to point your PATH into gcc's private dir at
runtime, or point your linker into /bin at linktime, neither of which are
entirely neat solutions.

cheers,
  DaveK



Re: [patch] Fix cygwin ada install [was Re: Yet another issue with gcc current trunk with ada on cygwin]

2012-01-09 Thread Dave Korn
On 17/12/2011 10:06, Christian Joensson wrote:

 I can add that I also, manually, copy the
 lto-plugin/.libs/cyglto_plugin-0.dll into $bindir too.

  Why?  It deliberately installs into libexecsubdir rather than bindir because
it's only ever invoked by the gcc driver, which passes the full explicit path
in the -plugin option on the command-line for ld to pass to dlopen(); it
shouldn't need to be found on $PATH at all if everything's working as intended.

cheers,
  DaveK



Re: [patch] Fix cygwin ada install [was Re: Yet another issue with gcc current trunk with ada on cygwin]

2012-01-09 Thread Eric Botcazou
   Sorry for the delay guys, I got rather busy over the holidays.  I see
 we're now discussing a patch for next stage 1.

No, not necessarily, the patch is specific to Ada on Windows so the risk is 
quite low.

   It does however solve the problem of wanting the DLL to be in the /bin
 directory, while still needing something to stand in its place in the /lib
 directory so that the linker can find it without the compiler having to put
 -L$prefix/bin in the specs.

This indeed sounds compelling enough.

   It's also used on Cygwin and MinGW to address library versioning: the
 actual DLL has a numbered suffix to indicate version, but the import
 library is unnumbered, so you can just say -lblah as usual and
 automatically link against whatever the installed version of the DLL is
 without having to know the version suffix and specify it in the -l option. 
 Ada doesn't need that, as it happens, because it always generates the
 specfile to explicitly include the version number of libgnat/libgnarl in
 the -l option, and doesn't try to keep the shared library compatible across
 point releases of the compiler, but it's how all the other runtimes work on
 Windows; they all put an import library in /lib and the DLL itself into
 /bin.  Ada should work the same way, because otherwise you either need to
 point your PATH into gcc's private dir at runtime, or point your linker
 into /bin at linktime, neither of which are entirely neat solutions.

If all the other runtimes do it, I think we should do it too.  Pacal, what do 
you think?

-- 
Eric Botcazou


Re: [patch] Fix cygwin ada install [was Re: Yet another issue with gcc current trunk with ada on cygwin]

2011-12-17 Thread Christian Joensson
On 8 December 2011 14:02, Dave Korn wrote:

    Hi again guys,

  After the previous patch, there's still another bug remaining in the Ada
 makefile, relating to how it builds and installs the gnat/gnarl shared 
 libraries.

  Windows doesn't have any concept of an rpath in executables, nor of
 LD_LIBRARY_PATH; all required DLLs must be found on the PATH when an exe is
 invoked.  The Ada shared libraries are currently installed into adaobj/ in the
 gcc private dir, which is not (and should not be) on users' PATHs, so the
 result is that executables compiled with the -shared binder option don't work.

  The attached patch fixes Windows DLLs to be installed into $bindir, and
 while it does that it also generates import libraries, which live in the
 private adaobj/ directory and serve for linking executables to the DLLs (it's
 actually preferred to link against an import library than directly against the
 DLL itself).  Finally it adjusts the name of the DLLs on Cygwin to match the
 cyg*.dll naming scheme used there to avoid clashes with MinGW DLLs.

 libada/ChangeLog:

        * Makefile.in (bindir): Import from autoconf and pass down to submake.

 gcc/ada/ChangeLog:

        * gcc-interface/Makefile.in (WIN_SO_PREFIX [windows targets]): New
        Windows-specific make variable.
        (WIN_SO_INSTALL_DIR [windows targets]): Likewise.
        (install-gnatlib): Respect the above during installation when set,
        and also install any windows import library that has been built.
        (gnatlib-shared-win32): Use WIN_SO_PREFIX to name output DLL and also
        build a corresponding import library.

  Built, tested, installed on i686-pc-cygwin and x86_64-unknown-linux-gnu, no
 regressions anywhere, verified that DLL install locations are corrected on
 windows and the .so install locations unchanged on Linux.  Ok?

I am happily using this patch and await this to be committed.

I can add that I also, manually, copy the
lto-plugin/.libs/cyglto_plugin-0.dll into $bindir too.

-- 
Cheers,

/ChJ


Re: [patch] Fix cygwin ada install [was Re: Yet another issue with gcc current trunk with ada on cygwin]

2011-12-17 Thread Eric Botcazou
 I am happily using this patch and await this to be committed.

Only after the import library issue is addressed.  What do the other libraries 
bundled with GCC do here?

-- 
Eric Botcazou


Re: [patch] Fix cygwin ada install [was Re: Yet another issue with gcc current trunk with ada on cygwin]

2011-12-09 Thread Eric Botcazou
   Windows doesn't have any concept of an rpath in executables, nor of
 LD_LIBRARY_PATH; all required DLLs must be found on the PATH when an exe is
 invoked.  The Ada shared libraries are currently installed into adaobj/ in
 the gcc private dir, which is not (and should not be) on users' PATHs, so
 the result is that executables compiled with the -shared binder option
 don't work.

You're right.

   The attached patch fixes Windows DLLs to be installed into $bindir, and
 while it does that it also generates import libraries, which live in the
 private adaobj/ directory and serve for linking executables to the DLLs
 (it's actually preferred to link against an import library than directly
 against the DLL itself).  Finally it adjusts the name of the DLLs on Cygwin
 to match the cyg*.dll naming scheme used there to avoid clashes with MinGW
 DLLs.

Could you elaborate on why linking against an import library is preferred over 
liking against the DLL directly?

-- 
Eric Botcazou


[patch] Fix cygwin ada install [was Re: Yet another issue with gcc current trunk with ada on cygwin]

2011-12-08 Thread Dave Korn

Hi again guys,

  After the previous patch, there's still another bug remaining in the Ada
makefile, relating to how it builds and installs the gnat/gnarl shared 
libraries.

  Windows doesn't have any concept of an rpath in executables, nor of
LD_LIBRARY_PATH; all required DLLs must be found on the PATH when an exe is
invoked.  The Ada shared libraries are currently installed into adaobj/ in the
gcc private dir, which is not (and should not be) on users' PATHs, so the
result is that executables compiled with the -shared binder option don't work.

  The attached patch fixes Windows DLLs to be installed into $bindir, and
while it does that it also generates import libraries, which live in the
private adaobj/ directory and serve for linking executables to the DLLs (it's
actually preferred to link against an import library than directly against the
DLL itself).  Finally it adjusts the name of the DLLs on Cygwin to match the
cyg*.dll naming scheme used there to avoid clashes with MinGW DLLs.

libada/ChangeLog:

* Makefile.in (bindir): Import from autoconf and pass down to submake.

gcc/ada/ChangeLog:

* gcc-interface/Makefile.in (WIN_SO_PREFIX [windows targets]): New
Windows-specific make variable.
(WIN_SO_INSTALL_DIR [windows targets]): Likewise.
(install-gnatlib): Respect the above during installation when set,
and also install any windows import library that has been built.
(gnatlib-shared-win32): Use WIN_SO_PREFIX to name output DLL and also
build a corresponding import library.

  Built, tested, installed on i686-pc-cygwin and x86_64-unknown-linux-gnu, no
regressions anywhere, verified that DLL install locations are corrected on
windows and the .so install locations unchanged on Linux.  Ok?

cheers,
  DaveK


Index: libada/Makefile.in
===
--- libada/Makefile.in	(revision 182075)
+++ libada/Makefile.in	(working copy)
@@ -33,6 +33,7 @@ MULTICLEAN = true
 SHELL = @SHELL@
 srcdir = @srcdir@
 libdir = @libdir@
+bindir = @bindir@
 build = @build@
 target = @target@
 prefix = @prefix@
@@ -83,6 +84,7 @@ LIBADA_FLAGS_TO_PASS = \
 TRACE=$(TRACE) \
 MULTISUBDIR=$(MULTISUBDIR) \
 libsubdir=$(libsubdir) \
+bindir=$(bindir) \
 objext=$(objext) \
 prefix=$(prefix) \
 exeext=.exeext.should.not.be.used  \
Index: gcc/ada/gcc-interface/Makefile.in
===
--- gcc/ada/gcc-interface/Makefile.in	(revision 182075)
+++ gcc/ada/gcc-interface/Makefile.in	(working copy)
@@ -1588,16 +1588,19 @@ ifeq ($(strip $(filter-out cygwin% mingw32% pe,$(o
   # the Cygwin port has always been a CygMing frankenhybrid and it is
   # a long-term project to disentangle them.
   ifeq ($(strip $(filter-out cygwin%,$(osys))),)
+WIN_SO_PREFIX=cyg
 LIBGNAT_TARGET_PAIRS = \
 s-memory.adbs-memory.adb \
 g-socthi.adsg-socthi.ads \
 g-socthi.adbg-socthi.adb
   else
+WIN_SO_PREFIX=lib
 LIBGNAT_TARGET_PAIRS = \
 s-memory.adbs-memory-mingw.adb \
 g-socthi.adsg-socthi-mingw.ads \
 g-socthi.adbg-socthi-mingw.adb
   endif
+  WIN_SO_INSTALL_DIR = $(bindir)
   LIBGNAT_TARGET_PAIRS += \
   a-dirval.adba-dirval-mingw.adb \
   a-excpol.adba-excpol-abort.adb \
@@ -2448,11 +2451,14 @@ install-gnatlib: ../stamp-gnatlib-$(RTSDIR)
 # for shared libraries on some targets, e.g. on HP-UX where the x
 # permission is required.
 # Also install the .dSYM directories if they exist (these directories
-# contain the debug information for the shared libraries on darwin)
+# contain the debug information for the shared libraries on darwin),
+# and the windows import libraries if they exist.
+	libpfx=$(if $(WIN_SO_PREFIX),$(WIN_SO_PREFIX),lib); \
+	librtlobjdir=$(if $(WIN_SO_INSTALL_DIR),$(WIN_SO_INSTALL_DIR),$(ADA_RTL_OBJ_DIR)); \
 	for file in gnat gnarl; do \
-	   if [ -f $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) ]; then \
-	  $(INSTALL) $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
-			 $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
+	   if [ -f $(RTSDIR)/$${libpfx}$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) ]; then \
+	  $(INSTALL) $(RTSDIR)/$${libpfx}$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
+			 $(DESTDIR)$${librtlobjdir}; \
 	   fi; \
 	   if [ -f $(RTSDIR)/lib$${file}$(soext) ]; then \
 	  $(LN_S) lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
@@ -2462,6 +2468,10 @@ install-gnatlib: ../stamp-gnatlib-$(RTSDIR)
 	  $(CP) -r $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext).dSYM \
 	$(DESTDIR)$(ADA_RTL_OBJ_DIR); \
 	   fi; \
+	   if [ -f $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext)$(arext) ]; then \
+	  $(INSTALL_DATA) $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext)$(arext) \
+			 $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
+	   fi; \
 	done
 # This copy must be done preserving the date on the original