OSDN Git Service

PR bootstrap/11932
[pf3gnuchains/gcc-fork.git] / gcc / ada / s-stalib.adb
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                         GNAT COMPILER COMPONENTS                         --
4 --                                                                          --
5 --              S Y S T E M . S T A N D A R D _ L I B R A R Y               --
6 --                                                                          --
7 --                                 B o d y                                  --
8 --                                                                          --
9 --          Copyright (C) 1995-2004 Free Software Foundation, Inc.          --
10 --                                                                          --
11 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
12 -- terms of the  GNU General Public License as published  by the Free Soft- --
13 -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
14 -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
17 -- for  more details.  You should have  received  a copy of the GNU General --
18 -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
19 -- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
20 -- MA 02111-1307, USA.                                                      --
21 --                                                                          --
22 -- As a special exception,  if other files  instantiate  generics from this --
23 -- unit, or you link  this unit with other files  to produce an executable, --
24 -- this  unit  does not  by itself cause  the resulting  executable  to  be --
25 -- covered  by the  GNU  General  Public  License.  This exception does not --
26 -- however invalidate  any other reasons why  the executable file  might be --
27 -- covered by the  GNU Public License.                                      --
28 --                                                                          --
29 -- GNAT was originally developed  by the GNAT team at  New York University. --
30 -- Extensive contributions were provided by Ada Core Technologies Inc.      --
31 --                                                                          --
32 ------------------------------------------------------------------------------
33
34 --  The purpose of this body is simply to ensure that the two with'ed units
35 --  are properly included in the link. They are not with'ed from the spec
36 --  of System.Standard_Library, since this would cause order of elaboration
37 --  problems (Elaborate_Body would have the same problem).
38
39 pragma Warnings (Off);
40 --  Kill warnings from unused withs
41
42 pragma Polling (Off);
43 --  We must turn polling off for this unit, because otherwise we get
44 --  elaboration circularities with Ada.Exceptions if polling is on.
45
46 with System.Soft_Links;
47 --  Referenced directly from generated code using external symbols so it
48 --  must always be present in a build, even if no unit has a direct with
49 --  of this unit. Also referenced from exception handling routines.
50 --  This is needed for programs that don't use exceptions explicitely but
51 --  direct calls to Ada.Exceptions are generated by gigi (for example,
52 --  by calling __gnat_raise_constraint_error directly).
53
54 with System.Memory;
55 --  Referenced directly from generated code using external symbols, so it
56 --  must always be present in a build, even if no unit has a direct with
57 --  of this unit.
58
59 package body System.Standard_Library is
60
61    Runtime_Finalized : Boolean := False;
62    --  Set to True when adafinal is called. Used to ensure that subsequent
63    --  calls to adafinal after the first have no effect.
64
65    Inside_Elab_Final_Code : Integer := 0;
66    pragma Export (C, Inside_Elab_Final_Code, "__gnat_inside_elab_final_code");
67    --  ???This variable is obsolete since 2001-08-29 but cannot be removed
68    --  ???right away due to the bootstrap problems
69
70    --------------------------
71    -- Abort_Undefer_Direct --
72    --------------------------
73
74    procedure Abort_Undefer_Direct is
75    begin
76       System.Soft_Links.Abort_Undefer.all;
77    end Abort_Undefer_Direct;
78
79    --------------
80    -- Adafinal --
81    --------------
82
83    procedure Adafinal is
84    begin
85       if not Runtime_Finalized then
86          Runtime_Finalized := True;
87          System.Soft_Links.Adafinal.all;
88       end if;
89    end Adafinal;
90
91    -----------------
92    -- Break_Start --
93    -----------------
94
95    procedure Break_Start;
96    pragma Export (C, Break_Start, "__gnat_break_start");
97    --  This is a dummy procedure that is called at the start of execution.
98    --  Its sole purpose is to provide a well defined point for the placement
99    --  of a main program breakpoint.
100
101    procedure Break_Start is
102    begin
103       null;
104    end Break_Start;
105
106 end System.Standard_Library;