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 cb071fe..d75028d 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 e28ba34..cea664b 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;