diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-30 10:07:32 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-30 10:07:32 +0000 |
commit | 9cdffbc8e4a21e2ebd91c33264a250b3d0328129 (patch) | |
tree | 7bec3cf8139da8c3fc9ab89202f6b0894c50fe0e /gcc/ada/gnatlink.adb | |
parent | 92d7a451bc1093930f14896b59bf02d61843d5b6 (diff) | |
download | gcc-9cdffbc8e4a21e2ebd91c33264a250b3d0328129.tar.gz |
2009-11-30 Thomas Quinot <quinot@adacore.com>
* s-crtl.ads, g-stseme.adb, s-fileio.adb (System.CRTL.strerror): Change
return type to Interfaces.C.Strings.chars_ptr to eliminate need for
dubious unchecked conversion at call sites.
* s-errrep.adb, s-errrep.ads, Makefile.rtl (System.Error_Reporting):
Remove obsolete, unused runtime unit.
* gcc-interface/Make-lang.in: Update dependencies.
* gcc-interface/Makefile.in: Remove VMS specialization of s-crtl, not
required anymore.
2009-11-30 Vincent Celier <celier@adacore.com>
* gnatlink.adb: Delete an eventual existing executable file, in case it
is a symbolic link, to avoid modifying the target of the symbolic link.
2009-11-30 Bob Duff <duff@adacore.com>
* socket.c: Add accessor functions for struct servent.
* g-sothco.ads (Servent): Declare interfaces to C accessor functions
for struct servent.
* g-socket.adb (To_Service_Entry): Use accessor functions for struct
servent.
2009-11-30 Robert Dewar <dewar@adacore.com>
* g-arrspl.adb: Minor reformatting
* g-dyntab.adb: Add missing pragma Compiler_Unit
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154769 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/gnatlink.adb')
-rw-r--r-- | gcc/ada/gnatlink.adb | 73 |
1 files changed, 32 insertions, 41 deletions
diff --git a/gcc/ada/gnatlink.adb b/gcc/ada/gnatlink.adb index 0e4618f3d64..3f8c540d1d5 100644 --- a/gcc/ada/gnatlink.adb +++ b/gcc/ada/gnatlink.adb @@ -439,34 +439,14 @@ procedure Gnatlink is Compile_Bind_File := False; when 'o' => - if VM_Target = CLI_Target then - Linker_Options.Increment_Last; - Linker_Options.Table (Linker_Options.Last) := - new String'("/QUIET"); - - else - Linker_Options.Increment_Last; - Linker_Options.Table (Linker_Options.Last) := - new String'(Arg); - end if; - Next_Arg := Next_Arg + 1; if Next_Arg > Argument_Count then Exit_With_Error ("Missing argument for -o"); end if; - if VM_Target = CLI_Target then - Output_File_Name := - new String'("/OUTPUT=" & Argument (Next_Arg)); - else - Output_File_Name := - new String'(Argument (Next_Arg)); - end if; - - Linker_Options.Increment_Last; - Linker_Options.Table (Linker_Options.Last) := - Output_File_Name; + Output_File_Name := + new String'(Executable_Name (Argument (Next_Arg))); when 'R' => Opt.Run_Path_Option := False; @@ -1728,33 +1708,44 @@ begin Output_File_Name := new String'(Base_Name (Ali_File_Name.all) & Get_Target_Debuggable_Suffix.all); + end if; - if VM_Target = CLI_Target then - Linker_Options.Increment_Last; - Linker_Options.Table (Linker_Options.Last) := new String'("/QUIET"); + if VM_Target = CLI_Target then + Linker_Options.Increment_Last; + Linker_Options.Table (Linker_Options.Last) := new String'("/QUIET"); - Linker_Options.Increment_Last; - Linker_Options.Table (Linker_Options.Last) := new String'("/DEBUG"); + Linker_Options.Increment_Last; + Linker_Options.Table (Linker_Options.Last) := new String'("/DEBUG"); - Linker_Options.Increment_Last; - Linker_Options.Table (Linker_Options.Last) := - new String'("/OUTPUT=" & Output_File_Name.all); + Linker_Options.Increment_Last; + Linker_Options.Table (Linker_Options.Last) := + new String'("/OUTPUT=" & Output_File_Name.all); - elsif RTX_RTSS_Kernel_Module_On_Target then - Linker_Options.Increment_Last; - Linker_Options.Table (Linker_Options.Last) := - new String'("/OUT:" & Output_File_Name.all); + elsif RTX_RTSS_Kernel_Module_On_Target then + Linker_Options.Increment_Last; + Linker_Options.Table (Linker_Options.Last) := + new String'("/OUT:" & Output_File_Name.all); - else - Linker_Options.Increment_Last; - Linker_Options.Table (Linker_Options.Last) := new String'("-o"); + else + Linker_Options.Increment_Last; + Linker_Options.Table (Linker_Options.Last) := new String'("-o"); - Linker_Options.Increment_Last; - Linker_Options.Table (Linker_Options.Last) := - new String'(Output_File_Name.all); - end if; + Linker_Options.Increment_Last; + Linker_Options.Table (Linker_Options.Last) := + new String'(Output_File_Name.all); end if; + -- Delete existing executable, in case it is a symbolic link, to avoid + -- modifying the target of the symbolic link. + + declare + Dummy : Boolean; + pragma Unreferenced (Dummy); + + begin + Delete_File (Output_File_Name.all, Dummy); + end; + -- Warn if main program is called "test", as that may be a built-in command -- on Unix. On non-Unix systems executables have a suffix, so the warning -- will not appear. However, do not warn in the case of a cross compiler. |