When "gnat link" is invoked and there are shared libraries, the link may
be incorrect on some platforms, such as Windows. This is fixed by this patch.

Tested on x86_64-pc-linux-gnu, committed on trunk

2014-06-11  Vincent Celier  <cel...@adacore.com>

        * gnatcmd.adb (Process_Link): Do not invoke gnatlink with
        -lgnarl or -lgnat.

Index: gnatcmd.adb
===================================================================
--- gnatcmd.adb (revision 211445)
+++ gnatcmd.adb (working copy)
@@ -1075,18 +1075,8 @@
 
       if Libraries_Present then
 
-         --  Add -L<lib_dir> -lgnarl -lgnat -Wl,-rpath,<lib_dir>
+         --  Add -Wl,-rpath,<lib_dir>
 
-         Last_Switches.Increment_Last;
-         Last_Switches.Table (Last_Switches.Last) :=
-           new String'("-L" & MLib.Utl.Lib_Directory);
-         Last_Switches.Increment_Last;
-         Last_Switches.Table (Last_Switches.Last) :=
-           new String'("-lgnarl");
-         Last_Switches.Increment_Last;
-         Last_Switches.Table (Last_Switches.Last) :=
-           new String'("-lgnat");
-
          --  If Path_Option is not null, create the switch ("-Wl,-rpath," or
          --  equivalent) with all the library dirs plus the standard GNAT
          --  library dir.

Reply via email to