~ubuntu-branches/debian/sid/gcc-4.8/sid

« back to all changes in this revision

Viewing changes to .svn/pristine/be/be2640cb3a47b33232958a5e9651f46f658f67c0.svn-base

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-12-19 19:48:34 UTC
  • Revision ID: package-import@ubuntu.com-20141219194834-4dz1q7rrn5pad823
Tags: 4.8.4-1
* GCC 4.8.4 release.
  - Fix PR target/61407 (darwin), PR middle-end/58624 (ice),
    PR sanitizer/64265 (wrong code).
* Require recent binutils to pass go test failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Index: b/src/gcc/ada/s-osinte-kfreebsd-gnu.adb
 
2
===================================================================
 
3
--- /dev/null
 
4
+++ b/src/gcc/ada/s-osinte-kfreebsd-gnu.adb
 
5
@@ -0,0 +1,158 @@
 
6
+------------------------------------------------------------------------------
 
7
+--                                                                          --
 
8
+--                 GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS                 --
 
9
+--                                                                          --
 
10
+--                   S Y S T E M . O S _ I N T E R F A C E                  --
 
11
+--                                                                          --
 
12
+--                                   B o d y                                --
 
13
+--                                                                          --
 
14
+--             Copyright (C) 1991-1994, Florida State University            --
 
15
+--                     Copyright (C) 1995-2006, AdaCore                     --
 
16
+--                                                                          --
 
17
+-- GNARL is free software; you can  redistribute it  and/or modify it under --
 
18
+-- terms of the  GNU General Public License as published  by the Free Soft- --
 
19
+-- ware  Foundation;  either version 2,  or (at your option) any later ver- --
 
20
+-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
 
21
+-- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
 
22
+-- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
 
23
+-- for  more details.  You should have  received  a copy of the GNU General --
 
24
+-- Public License  distributed with GNARL; see file COPYING.  If not, write --
 
25
+-- to  the  Free Software Foundation,  51  Franklin  Street,  Fifth  Floor, --
 
26
+-- Boston, MA 02110-1301, USA.                                              --
 
27
+--                                                                          --
 
28
+-- As a special exception,  if other files  instantiate  generics from this --
 
29
+-- unit, or you link  this unit with other files  to produce an executable, --
 
30
+-- this  unit  does not  by itself cause  the resulting  executable  to  be --
 
31
+-- covered  by the  GNU  General  Public  License.  This exception does not --
 
32
+-- however invalidate  any other reasons why  the executable file  might be --
 
33
+-- covered by the  GNU Public License.                                      --
 
34
+--                                                                          --
 
35
+-- GNARL was developed by the GNARL team at Florida State University.       --
 
36
+-- Extensive contributions were provided by Ada Core Technologies, Inc.     --
 
37
+--                                                                          --
 
38
+------------------------------------------------------------------------------
 
39
+
 
40
+--  This is the GNU/kFreeBSD version of this package.
 
41
+
 
42
+pragma Polling (Off);
 
43
+--  Turn off polling, we do not want ATC polling to take place during
 
44
+--  tasking operations. It causes infinite loops and other problems.
 
45
+
 
46
+--  This package encapsulates all direct interfaces to OS services
 
47
+--  that are needed by children of System.
 
48
+
 
49
+package body System.OS_Interface is
 
50
+
 
51
+   --------------------
 
52
+   -- Get_Stack_Base --
 
53
+   --------------------
 
54
+
 
55
+   function Get_Stack_Base (thread : pthread_t) return Address is
 
56
+      pragma Warnings (Off, thread);
 
57
+
 
58
+   begin
 
59
+      return Null_Address;
 
60
+   end Get_Stack_Base;
 
61
+
 
62
+   ------------------
 
63
+   -- pthread_init --
 
64
+   ------------------
 
65
+
 
66
+   procedure pthread_init is
 
67
+   begin
 
68
+      null;
 
