re PR ada/85036 (--disable-bootstrap --enable-languages=ada[,c++] fails)
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 23 Mar 2018 23:12:49 +0000 (23:12 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Fri, 23 Mar 2018 23:12:49 +0000 (23:12 +0000)
PR ada/85036
* gnatlink.adb (Process_Args): Drop existing link switches if multiple
switches are passed for --LINK.

From-SVN: r258827

gcc/ada/ChangeLog
gcc/ada/gnatlink.adb

index cb071fe8665e6200e39fdd4775c0db3c3390497f..d75028d2fa484fb0fade6f77bc6f07ea6763f937 100644 (file)
@@ -1,3 +1,9 @@
+2018-03-23  Eric Botcazou  <ebotcazou@adacore.com>
+
+       PR ada/85036
+       * gnatlink.adb (Process_Args): Drop existing link switches if multiple
+       switches are passed for --LINK.
+
 2018-03-12  Eric Botcazou  <ebotcazou@adacore.com>
 
        PR ada/82813
index e28ba34c443c21f1a3609147846201ad00ac1d88..cea664bf75fcd5a970b9f1dbbb7cd8073162398c 100644 (file)
@@ -544,6 +544,11 @@ procedure Gnatlink is
                      end if;
 
                      --  The other arguments are passed as-is to the linker
+                     --  and override those coming from --GCC= if any.
+
+                     if L_Args.all'Last >= 2 then
+                        Gcc_Linker_Options.Set_Last (0);
+                     end if;
 
                      for J in 2 .. L_Args.all'Last loop
                         Gcc_Linker_Options.Increment_Last;