On platform where the switch is allowed, the gcc driver, when called with -Gnnn (nnn is a non negative number) invokes the compiler (gnat1) with -G nnn. This patch skips the argument nnn after -G, so that it is not taken as a source file name.
Tested on x86_64-pc-linux-gnu, committed on trunk 2014-11-20 Vincent Celier <cel...@adacore.com> PR ada/47500 * back_end.adb (Scan_Back_End_Switches): Skip switch -G and its argument.
Index: back_end.adb =================================================================== --- back_end.adb (revision 217828) +++ back_end.adb (working copy) @@ -232,9 +232,10 @@ Last : constant Natural := Switch_Last (Switch_Chars); begin - -- Skip -o or internal GCC switches together with their argument + -- Skip -o, -G or internal GCC switches together with their argument. if Switch_Chars (First .. Last) = "o" + or else Switch_Chars (First .. Last) = "G" or else Is_Internal_GCC_Switch (Switch_Chars) then Next_Arg := Next_Arg + 1;