69
+   end pthread_init;
 
70
+
 
71
+   -----------------------------------
 
72
+   -- pthread_mutexattr_setprotocol --
 
73
+   -----------------------------------
 
74
+
 
75
+   function pthread_mutexattr_setprotocol
 
76
+     (attr     : access pthread_mutexattr_t;
 
77
+      protocol : int) return int is
 
78
+      pragma Unreferenced (attr, protocol);
 
79
+   begin
 
80
+      return 0;
 
81
+   end pthread_mutexattr_setprotocol;
 
82
+
 
83
+   -----------------------------------
 
84
+   -- pthread_mutexattr_getprotocol --
 
85
+   -----------------------------------
 
86
+
 
87
+   function pthread_mutexattr_getprotocol
 
88
+     (attr     : access pthread_mutexattr_t;
 
89
+      protocol : access int) return int is
 
90
+      pragma Unreferenced (attr, protocol);
 
91
+   begin
 
92
+      return 0;
 
93
+   end pthread_mutexattr_getprotocol;
 
94
+
 
95
+   --------------------------------------
 
96
+   -- pthread_mutexattr_setprioceiling --
 
97
+   --------------------------------------
 
98
+
 
99
+   function pthread_mutexattr_setprioceiling
 
100
+     (attr     : access pthread_mutexattr_t;
 
101
+      prioceiling : int) return int is
 
102
+      pragma Unreferenced (attr, prioceiling);
 
103
+   begin
 
104
+      return 0;
 
105
+   end pthread_mutexattr_setprioceiling;
 
106
+
 
107
+   --------------------------------------
 
108
+   -- pthread_mutexattr_getprioceiling --
 
109
+   --------------------------------------
 
110
+
 
111
+   function pthread_mutexattr_getprioceiling
 
112
+     (attr     : access pthread_mutexattr_t;
 
113
+      prioceiling : access int) return int is
 
114
+      pragma Unreferenced (attr, prioceiling);
 
115
+   begin
 
116
+      return 0;
 
117
+   end pthread_mutexattr_getprioceiling;
 
118
+
 
119
+   -----------------
 
120
+   -- To_Duration --
 
121
+   -----------------
 
122
+
 
123
+   function To_Duration (TS : timespec) return Duration is
 
124
+   begin
 
125
+      return Duration (TS.tv_sec) + Duration (TS.tv_nsec) / 10#1#E9;
 
126
+   end To_Duration;
 
127
+
 
128
+   ------------------------
 
129
+   -- To_Target_Priority --
 
130
+   ------------------------
 
131
+
 
132
+   function To_Target_Priority
 
133
+     (Prio : System.Any_Priority) return Interfaces.C.int
 
134
+   is
 
135
+   begin
 
136
+      return Interfaces.C.int (Prio);
 
137
+   end To_Target_Priority;
 
138
+
 
139
+   -----------------
 
140
+   -- To_Timespec --
 
141
+   -----------------
 
142
+
 
143
+   function To_Timespec (D : Duration) return timespec is
 
144
+      S : time_t;
 
145
+      F : Duration;
 
146
+
 
147
+   begin
 
148
+      S := time_t (Long_Long_Integer (D));
 
149
+      F := D - Duration (S);
 
150
+
 
151
+      --  If F has negative value due to a round-up, adjust for positive F
 
152
+      --  value.
 
153
+
 
154
+      if F < 0.0 then
 
155
+         S := S - 1;
 
156
+         F := F + 1.0;
 
157
+      end if;
 
158
+
 
159
+      return timespec'(tv_sec => S,
 
