diff options
author | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2017-11-19 22:36:25 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2017-11-19 22:36:25 +0000 |
commit | 3b36246bc2121221e9ef15f29f03a38c0811b7db (patch) | |
tree | 7b765c9944291089662c565f40e06f0beedeaf18 /gcc/ada/gnatlink.adb | |
parent | 290295fdf8749df0ab2f69d7e95198d4511cc1d8 (diff) | |
download | gcc-3b36246bc2121221e9ef15f29f03a38c0811b7db.zip gcc-3b36246bc2121221e9ef15f29f03a38c0811b7db.tar.gz gcc-3b36246bc2121221e9ef15f29f03a38c0811b7db.tar.bz2 |
re PR ada/83016 (gnat1: warning: command line option ‘-nostdinc++’ is valid for C++/ObjC++ but not for Ada)
PR ada/83016
* gnatlink.adb (Process_Args): Accept multiple switches for --LINK.
(Usage): Adjust.
* gcc-interface/Makefile.in (GCC_LINK): Remove $(ADA_INCLUDES).
(common-tools): Pass $(CC) as --GCC= and $(GCC_LINK) as --LINK= in
the invocations of $(GNATLINK).
(../../gnatdll$(exeext)): Likewise.
(../../vxaddr2line$(exeext)): Likewise.
(gnatmake-re): Likewise.
(gnatlink-re): Likewise.
From-SVN: r254940
Diffstat (limited to 'gcc/ada/gnatlink.adb')
-rw-r--r-- | gcc/ada/gnatlink.adb | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/gcc/ada/gnatlink.adb b/gcc/ada/gnatlink.adb index 5e290eb..4b7f21d 100644 --- a/gcc/ada/gnatlink.adb +++ b/gcc/ada/gnatlink.adb @@ -529,15 +529,35 @@ procedure Gnatlink is Exit_With_Error ("Missing argument for --LINK="); end if; - Linker_Path := - System.OS_Lib.Locate_Exec_On_Path (Arg (8 .. Arg'Last)); + declare + L_Args : constant Argument_List_Access := + Argument_String_To_List (Arg (8 .. Arg'Last)); + begin + -- The linker program is the first argument + + Linker_Path := + System.OS_Lib.Locate_Exec_On_Path (L_Args.all (1).all); + + if Linker_Path = null then + Exit_With_Error + ("Could not locate linker: " & L_Args.all (1).all); + end if; + + -- The other arguments are passed as-is to the linker + + for J in 2 .. L_Args.all'Last loop + Gcc_Linker_Options.Increment_Last; + Gcc_Linker_Options.Table + (Gcc_Linker_Options.Last) := + new String'(L_Args.all (J).all); + end loop; + end; - if Linker_Path = null then - Exit_With_Error - ("Could not locate linker: " & Arg (8 .. Arg'Last)); + elsif Arg'Length >= 6 and then Arg (1 .. 6) = "--GCC=" then + if Arg'Length = 6 then + Exit_With_Error ("Missing argument for --GCC="); end if; - elsif Arg'Length > 6 and then Arg (1 .. 6) = "--GCC=" then declare Program_Args : constant Argument_List_Access := Argument_String_To_List @@ -1413,8 +1433,8 @@ procedure Gnatlink is Write_Line (" -M Create map file mainprog.map"); end if; - Write_Line (" --GCC=comp Use comp as the compiler"); - Write_Line (" --LINK=nam Use 'nam' for the linking rather than 'gcc'"); + Write_Line (" --GCC=comp Use 'comp' as the compiler rather than 'gcc'"); + Write_Line (" --LINK=lnk Use 'lnk' as the linker rather than 'gcc'"); Write_Eol; Write_Line (" [non-Ada-objects] list of non Ada object files"); Write_Line (" [linker-options] other options for the linker"); |