+2011-08-04 Pascal Obry <obry@adacore.com>
+
+ * adaint.c (__gnat_tmp_name): Use current process id to create temp
+ filenames, this ensures unicity of filenames across processes.
+
+2011-08-04 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * bindgen.adb (Gen_Finalize_Library_Ada): Rename generated routine
+ Raise_Controlled to Raise_From_Controlled_Operation. Update the
+ signature of Raise_From_Controlled_Operation by adding flag From_Abort.
+ Add False as the actual to From_Abort in the generated call to
+ Raise_From_Controlled_Operation.
+
+2011-08-04 Jerome Lambourg <lambourg@adacore.com>
+
+ * osint-c.ads, osint-c.adb (Set_Library_Info_Name): Move to declaration
+ so that the ali file name can be retrieved from outside of this package.
+ * back_end.ads, back_end.adb (Gen_Or_Update_Object_File): New method
+ doing nothing in the general case, but used to update the object file
+ timestamp if directly generated by the backend.
+ * gnat1drv.adb (Gnat1drv): Make sure the object file's timestamp is set
+ to a later time than the ali file one.
+
2011-08-04 Yannick Moy <moy@adacore.com>
* einfo.adb, einfo.ads (Formal_Proof_On): new flag set on subprogram
#elif defined (__MINGW32__)
{
char *pname;
+ char prefix[25];
/* tempnam tries to create a temporary file in directory pointed to by
TMP environment variable, in c:\temp if TMP is not set, and in
directory specified by P_tmpdir in stdio.h if c:\temp does not
exist. The filename will be created with the prefix "gnat-". */
- pname = (char *) _tempnam ("c:\\temp", "gnat-");
+ sprintf (prefix, "gnat-%d-", (int)getpid());
+ pname = (char *) _tempnam ("c:\\temp", prefix);
/* if pname is NULL, the file was not created properly, the disk is full
or there is no more free temporary files */
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
begin
Enumerate_Modes (Call_Back);
end Register_Back_End_Types;
+
+ -------------------------------
+ -- Gen_Or_Update_Object_File --
+ -------------------------------
+
+ procedure Gen_Or_Update_Object_File is
+ begin
+ null;
+ end Gen_Or_Update_Object_File;
+
end Back_End;
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- Any processed switches that influence the result of a compilation must
-- be added to the Compilation_Arguments table.
+ procedure Gen_Or_Update_Object_File;
+ -- Is used to generate the object file, or update it so that its timestamp
+ -- is updated.
+
end Back_End;
Set_String ("""__gnat_library_exception"");");
Write_Statement_Buffer;
- Set_String (" procedure Raise_Controlled ");
- Set_String ("(E : Ada.Exceptions.Exception_Occurrence);");
+ Set_String (" procedure Raise_From_Controlled_");
+ Set_String ("Operation ");
+ Set_String ("(X : Ada.Exceptions.Exception_Occurrence; ");
+ Set_String (" From_Abort : Boolean);");
Write_Statement_Buffer;
- Set_String (" pragma Import (Ada, Raise_Controlled, ");
+ Set_String (" pragma Import (Ada, Raise_From_");
+ Set_String ("Controlled_Operation, ");
Set_String ("""__gnat_raise_from_controlled_operation"");");
Write_Statement_Buffer;
WBI (" begin");
- WBI (" Raise_Controlled (LE);");
+ WBI (" Raise_From_Controlled_Operation (LE, False);");
WBI (" end;");
-- VM-specific code, use regular Ada to produce the desired behavior
Write_ALI (Object => (Back_End_Mode = Generate_Object));
+ if not Compilation_Errors then
+ -- In case of ada backends, we need to make sure that the generated
+ -- object file has a timestamp greater than the ALI file.
+ -- We do this to make gnatmake happy when checking the ALI and obj
+ -- timestamps, where it expects the object file being written after
+ -- the ali file.
+ -- Gnatmake's assumption is true for gcc platforms where the gcc
+ -- wrapper needs to call the assembler after calling gnat1, but is
+ -- not true for ada backends, where the object files are created
+ -- directly by gnat1 (so are created before the ali file).
+ Back_End.Gen_Or_Update_Object_File;
+ end if;
+
-- Generate ASIS tree after writing the ALI file, since in ASIS mode,
-- Write_ALI may in fact result in further tree decoration from the
-- original tree file. Note that we dump the tree just before generating
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2011, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- output file and Suffix is the desired suffix (dg/rep/xxx for debug/
-- repinfo/list file where xxx is specified extension.
- procedure Set_Library_Info_Name;
- -- Sets a default ALI file name from the main compiler source name.
- -- This is used by Create_Output_Library_Info, and by the version of
- -- Read_Library_Info that takes a default file name. The name is in
- -- Name_Buffer (with length in Name_Len) on return from the call.
-
----------------------
-- Close_Debug_File --
----------------------
-- --
-- S p e c --
-- --
--- Copyright (C) 2001-2008, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2011, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- information file for the main source file being compiled. See section
-- above for a discussion of how library information files are stored.
+ procedure Set_Library_Info_Name;
+ -- Sets a default ALI file name from the main compiler source name.
+ -- This is used by Create_Output_Library_Info, and by the version of
+ -- Read_Library_Info that takes a default file name. The name is in
+ -- Name_Buffer (with length in Name_Len) on return from the call.
+
procedure Create_Output_Library_Info;
-- Creates the output library information file for the source file which
-- is currently being compiled (i.e. the file which was most recently