160
+                       tv_nsec => long (Long_Long_Integer (F * 10#1#E9)));
 
161
+   end To_Timespec;
 
162
+
 
163
+end System.OS_Interface;
 
164
Index: b/src/gcc/ada/gcc-interface/Makefile.in
 
165
===================================================================
 
166
--- a/src/gcc/ada/gcc-interface/Makefile.in
 
167
+++ b/src/gcc/ada/gcc-interface/Makefile.in
 
168
@@ -1097,7 +1097,7 @@
 
169
   a-numaux.ads<a-numaux-x86.ads \
 
170
   s-inmaop.adb<s-inmaop-posix.adb \
 
171
   s-intman.adb<s-intman-posix.adb \
 
172
-  s-osinte.adb<s-osinte-posix.adb \
 
173
+  s-osinte.adb<s-osinte-kfreebsd-gnu.adb \
 
174
   s-osinte.ads<s-osinte-kfreebsd-gnu.ads \
 
175
   s-osprim.adb<s-osprim-posix.adb \
 
176
   s-taprop.adb<s-taprop-posix.adb \
 
177
@@ -1123,7 +1123,7 @@
 
178
   a-numaux.ads<a-numaux-x86.ads \
 
179
   s-inmaop.adb<s-inmaop-posix.adb \
 
180
   s-intman.adb<s-intman-posix.adb \
 
181
-  s-osinte.adb<s-osinte-posix.adb \
 
182
+  s-osinte.adb<s-osinte-kfreebsd-gnu.adb \
 
183
   s-osinte.ads<s-osinte-kfreebsd-gnu.ads \
 
184
   s-osprim.adb<s-osprim-posix.adb \
 
185
   s-taprop.adb<s-taprop-posix.adb \
 
186
Index: b/src/gcc/ada/s-osinte-kfreebsd-gnu.ads
 
187
===================================================================
 
188
--- a/src/gcc/ada/s-osinte-kfreebsd-gnu.ads
 
189
+++ b/src/gcc/ada/s-osinte-kfreebsd-gnu.ads
 
190
@@ -47,6 +47,7 @@
 
191
    pragma Preelaborate;
 
192
 
 
193
    pragma Linker_Options ("-lpthread");
 
194
+   pragma Linker_Options ("-lrt");
 
195
 
 
196
    subtype int            is Interfaces.C.int;
 
197
    subtype char           is Interfaces.C.char;
 
198
@@ -431,31 +432,25 @@
 
199
    PTHREAD_PRIO_PROTECT : constant := 2;
 
200
    PTHREAD_PRIO_INHERIT : constant := 1;
 
201
 
 
202
+   --  GNU/kFreeBSD does not support Thread Priority Protection or Thread
 
203
+   --  Priority Inheritance and lacks some pthread_mutexattr_* functions.
 
204
+   --  Replace them with dummy versions.
 
205
+
 
206
    function pthread_mutexattr_setprotocol
 
207
      (attr     : access pthread_mutexattr_t;
 
208
       protocol : int) return int;
 
209
-   pragma Import
 
210
-      (C, pthread_mutexattr_setprotocol, "pthread_mutexattr_setprotocol");
 
211
 
 
212
    function pthread_mutexattr_getprotocol
 
213
      (attr     : access pthread_mutexattr_t;
 
214
       protocol : access int) return int;
 
215
-   pragma Import
 
216
-     (C, pthread_mutexattr_getprotocol, "pthread_mutexattr_getprotocol");
 
217
 
 
218
    function pthread_mutexattr_setprioceiling
 
219
      (attr     : access pthread_mutexattr_t;
 
220
       prioceiling : int) return int;
 
221
-   pragma Import
 
222
-     (C, pthread_mutexattr_setprioceiling,
 
223
-      "pthread_mutexattr_setprioceiling");
 
224
 
 
225
    function pthread_mutexattr_getprioceiling
 
226
      (attr     : access pthread_mutexattr_t;
 
227
       prioceiling : access int) return int;
 
228
-   pragma Import
 
229
-     (C, pthread_mutexattr_getprioceiling,
 
230
-      "pthread_mutexattr_getprioceiling");
 
231
 
 
232
    type struct_sched_param is record
 
233
       sched_priority : int;  --  scheduling priority