3
2011-10-12 Mikael Pettersson <mikpe@it.uu.se>
6
* gcc-interface/Makefile.in: Add support for m68k-linux.
7
* system-linux-m68k.ads: New file based on system-linux-ppc.ads
8
and system-vxworks-m68k.ads.
9
* s-memory.adb (Gnat_Malloc): New wrapper around Alloc, returning
10
the memory address as a pointer not an integer.
11
Add Gnat_Malloc -> __gnat_malloc export.
12
* s-memory.ads: Remove Alloc -> __gnat_malloc export.
14
Index: gcc-4.6-4.6.3/src/gcc/ada/gcc-interface/Makefile.in
15
===================================================================
16
--- gcc-4.6-4.6.3.orig/src/gcc/ada/gcc-interface/Makefile.in 2012-03-04 16:06:01.000000000 +0000
17
+++ gcc-4.6-4.6.3/src/gcc/ada/gcc-interface/Makefile.in 2012-03-04 16:06:49.000000000 +0000
18
@@ -1871,6 +1871,34 @@
19
LIBRARY_VERSION := $(LIB_VERSION)
22
+ifeq ($(strip $(filter-out m68k% linux%,$(arch) $(osys))),)
23
+ LIBGNAT_TARGET_PAIRS = \
24
+ a-intnam.ads<a-intnam-linux.ads \
25
+ s-inmaop.adb<s-inmaop-posix.adb \
26
+ s-intman.adb<s-intman-posix.adb \
27
+ s-linux.ads<s-linux.ads \
28
+ s-osinte.adb<s-osinte-posix.adb \
29
+ s-osinte.ads<s-osinte-linux.ads \
30
+ s-osprim.adb<s-osprim-posix.adb \
31
+ s-taprop.adb<s-taprop-linux.adb \
32
+ s-tasinf.ads<s-tasinf-linux.ads \
33
+ s-tasinf.adb<s-tasinf-linux.adb \
34
+ s-taspri.ads<s-taspri-posix-noaltstack.ads \
35
+ s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
36
+ system.ads<system-linux-m68k.ads
38
+ TOOLS_TARGET_PAIRS = \
39
+ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
40
+ indepsw.adb<indepsw-gnu.adb
42
+ EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
44
+ THREADSLIB = -lpthread
45
+ GNATLIB_SHARED = gnatlib-shared-dual
47
+ LIBRARY_VERSION := $(LIB_VERSION)
50
ifeq ($(strip $(filter-out sparc% linux%,$(arch) $(osys))),)
51
LIBGNAT_TARGET_PAIRS_COMMON = \
52
a-intnam.ads<a-intnam-linux.ads \
53
Index: gcc-4.6-4.6.3/src/gcc/ada/s-memory.adb
54
===================================================================
55
--- gcc-4.6-4.6.3.orig/src/gcc/ada/s-memory.adb 2012-03-04 16:06:01.000000000 +0000
56
+++ gcc-4.6-4.6.3/src/gcc/ada/s-memory.adb 2012-03-04 16:06:49.000000000 +0000
58
with System.Soft_Links;
59
with System.Parameters;
61
+with Ada.Unchecked_Conversion;
63
package body System.Memory is
69
+ type Char_Ptr is access all Character;
70
+ pragma Convention (C, Char_Ptr);
71
+ pragma No_Strict_Aliasing (Char_Ptr);
73
+ function To_Char_Ptr is
74
+ new Ada.Unchecked_Conversion (System.Address, Char_Ptr);
76
+ -- The function exported as __gnat_malloc MUST return a pointer type.
77
+ function Gnat_Malloc (Size : size_t) return Char_Ptr;
78
+ pragma Export (C, Gnat_Malloc, "__gnat_malloc");
80
+ function Gnat_Malloc (Size : size_t) return Char_Ptr is
82
+ return To_Char_Ptr (Alloc (Size));
88
Index: gcc-4.6-4.6.3/src/gcc/ada/s-memory.ads
89
===================================================================
90
--- gcc-4.6-4.6.3.orig/src/gcc/ada/s-memory.ads 2012-03-04 16:06:01.000000000 +0000
91
+++ gcc-4.6-4.6.3/src/gcc/ada/s-memory.ads 2012-03-04 16:06:49.000000000 +0000
94
-- The following names are used from the generated compiler code
96
- pragma Export (C, Alloc, "__gnat_malloc");
97
pragma Export (C, Free, "__gnat_free");
98
pragma Export (C, Realloc, "__gnat_realloc");
100
Index: gcc-4.6-4.6.3/src/gcc/ada/system-linux-m68k.ads
101
===================================================================
102
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
103
+++ gcc-4.6-4.6.3/src/gcc/ada/system-linux-m68k.ads 2012-03-04 16:06:49.000000000 +0000
105
+------------------------------------------------------------------------------
107
+-- GNAT RUN-TIME COMPONENTS --
112
+-- (GNU-Linux/M68K Version) --
114
+-- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
116
+-- This specification is derived from the Ada Reference Manual for use with --
117
+-- GNAT. The copyright notice above, and the license provisions that follow --
118
+-- apply solely to the contents of the part following the private keyword. --
120
+-- GNAT is free software; you can redistribute it and/or modify it under --
121
+-- terms of the GNU General Public License as published by the Free Soft- --
122
+-- ware Foundation; either version 3, or (at your option) any later ver- --
123
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
124
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
125
+-- or FITNESS FOR A PARTICULAR PURPOSE. --
127
+-- As a special exception under Section 7 of GPL version 3, you are granted --
128
+-- additional permissions described in the GCC Runtime Library Exception, --
129
+-- version 3.1, as published by the Free Software Foundation. --
131
+-- You should have received a copy of the GNU General Public License and --
132
+-- a copy of the GCC Runtime Library Exception along with this program; --
133
+-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
134
+-- <http://www.gnu.org/licenses/>. --
136
+-- GNAT was originally developed by the GNAT team at New York University. --
137
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
139
+------------------------------------------------------------------------------
143
+ -- Note that we take advantage of the implementation permission to make
144
+ -- this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada
145
+ -- 2005, this is Pure in any case (AI-362).
147
+ type Name is (SYSTEM_NAME_GNAT);
148
+ System_Name : constant Name := SYSTEM_NAME_GNAT;
150
+ -- System-Dependent Named Numbers
152
+ Min_Int : constant := Long_Long_Integer'First;
153
+ Max_Int : constant := Long_Long_Integer'Last;
155
+ Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size;
156
+ Max_Nonbinary_Modulus : constant := 2 ** Integer'Size - 1;
158
+ Max_Base_Digits : constant := Long_Long_Float'Digits;
159
+ Max_Digits : constant := Long_Long_Float'Digits;
161
+ Max_Mantissa : constant := 63;
162
+ Fine_Delta : constant := 2.0 ** (-Max_Mantissa);
164
+ Tick : constant := 0.000_001;
166
+ -- Storage-related Declarations
168
+ type Address is private;
169
+ pragma Preelaborable_Initialization (Address);
170
+ Null_Address : constant Address;
172
+ Storage_Unit : constant := 8;
173
+ Word_Size : constant := 32;
174
+ Memory_Size : constant := 2 ** 32;
176
+ -- Address comparison
178
+ function "<" (Left, Right : Address) return Boolean;
179
+ function "<=" (Left, Right : Address) return Boolean;
180
+ function ">" (Left, Right : Address) return Boolean;
181
+ function ">=" (Left, Right : Address) return Boolean;
182
+ function "=" (Left, Right : Address) return Boolean;
184
+ pragma Import (Intrinsic, "<");
185
+ pragma Import (Intrinsic, "<=");
186
+ pragma Import (Intrinsic, ">");
187
+ pragma Import (Intrinsic, ">=");
188
+ pragma Import (Intrinsic, "=");
190
+ -- Other System-Dependent Declarations
192
+ type Bit_Order is (High_Order_First, Low_Order_First);
193
+ Default_Bit_Order : constant Bit_Order := High_Order_First;
194
+ pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning
196
+ -- Priority-related Declarations (RM D.1)
198
+ -- 0 .. 98 corresponds to the system priority range 1 .. 99.
200
+ -- If the scheduling policy is SCHED_FIFO or SCHED_RR the runtime makes use
201
+ -- of the entire range provided by the system.
203
+ -- If the scheduling policy is SCHED_OTHER the only valid system priority
204
+ -- is 1 and other values are simply ignored.
206
+ Max_Priority : constant Positive := 97;
207
+ Max_Interrupt_Priority : constant Positive := 98;
209
+ subtype Any_Priority is Integer range 0 .. 98;
210
+ subtype Priority is Any_Priority range 0 .. 97;
211
+ subtype Interrupt_Priority is Any_Priority range 98 .. 98;
213
+ Default_Priority : constant Priority := 48;
217
+ type Address is mod Memory_Size;
218
+ Null_Address : constant Address := 0;
220
+ --------------------------------------
221
+ -- System Implementation Parameters --
222
+ --------------------------------------
224
+ -- These parameters provide information about the target that is used
225
+ -- by the compiler. They are in the private part of System, where they
226
+ -- can be accessed using the special circuitry in the Targparm unit
227
+ -- whose source should be consulted for more detailed descriptions
228
+ -- of the individual switch values.
230
+ Backend_Divide_Checks : constant Boolean := False;
231
+ Backend_Overflow_Checks : constant Boolean := True;
232
+ Command_Line_Args : constant Boolean := True;
233
+ Configurable_Run_Time : constant Boolean := False;
234
+ Denorm : constant Boolean := True;
235
+ Duration_32_Bits : constant Boolean := False;
236
+ Exit_Status_Supported : constant Boolean := True;
237
+ Fractional_Fixed_Ops : constant Boolean := False;
238
+ Frontend_Layout : constant Boolean := False;
239
+ Machine_Overflows : constant Boolean := False;
240
+ Machine_Rounds : constant Boolean := True;
241
+ Preallocated_Stacks : constant Boolean := False;
242
+ Signed_Zeros : constant Boolean := False;
243
+ Stack_Check_Default : constant Boolean := False;
244
+ Stack_Check_Probes : constant Boolean := False;
245
+ Stack_Check_Limits : constant Boolean := False;
246
+ Support_64_Bit_Divides : constant Boolean := True;
247
+ Support_Aggregates : constant Boolean := True;
248
+ Support_Composite_Assign : constant Boolean := True;
249
+ Support_Composite_Compare : constant Boolean := True;
250
+ Support_Long_Shifts : constant Boolean := True;
251
+ Always_Compatible_Rep : constant Boolean := True;
252
+ Suppress_Standard_Library : constant Boolean := False;
253
+ Use_Ada_Main_Program_Name : constant Boolean := False;
254
+ ZCX_By_Default : constant Boolean := True;
255
+ GCC_ZCX_Support : constant Boolean := True;