summaryrefslogtreecommitdiffstats
path: root/meta/packages/gcc/gcc-4.3.1/debian/ada-sjlj.dpatch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/packages/gcc/gcc-4.3.1/debian/ada-sjlj.dpatch')
-rw-r--r--meta/packages/gcc/gcc-4.3.1/debian/ada-sjlj.dpatch1307
1 files changed, 1307 insertions, 0 deletions
diff --git a/meta/packages/gcc/gcc-4.3.1/debian/ada-sjlj.dpatch b/meta/packages/gcc/gcc-4.3.1/debian/ada-sjlj.dpatch
new file mode 100644
index 0000000000..8d480302d5
--- /dev/null
+++ b/meta/packages/gcc/gcc-4.3.1/debian/ada-sjlj.dpatch
@@ -0,0 +1,1307 @@
1#! /bin/sh -e
2
3# DP: There are two exception mechanisms to choose from: zero-cost and
4# DP: setjump/longjump. The Ada run-time library uses either of them
5# DP: but not both. Build both versions of the run-time library.
6
7# This patch changes the way the upstream Makefiles build the run-time
8# library. Before the patch: libada/Makefile calls gcc/ada/Makefile,
9# which builds the "rts" subdirectory containing symbolic links to
10# most source files, and modified copies of a few source files (to
11# take target dependencies into account, and also to select the
12# exception handling mechanism in system.ads). Then, gcc/ada/Makefile
13# calls itself recursively but in the "rts" subdirectory and builds
14# libgnat.a and libgnarl.a (and a couple other libraries:
15# libgccprefix.a, libgmem.a). Upon return from this recursive call,
16# it deletes the source and object files from "rts", reconstructs the
17# source files, and builds libgnat.so and libgnarl.so by calling
18# itself recursively a second time in the "rts" directory.
19
20# Furthermore, gcc/ada/Makefile disables parallel makes, so building
21# the static and then shared versions of the RTS is entirely
22# sequential even on SMP systems.
23
24# As a consequence of the above, building the SJLJ version of the
25# library would overwrite the ZCX version. Thus it is necessary to
26# manually save the previous version of the library before building the
27# second one.
28
29# After the patch: libada/Makefile calls gcc/ada/Makefile, which
30# builds the source directory (named gnatlib-sources instead of rts),
31# containing the symbolic links and target-dependent files.
32
33# In a second step, libada/Makefile calls gcc/ada/Makefile again to
34# build the targets gnatlib-shared-zcx, gnatlib-static-zcx and
35# gnatlib-static-sjlj (we could also build gnatlib-shared-sjlj, but
36# that triggers compiler errors on PowerPC).
37
38# Each of these three targets copies the source directory "rts" into a
39# new directory named rts-shared-zcx, rts-static-zcx or
40# rts-static-sjlj. In the new directory, they change the value of
41# System.ZCX_By_Default, and then they call gcc/ada/Makefile
42# recursively in the new directory to build the library.
43
44# gcc/ada/Makefile.in has a .NOTPARALLEL directive preventing it from
45# launching commands in parallel. However, libada/Makefile has no
46# such directive and can invoke up to three instances of
47# gcc/ada/Makefile.in in parallel. This is okay because each of them
48# runs in a different directory.
49
50# This patch also updates libgnat{vsn,prj}/Makefile and
51# gnattools/Makefile to look for the shared ZCX version of the library
52# in the appropriate directory, rather than just "rts", and updates
53# the "make install" and binary targets as well.
54
55dir=
56if [ $# -eq 3 -a "$2" = '-d' ]; then
57 pdir="-d $3"
58 dir="$3/"
59elif [ $# -ne 1 ]; then
60 echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
61 exit 1
62fi
63case "$1" in
64 -patch)
65 patch $pdir -f --no-backup-if-mismatch -p1 < $0
66 ;;
67 -unpatch)
68 patch $pdir -f --no-backup-if-mismatch -R -p1 < $0
69 ;;
70 *)
71 echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
72 exit 1
73esac
74exit 0
75
76
77Index: src/libada/Makefile.in
78===================================================================
79--- src.orig/libada/Makefile.in
80+++ src/libada/Makefile.in
81@@ -16,7 +16,8 @@
82 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
83
84 # Default target; must be first.
85-all: gnatlib
86+GNATLIB = gnatlib-static-zcx gnatlib-static-sjlj gnatlib-shared-zcx
87+all: $(GNATLIB)
88
89 # Standard autoconf-set variables.
90 SHELL = @SHELL@
91@@ -78,30 +79,38 @@
92 "CFLAGS=$(CFLAGS) $(WARN_CFLAGS)"
93
94 # Rules to build gnatlib.
95-.PHONY: gnatlib gnatlib-plain gnatlib-sjlj gnatlib-zcx gnatlib-shared
96-gnatlib: @default_gnatlib_target@
97+.PHONY: $(GNATLIB)
98
99-gnatlib-plain: $(GCC_DIR)/ada/Makefile
100- test -f stamp-libada || \
101+$(GCC_DIR)/ada/gnatlib-sources-sjlj/a-except.ads:
102 $(MAKE) -C $(GCC_DIR)/ada $(FLAGS_TO_PASS) \
103 GNATLIBFLAGS="$(GNATLIBFLAGS)" \
104 GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
105 TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
106 THREAD_KIND="$(THREAD_KIND)" \
107 TRACE="$(TRACE)" \
108- gnatlib \
109- && touch stamp-libada
110+ EH_MECHANISM="" \
111+ gnatlib-sources-sjlj/a-except.ads
112
113-gnatlib-sjlj gnatlib-zcx gnatlib-shared: $(GCC_DIR)/ada/Makefile
114- test -f stamp-libada || \
115+$(GCC_DIR)/ada/gnatlib-sources-zcx/a-except.ads:
116 $(MAKE) -C $(GCC_DIR)/ada $(FLAGS_TO_PASS) \
117 GNATLIBFLAGS="$(GNATLIBFLAGS)" \
118 GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
119 TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
120 THREAD_KIND="$(THREAD_KIND)" \
121 TRACE="$(TRACE)" \
122- $@ \
123- && touch stamp-libada
124+ EH_MECHANISM="-gcc" \
125+ gnatlib-sources-zcx/a-except.ads
126+
127+$(GNATLIB): $(GCC_DIR)/ada/Makefile \
128+$(GCC_DIR)/ada/gnatlib-sources-zcx/a-except.ads \
129+$(GCC_DIR)/ada/gnatlib-sources-sjlj/a-except.ads
130+ $(MAKE) -C $(GCC_DIR)/ada $(FLAGS_TO_PASS) \
131+ GNATLIBFLAGS="$(GNATLIBFLAGS)" \
132+ GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
133+ TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
134+ THREAD_KIND="$(THREAD_KIND)" \
135+ TRACE="$(TRACE)" \
136+ $@
137
138 # Check uninstalled version.
139 check:
140Index: src/libada/configure
141===================================================================
142--- src.orig/libada/configure
143+++ src/libada/configure
144@@ -1552,17 +1552,6 @@
145 *) x_ada_cflags= ;;
146 esac
147
148-
149-# Determine what to build for 'gnatlib'
150-if test $build = $target \
151- && test ${enable_shared} = yes ; then
152- # Note that build=target is almost certainly the wrong test; FIXME
153- default_gnatlib_target="gnatlib-shared"
154-else
155- default_gnatlib_target="gnatlib-plain"
156-fi
157-
158-
159 # Output: create a Makefile.
160 ac_config_files="$ac_config_files Makefile"
161
162@@ -2222,7 +2211,6 @@
163 s,@enable_shared@,$enable_shared,;t t
164 s,@LN_S@,$LN_S,;t t
165 s,@x_ada_cflags@,$x_ada_cflags,;t t
166-s,@default_gnatlib_target@,$default_gnatlib_target,;t t
167 s,@LIBOBJS@,$LIBOBJS,;t t
168 s,@LTLIBOBJS@,$LTLIBOBJS,;t t
169 CEOF
170Index: src/gcc/ada/Makefile.in
171===================================================================
172--- src.orig/gcc/ada/Makefile.in
173+++ src/gcc/ada/Makefile.in
174@@ -1324,6 +1324,50 @@
175 LIBRARY_VERSION := $(LIB_VERSION)
176 endif
177
178+ifeq ($(strip $(filter-out mips linux%,$(arch) $(osys))),)
179+ LIBGNAT_TARGET_PAIRS = \
180+ a-intnam.ads<a-intnam-linux.ads \
181+ g-soccon.ads<g-soccon-linux-mips.ads \
182+ s-inmaop.adb<s-inmaop-posix.adb \
183+ s-intman.adb<s-intman-posix.adb \
184+ s-osinte.adb<s-osinte-posix.adb \
185+ s-osinte.ads<s-osinte-linux.ads \
186+ s-osprim.adb<s-osprim-posix.adb \
187+ s-taprop.adb<s-taprop-linux.adb \
188+ s-taspri.ads<s-taspri-posix.ads \
189+ s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
190+ system.ads<system-linux-mips.ads
191+
192+ EH_MECHANISM=-gcc
193+ THREADSLIB = -lpthread
194+ GNATLIB_SHARED = gnatlib-shared-dual
195+ GMEM_LIB = gmemlib
196+ PREFIX_OBJS = $(PREFIX_REAL_OBJS)
197+ LIBRARY_VERSION := $(LIB_VERSION)
198+endif
199+
200+ifeq ($(strip $(filter-out mipsel linux%,$(arch) $(osys))),)
201+ LIBGNAT_TARGET_PAIRS = \
202+ a-intnam.ads<a-intnam-linux.ads \
203+ g-soccon.ads<g-soccon-linux-mips.ads \
204+ s-inmaop.adb<s-inmaop-posix.adb \
205+ s-intman.adb<s-intman-posix.adb \
206+ s-osinte.adb<s-osinte-posix.adb \
207+ s-osinte.ads<s-osinte-linux.ads \
208+ s-osprim.adb<s-osprim-posix.adb \
209+ s-taprop.adb<s-taprop-linux.adb \
210+ s-taspri.ads<s-taspri-posix.ads \
211+ s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
212+ system.ads<system-linux-mipsel.ads
213+
214+ EH_MECHANISM=-gcc
215+ THREADSLIB = -lpthread
216+ GNATLIB_SHARED = gnatlib-shared-dual
217+ GMEM_LIB = gmemlib
218+ PREFIX_OBJS = $(PREFIX_REAL_OBJS)
219+ LIBRARY_VERSION := $(LIB_VERSION)
220+endif
221+
222 ifeq ($(strip $(filter-out sparc% linux%,$(arch) $(osys))),)
223 LIBGNAT_TARGET_PAIRS = \
224 a-intnam.ads<a-intnam-linux.ads \
225@@ -1563,53 +1607,79 @@
226 a-[a-o]*.adb a-[p-z]*.adb a-[a-o]*.ads a-[p-z]*.ads g-*.ad? i-*.ad? \
227 s-[a-o]*.adb s-[p-z]*.adb s-[a-o]*.ads s-[p-z]*.ads
228
229-../stamp-gnatlib:
230- @if [ ! -f stamp-gnatlib ] ; \
231- then \
232- $(ECHO) You must first build the GNAT library: make gnatlib; \
233- false; \
234- else \
235- true; \
236- fi
237+libgnat = libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
238+libgnat-sjlj = libgnat$(hyphen)sjlj$(hyphen)$(LIBRARY_VERSION)$(soext)
239
240-install-gnatlib: ../stamp-gnatlib
241+install-gnatlib: rts-static-zcx/libgnat$(arext) rts-static-sjlj/libgnat$(arext)
242+install-gnatlib: rts-shared-zcx/$(libgnat)
243 # Create the directory before deleting it, in case the directory is
244 # a list of directories (as it may be on VMS). This ensures we are
245 # deleting the right one.
246- -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
247- -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
248- $(RMDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
249- $(RMDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
250- -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
251- -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
252- for file in rts/*.ali; do \
253- $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
254+ -$(MKDIR) $(DESTDIR)$(ADA_NATIVE_RTL_OBJ_DIR)
255+ -$(MKDIR) $(DESTDIR)$(ADA_NATIVE_INCLUDE_DIR)
256+ $(RMDIR) $(DESTDIR)$(ADA_NATIVE_RTL_OBJ_DIR)
257+ $(RMDIR) $(DESTDIR)$(ADA_NATIVE_INCLUDE_DIR)
258+ -$(MKDIR) $(DESTDIR)$(ADA_NATIVE_RTL_OBJ_DIR)
259+ -$(MKDIR) $(DESTDIR)$(ADA_NATIVE_INCLUDE_DIR)
260+
261+ -$(MKDIR) $(DESTDIR)$(ADA_SJLJ_RTL_OBJ_DIR)
262+ -$(MKDIR) $(DESTDIR)$(ADA_SJLJ_INCLUDE_DIR)
263+ $(RMDIR) $(DESTDIR)$(ADA_SJLJ_RTL_OBJ_DIR)
264+ $(RMDIR) $(DESTDIR)$(ADA_SJLJ_INCLUDE_DIR)
265+ -$(MKDIR) $(DESTDIR)$(ADA_SJLJ_RTL_OBJ_DIR)
266+ -$(MKDIR) $(DESTDIR)$(ADA_SJLJ_INCLUDE_DIR)
267+
268+ for file in rts-shared-zcx/*.ali; do \
269+ $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_NATIVE_RTL_OBJ_DIR); \
270+ done
271+ for file in rts-static-sjlj/*.ali; do \
272+ $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_SJLJ_RTL_OBJ_DIR); \
273+ done
274+
275+ -cd rts-static-zcx; for file in *$(arext);do \
276+ $(INSTALL_DATA) $$file $(DESTDIR)$(ADA_NATIVE_RTL_OBJ_DIR); \
277+ $(RANLIB_FOR_TARGET) $(DESTDIR)$(ADA_NATIVE_RTL_OBJ_DIR)/$$file; \
278 done
279- -cd rts; for file in *$(arext);do \
280- $(INSTALL_DATA) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
281- $(RANLIB_FOR_TARGET) $(DESTDIR)$(ADA_RTL_OBJ_DIR)/$$file; \
282+ -cd rts-static-sjlj; for file in *$(arext);do \
283+ $(INSTALL_DATA) $$file $(DESTDIR)$(ADA_SJLJ_RTL_OBJ_DIR); \
284+ $(RANLIB_FOR_TARGET) $(DESTDIR)$(ADA_SJLJ_RTL_OBJ_DIR)/$$file; \
285 done
286+
287+ -$(foreach file, $(EXTRA_ADALIB_FILES), \
288+ $(INSTALL_DATA_DATE) rts-static-zcx/$(file) $(DESTDIR)$(ADA_NATIVE_RTL_OBJ_DIR) && \
289+ ) true
290 -$(foreach file, $(EXTRA_ADALIB_FILES), \
291- $(INSTALL_DATA_DATE) rts/$(file) $(DESTDIR)$(ADA_RTL_OBJ_DIR) && \
292+ $(INSTALL_DATA_DATE) rts-static-sjlj/$(file) $(DESTDIR)$(ADA_SJLJ_RTL_OBJ_DIR) && \
293 ) true
294+
295 # Install the shared libraries, if any, using $(INSTALL) instead
296 # of $(INSTALL_DATA). The latter may force a mode inappropriate
297 # for shared libraries on some targets, e.g. on HP-UX where the x
298 # permission is required.
299 for file in gnat gnarl; do \
300- if [ -f rts/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) ]; then \
301- $(INSTALL) rts/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext).1 \
302- $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
303+ if [ -f rts-shared-zcx/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext).1 ]; then \
304+ $(INSTALL) rts-shared-zcx/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext).1 \
305+ $(DESTDIR)$(ADA_NATIVE_RTL_OBJ_DIR); \
306 $(LN_S) lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext).1 \
307- $(DESTDIR)$(ADA_RTL_OBJ_DIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext); \
308+ $(DESTDIR)$(ADA_NATIVE_RTL_OBJ_DIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext); \
309 fi; \
310 done
311+
312 # This copy must be done preserving the date on the original file.
313- for file in rts/*.ad?; do \
314- $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_INCLUDE_DIR); \
315+ for file in rts-shared-zcx/*.adb rts-shared-zcx/*.ads; do \
316+ $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_NATIVE_INCLUDE_DIR); \
317+ done
318+ $(CHMOD) u=rw,go=r $(DESTDIR)$(ADA_NATIVE_INCLUDE_DIR)/*.adb
319+ $(CHMOD) u=rw,go=r $(DESTDIR)$(ADA_NATIVE_INCLUDE_DIR)/*.ads
320+ for file in rts-static-sjlj/*.adb rts-static-sjlj/*.ads; do \
321+ $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_SJLJ_INCLUDE_DIR); \
322 done
323- cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.adb
324- cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.ads
325+ $(CHMOD) u=rw,go=r $(DESTDIR)$(ADA_SJLJ_INCLUDE_DIR)/*.adb
326+ $(CHMOD) u=rw,go=r $(DESTDIR)$(ADA_SJLJ_INCLUDE_DIR)/*.ads
327+
328+ (cd $(DESTDIR)$(libsubdir); \
329+ ln -s rts-native/adainclude adainclude; \
330+ ln -s rts-native/adalib adalib;)
331
332 # NOTE: The $(foreach ...) commands assume ";" is the valid separator between
333 # successive target commands. Although the Gnu make documentation
334@@ -1620,23 +1690,30 @@
335
336 # GNULLI Begin ###########################################################
337
338-../stamp-gnatlib1: Makefile
339- $(RMDIR) rts
340- $(MKDIR) rts
341- $(CHMOD) u+w rts
342+replace_zcx_by_default=\
343+'s/ZCX_By_Default.*/ZCX_By_Default : constant Boolean := $(zcx_by_default);/'
344+
345+gnatlib-sources-zcx/a-except.ads: dir=$(dir $@)
346+gnatlib-sources-zcx/a-except.ads: zcx_by_default=True
347+
348+gnatlib-sources-sjlj/a-except.ads: dir=$(dir $@)
349+gnatlib-sources-sjlj/a-except.ads: zcx_by_default=False
350+
351+gnatlib-sources-zcx/a-except.ads gnatlib-sources-sjlj/a-except.ads:
352+ $(MKDIR) $(dir)
353+ $(CHMOD) u+w $(dir)
354 # Copy target independent sources
355 $(foreach f,$(ADA_INCLUDE_SRCS) $(LIBGNAT_SRCS), \
356- $(LN_S) $(fsrcpfx)$(f) rts ;) true
357+ $(LN_S) $(fsrcpfx)$(f) $(dir) ;) true
358 # Remove files to be replaced by target dependent sources
359 $(RM) $(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
360- rts/$(word 1,$(subst <, ,$(PAIR))))
361- $(RM) rts/*-*-*.ads rts/*-*-*.adb
362+ $(dir)/$(word 1,$(subst <, ,$(PAIR))))
363+ $(RM) $(dir)/*-*-*.ads $(dir)/*-*-*.adb
364 # Copy new target dependent sources
365 $(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
366 $(LN_S) $(fsrcpfx)$(word 2,$(subst <, ,$(PAIR))) \
367- rts/$(word 1,$(subst <, ,$(PAIR)));)
368- $(RM) ../stamp-gnatlib
369- touch ../stamp-gnatlib1
370+ $(dir)/$(word 1,$(subst <, ,$(PAIR)));)
371+ sed -e $(replace_zcx_by_default) $(dir)/system.ads > $(dir)/s.ads
372
373 # GNULLI End #############################################################
374
375@@ -1646,57 +1723,60 @@
376 # Example: cd rts; ar rc libfoo.a $(LONG_LIST_OF_OBJS)
377 # is guaranteed to overflow the buffer.
378
379-gnatlib: ../stamp-gnatlib1
380- $(MAKE) -C rts \
381+%/libgnat$(arext): build_dir = $(dir $@)
382+%/libgnat$(arext): libgnarl = $(subst libgnat,libgnarl,$@)
383+%/libgnat$(arext): libgnala = $(subst libgnat,libgnala,$@)
384+%/libgnat$(arext): %
385+ $(MAKE) -C $(build_dir) \
386 CC="`echo \"$(GCC_FOR_TARGET)\" \
387 | sed -e 's,^\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \
388- INCLUDES="$(INCLUDES_FOR_SUBDIR) -I./../.." \
389- CFLAGS="$(GNATLIBCFLAGS_FOR_C)" \
390- FORCE_DEBUG_ADAFLAGS="$(FORCE_DEBUG_ADAFLAGS)" \
391+ INCLUDES="$(INCLUDES_FOR_SUBDIR) -I./../.." \
392+ CFLAGS="$(GNATLIBCFLAGS_FOR_C)" \
393 srcdir=$(fsrcdir) \
394- -f ../Makefile $(LIBGNAT_OBJS)
395- $(MAKE) -C rts \
396+ -f ../Makefile $(LIBGNAT_OBJS)
397+ $(MAKE) -C $(build_dir) \
398 CC="`echo \"$(GCC_FOR_TARGET)\" \
399 | sed -e 's,^\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \
400- ADA_INCLUDES="" \
401- CFLAGS="$(GNATLIBCFLAGS)" \
402- ADAFLAGS="$(GNATLIBFLAGS)" \
403- FORCE_DEBUG_ADAFLAGS="$(FORCE_DEBUG_ADAFLAGS)" \
404+ ADA_INCLUDES="" \
405+ CFLAGS="$(GNATLIBCFLAGS)" \
406+ ADAFLAGS="$(GNATLIBFLAGS)" \
407 srcdir=$(fsrcdir) \
408- -f ../Makefile \
409- $(GNATRTL_OBJS)
410- $(RM) rts/libgnat$(arext) rts/libgnarl$(arext)
411- $(AR_FOR_TARGET) $(AR_FLAGS) rts/libgnat$(arext) \
412- $(addprefix rts/,$(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) g-trasym.o convert_addresses.o)
413+ -f ../Makefile \
414+ $(GNATRTL_OBJS)
415+ $(RM) $@ $(libgnarl)
416+ $(AR_FOR_TARGET) $(AR_FLAGS) $@ \
417+ $(addprefix $(build_dir),$(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) g-trasym.o convert_addresses.o)
418 ifneq ($(PREFIX_OBJS),)
419- $(AR_FOR_TARGET) $(AR_FLAGS) rts/libgccprefix$(arext) \
420+ $(AR_FOR_TARGET) $(AR_FLAGS) $(build_dir)libgccprefix$(arext) \
421 $(PREFIX_OBJS);
422- $(RANLIB_FOR_TARGET) rts/libgccprefix$(arext)
423+ $(RANLIB_FOR_TARGET) $(build_dir)libgccprefix$(arext)
424 endif
425- $(RANLIB_FOR_TARGET) rts/libgnat$(arext)
426- $(AR_FOR_TARGET) $(AR_FLAGS) rts/libgnarl$(arext) \
427- $(addprefix rts/,$(GNATRTL_TASKING_OBJS))
428- $(RANLIB_FOR_TARGET) rts/libgnarl$(arext)
429- $(AR_FOR_TARGET) $(AR_FLAGS) rts/libgnala$(arext) \
430- $(addprefix rts/,$(GNATRTL_LINEARALGEBRA_OBJS))
431- $(RANLIB_FOR_TARGET) rts/libgnala$(arext)
432+ $(RANLIB_FOR_TARGET) $@
433+ $(AR_FOR_TARGET) $(AR_FLAGS) $(libgnarl) \
434+ $(addprefix $(build_dir),$(GNATRTL_TASKING_OBJS))
435+ $(RANLIB_FOR_TARGET) $(libgnarl)
436+ $(AR_FOR_TARGET) $(AR_FLAGS) $(libgnala) \
437+ $(addprefix $(build_dir),$(GNATRTL_LINEARALGEBRA_OBJS))
438+ $(RANLIB_FOR_TARGET) $(libgnala)
439 ifeq ($(GMEM_LIB),gmemlib)
440- $(AR_FOR_TARGET) $(AR_FLAGS) rts/libgmem$(arext) \
441- rts/memtrack.o
442- $(RANLIB_FOR_TARGET) rts/libgmem$(arext)
443+ $(AR_FOR_TARGET) $(AR_FLAGS) $(build_dir)libgmem$(arext) \
444+ $(build_dir)memtrack.o
445+ $(RANLIB_FOR_TARGET) $(build_dir)libgmem$(arext)
446 endif
447- touch ../stamp-gnatlib
448
449 # Warning: this target assumes that LIBRARY_VERSION has been set correctly.
450-gnatlib-shared-default: ../stamp-gnatlib1
451- $(MAKE) -C rts \
452+%/$(libgnat) %/$(libgnat-sjlj): build_dir = $(dir $@)
453+%/$(libgnat) %/$(libgnat-sjlj): libgnarl = $(notdir $(subst libgnat,libgnarl,$@))
454+%/$(libgnat) %/$(libgnat-sjlj): libgnala = $(notdir $(subst libgnat,libgnala,$@))
455+%/$(libgnat) %/$(libgnat-sjlj): %
456+ $(MAKE) -C $(build_dir) \
457 CC="`echo \"$(GCC_FOR_TARGET)\" \
458 | sed -e 's,^\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \
459 INCLUDES="$(INCLUDES_FOR_SUBDIR) -I./../.." \
460 CFLAGS="$(GNATLIBCFLAGS_FOR_C)" \
461 srcdir=$(fsrcdir) \
462 -f ../Makefile $(LIBGNAT_OBJS)
463- $(MAKE) -C rts \
464+ $(MAKE) -C $(build_dir) \
465 CC="`echo \"$(GCC_FOR_TARGET)\" \
466 | sed -e 's,^\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \
467 ADA_INCLUDES="" \
468@@ -1706,157 +1786,75 @@
469 srcdir=$(fsrcdir) \
470 -f ../Makefile \
471 $(GNATRTL_OBJS)
472- $(RM) rts/libgna*$(soext) rts/libgna*$(soext).1
473- cd rts; ../../xgcc -B../../ -shared $(GNATLIBCFLAGS) \
474+ $(RM) $(build_dir)/libgna*$(soext) $(build_dir)/libgna*$(soext).1
475+ cd $(build_dir); ../../xgcc -B../../ -shared $(GNATLIBCFLAGS) \
476 $(TARGET_LIBGCC2_CFLAGS) \
477- -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext).1 \
478+ -o $(notdir $@).1 \
479 $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
480 g-trasym.o convert_addresses.o \
481- $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext).1 \
482+ $(SO_OPTS)$(notdir $@).1 \
483 $(MISCLIB) -lm
484- cd rts; ../../xgcc -B../../ -shared $(GNATLIBCFLAGS) \
485+ cd $(build_dir); $(LN_S) $(notdir $@).1 $(notdir $@)
486+ cd $(build_dir); ../../xgcc -B../../ -shared $(GNATLIBCFLAGS) \
487 $(TARGET_LIBGCC2_CFLAGS) \
488- -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext).1 \
489+ -o $(libgnarl).1 \
490 $(GNATRTL_TASKING_OBJS) \
491- $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext).1 \
492+ $(SO_OPTS)$(libgnarl).1 \
493 $(THREADSLIB)
494- cd rts; for lib in gnat gnarl; do \
495- l=lib$${lib}$(hyphen)$(LIBRARY_VERSION)$(soext); \
496- $(LN_S) $$l.1 $$l; \
497- done
498-# Delete the object files, lest they be linked statically into the tools
499-# executables. Only the .ali, .a and .so files must remain.
500- rm -f rts/*.o
501- $(CHMOD) a-wx rts/*.ali
502-
503-gnatlib-shared-dual:
504- $(MAKE) $(FLAGS_TO_PASS) \
505- GNATLIBFLAGS="$(GNATLIBFLAGS)" \
506- GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
507- THREAD_KIND="$(THREAD_KIND)" \
508- gnatlib
509- $(RM) rts/*.o rts/*.ali
510- $(MAKE) $(FLAGS_TO_PASS) \
511- GNATLIBFLAGS="$(GNATLIBFLAGS)" \
512- GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
513- THREAD_KIND="$(THREAD_KIND)" \
514- gnatlib-shared-default
515-
516-gnatlib-shared-dual-win32:
517- $(MAKE) $(FLAGS_TO_PASS) \
518- GNATLIBFLAGS="$(GNATLIBFLAGS)" \
519- GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
520- THREAD_KIND="$(THREAD_KIND)" \
521- gnatlib
522- $(RM) rts/*.o rts/*.ali
523- $(MAKE) $(FLAGS_TO_PASS) \
524- GNATLIBFLAGS="$(GNATLIBFLAGS)" \
525- GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
526- THREAD_KIND="$(THREAD_KIND)" \
527- gnatlib-shared-win32
528-
529-# ??? we need to add the option to support auto-import of arrays/records to
530-# the GNATLIBFLAGS when this will be supported by GNAT. At this point we will
531-# use the gnatlib-shared-dual-win32 target to build the GNAT runtimes on
532-# Windows.
533-gnatlib-shared-win32:
534- $(MAKE) $(FLAGS_TO_PASS) \
535- GNATLIBFLAGS="$(GNATLIBFLAGS)" \
536- GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
537- THREAD_KIND="$(THREAD_KIND)" \
538- gnatlib
539- $(RM) rts/libgna*$(soext)
540- cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
541- -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
542- $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
543- $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) $(MISCLIB)
544- cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
545- -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
546- $(GNATRTL_TASKING_OBJS) \
547- $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
548- $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
549-
550-gnatlib-shared-darwin:
551- $(MAKE) $(FLAGS_TO_PASS) \
552- GNATLIBFLAGS="$(GNATLIBFLAGS)" \
553- GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS) \
554- -fno-common" \
555- THREAD_KIND="$(THREAD_KIND)" \
556- gnatlib
557- $(RM) rts/libgnat$(soext) rts/libgnarl$(soext)
558- cd rts; ../../xgcc -B../../ -dynamiclib $(TARGET_LIBGCC2_CFLAGS) \
559- -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
560- $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
561- $(SO_OPTS) \
562- $(MISCLIB) -lm
563- cd rts; ../../xgcc -B../../ -dynamiclib $(TARGET_LIBGCC2_CFLAGS) \
564- -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
565- $(GNATRTL_TASKING_OBJS) \
566- $(SO_OPTS) \
567- $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
568- cd rts; $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
569- libgnat$(soext)
570- cd rts; $(LN_S) libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
571- libgnarl$(soext)
572-
573-gnatlib-shared-vms:
574- $(MAKE) $(FLAGS_TO_PASS) \
575- GNATLIBFLAGS="$(GNATLIBFLAGS)" \
576- GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
577- THREAD_KIND="$(THREAD_KIND)" \
578- gnatlib
579- $(RM) rts/libgna*$(soext)
580- cd rts && echo "case_sensitive=yes" > SYMVEC_$$$$.opt && \
581- objdump --syms $(LIBGNAT_OBJS) $(GNATRTL_NONTASKING_OBJS) | \
582- $(SHLIB_SYMVEC) >> SYMVEC_$$$$.opt && \
583- echo "case_sensitive=NO" >> SYMVEC_$$$$.opt && \
584- ../../xgcc -g -B../../ -shared -shared-libgcc \
585- -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) libgnat.a \
586- sys\$$library:trace.exe \
587- --for-linker=/noinform \
588- --for-linker=SYMVEC_$$$$.opt \
589- --for-linker=gsmatch=equal,$(GSMATCH_VERSION)
590- cd rts && echo "case_sensitive=yes" > SYMVEC_$$$$.opt && \
591- objdump --syms $(GNATRTL_TASKING_OBJS) | \
592- $(SHLIB_SYMVEC) >> SYMVEC_$$$$.opt && \
593- echo "case_sensitive=NO" >> SYMVEC_$$$$.opt && \
594- ../../xgcc -g -B../../ -shared -shared-libgcc \
595- -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
596- libgnarl.a libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
597- sys\$$library:trace.exe \
598- --for-linker=/noinform \
599- --for-linker=SYMVEC_$$$$.opt \
600- --for-linker=gsmatch=equal,$(GSMATCH_VERSION)
601+ cd $(build_dir); $(LN_S) $(libgnarl).1 $(libgnarl)
602+# TODO: enable building the shared libgnala
603+ifeq (libgnala-shared-enabled,yes)
604+ cd $(build_dir); ../../xgcc -B../../ -shared $(GNATLIBCFLAGS) \
605+ $(TARGET_LIBGCC2_CFLAGS) \
606+ -o $(libgnala).1 \
607+ $(GNATRTL_LINEARALGEBRA_OBJS) \
608+ $(SO_OPTS)$(libgnala).1
609+ cd $(build_dir); $(LN_S) $(libgnala).1 $(libgnala)
610+endif
611
612-gnatlib-shared:
613+gnatlib-shared-dual: gnatlib-static-zcx gnatlib-static-sjlj gnatlib-shared-zcx
614+
615+gnatlib-shared-zcx: rts = $(subst gnatlib,rts,$@)
616+gnatlib-shared-zcx: gnatlib-sources-zcx/a-except.ads
617+ if [ ! -d $(rts) ] ; then \
618+ cp -a gnatlib-sources-zcx $(rts); \
619+ $(MV) $(rts)/s.ads $(rts)/system.ads; \
620+ fi
621 $(MAKE) $(FLAGS_TO_PASS) \
622+ EH_MECHANISM="-gcc" \
623 GNATLIBFLAGS="$(GNATLIBFLAGS)" \
624 GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
625 THREAD_KIND="$(THREAD_KIND)" \
626 TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
627- $(GNATLIB_SHARED)
628+ $(rts)/$(libgnat)
629
630-gnatlib-sjlj:
631- $(MAKE) $(FLAGS_TO_PASS) EH_MECHANISM="" ../stamp-gnatlib1
632- sed -e 's/ZCX_By_Default.*/ZCX_By_Default : constant Boolean := False;/' rts/system.ads > rts/s.ads
633- $(MV) rts/s.ads rts/system.ads
634+gnatlib-static-sjlj: rts = $(subst gnatlib,rts,$@)
635+gnatlib-static-sjlj: gnatlib-sources-sjlj/a-except.ads
636+ if [ ! -d $(rts) ] ; then \
637+ cp -a gnatlib-sources-sjlj $(rts); \
638+ $(MV) $(rts)/s.ads $(rts)/system.ads; \
639+ fi
640 $(MAKE) $(FLAGS_TO_PASS) \
641 EH_MECHANISM="" \
642 GNATLIBFLAGS="$(GNATLIBFLAGS)" \
643 GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
644 THREAD_KIND="$(THREAD_KIND)" \
645- TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" gnatlib
646+ TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
647+ $(rts)/libgnat$(arext)
648
649-gnatlib-zcx:
650- $(MAKE) $(FLAGS_TO_PASS) EH_MECHANISM="-gcc" ../stamp-gnatlib1
651- sed -e 's/ZCX_By_Default.*/ZCX_By_Default : constant Boolean := True;/' rts/system.ads > rts/s.ads
652- $(MV) rts/s.ads rts/system.ads
653+gnatlib-static-zcx: rts = $(subst gnatlib,rts,$@)
654+gnatlib-static-zcx: gnatlib-sources-zcx/a-except.ads
655+ if [ ! -d $(rts) ] ; then \
656+ cp -a gnatlib-sources-zcx $(rts); \
657+ $(MV) $(rts)/s.ads $(rts)/system.ads; \
658+ fi
659 $(MAKE) $(FLAGS_TO_PASS) \
660 EH_MECHANISM="-gcc" \
661 GNATLIBFLAGS="$(GNATLIBFLAGS)" \
662 GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
663 THREAD_KIND="$(THREAD_KIND)" \
664- TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" gnatlib
665+ TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
666+ $(rts)/libgnat$(arext)
667
668 # .s files for cross-building
669 gnat-cross: force
670@@ -1864,6 +1862,10 @@
671
672 ADA_INCLUDE_DIR = $(libsubdir)/adainclude
673 ADA_RTL_OBJ_DIR = $(libsubdir)/adalib
674+ADA_NATIVE_INCLUDE_DIR = $(libsubdir)/rts-native/adainclude
675+ADA_NATIVE_RTL_OBJ_DIR = $(libsubdir)/rts-native/adalib
676+ADA_SJLJ_INCLUDE_DIR = $(libsubdir)/rts-sjlj/adainclude
677+ADA_SJLJ_RTL_OBJ_DIR = $(libsubdir)/rts-sjlj/adalib
678
679 # force no sibling call optimization on s-traceb.o so the number of stack
680 # frames to be skipped when computing a call chain is not modified by
681Index: src/gnattools/Makefile.in
682===================================================================
683--- src.orig/gnattools/Makefile.in
684+++ src/gnattools/Makefile.in
685@@ -34,12 +34,13 @@
686 LN_S=@LN_S@
687 target_noncanonical=@target_noncanonical@
688
689+RTS=../gcc/ada/rts-shared-zcx
690 CFLAGS=-O2 -Wall
691 ADA_CFLAGS=-O2 -gnatn
692-ADA_INCLUDES=-nostdinc -I- -I. -I../gcc/ada/rts -I../libgnatvsn -I../libgnatprj
693+ADA_INCLUDES=-nostdinc -I- -I. -I$(RTS) -I../libgnatvsn -I../libgnatprj
694 LIB_VERSION=$(strip $(shell grep ' Library_Version :' \
695 ../libgnatvsn/gnatvsn.ads | sed -e 's/.*"\(.*\)".*/\1/'))
696-ADA_LIBS := -L../gcc/ada/rts -lgnat-$(LIB_VERSION)
697+ADA_LIBS := -L$(RTS) -lgnat-$(LIB_VERSION)
698 ADA_LIBS += -L../libgnatvsn -lgnatvsn
699 ADA_LIBS += -L../libgnatprj -lgnatprj
700
701@@ -109,6 +110,7 @@
702
703 .PHONY: gnattools gnattools-native gnattools-cross regnattools
704 gnattools: @default_gnattools_target@
705+ (cd $(RTS); if [ -d obj ]; then mv obj/* .; rmdir obj; fi)
706
707 BODIES := $(foreach f,$(OBJECTS),$(wildcard $(patsubst %.o,@srcdir@/../gcc/ada/%.adb,$(f))))
708 SPECS := $(foreach f,$(OBJECTS),$(wildcard $(patsubst %.o,@srcdir@/../gcc/ada/%.ads,$(f))))
709@@ -119,9 +121,12 @@
710 for file in $(BODIES) $(SPECS); do \
711 $(LN_S) -f $$file .; \
712 done
713+# Move the RTS object files away lest they be linked statically into the
714+# tools. Only the .ali, .a and .so files must remain.
715+ (cd $(RTS); mkdir obj; mv *.o obj; chmod a-wx *.ali)
716 touch $@
717
718-gnattools-native: ../gcc/ada/rts/libgnat-$(LIB_VERSION).so
719+gnattools-native: $(RTS)/libgnat-$(LIB_VERSION).so
720 gnattools-native: ../libgnatvsn/libgnatvsn.so
721 gnattools-native: stamp-gnattools-sources
722 gnattools-native: $(TOOLS) gnatbl
723@@ -137,7 +142,7 @@
724 $(GCC) -o $@ $^ \
725 ../libgnatprj/libgnatprj.a \
726 ../libgnatvsn/libgnatvsn.a \
727- ../gcc/ada/rts/libgnat.a \
728+ ../gcc/ada/rts-static-zcx/libgnat.a \
729 ../libiberty/libiberty.a
730
731 gnatlink: $(GNATLINK_OBJS) b_gnatl.o
732@@ -155,7 +160,7 @@
733 $(GCC) -o $@ $(ADA_CFLAGS) $^ \
734 ../libgnatprj/libgnatprj.a \
735 ../libgnatvsn/libgnatvsn.a \
736- ../gcc/ada/rts/libgnat.a \
737+ ../gcc/ada/rts-static-zcx/libgnat.a \
738 ../libiberty/libiberty.a
739
740 gnatmake: $(GNATMAKE_OBJS) b_gnatm.o
741Index: src/libgnatprj/Makefile.in
742===================================================================
743--- src.orig/libgnatprj/Makefile.in
744+++ src/libgnatprj/Makefile.in
745@@ -25,7 +25,8 @@
746 @srcdir@/../gcc/ada/gnatvsn.ads | \
747 sed -e 's/.*"\(.*\)".*/\1/'))
748 GCC:=../gcc/xgcc -B../gcc/
749-LIBGNAT_JUST_BUILT := -nostdinc -I../gcc/ada/rts
750+RTS:=../gcc/ada/rts-shared-zcx
751+LIBGNAT_JUST_BUILT := -nostdinc -I$(RTS)
752 LIBGNATVSN := -I../libgnatvsn
753 CFLAGS := -g -O2
754 ADAFLAGS := -g -O2 -gnatn
755@@ -65,7 +66,7 @@
756 libgnatprj.so.$(LIB_VERSION): $(addprefix obj-shared/,$(OBJECTS))
757 : # Make libgnatprj.so
758 $(GCC) -o $@ -shared -fPIC -Wl,--soname,$@ $^ \
759- -L../gcc/ada/rts -lgnat-$(LIB_VERSION) \
760+ -L$(RTS) -lgnat-$(LIB_VERSION) \
761 -L../libgnatvsn -lgnatvsn
762 $(LN_S) -f libgnatprj.so.$(LIB_VERSION) libgnatprj.so
763 chmod a=r obj-shared/*.ali
764Index: src/libgnatvsn/Makefile.in
765===================================================================
766--- src.orig/libgnatvsn/Makefile.in
767+++ src/libgnatvsn/Makefile.in
768@@ -25,7 +25,8 @@
769 @srcdir@/../gcc/ada/gnatvsn.ads | \
770 sed -e 's/.*"\(.*\)".*/\1/'))
771 GCC:=../gcc/xgcc -B../gcc/
772-LIBGNAT_JUST_BUILT := -nostdinc -I../gcc/ada/rts
773+RTS:=../gcc/ada/rts-shared-zcx
774+LIBGNAT_JUST_BUILT := -nostdinc -I$(RTS)
775 CFLAGS := -g -O2 -gnatn
776 BASEVER := $(shell cat @srcdir@/../gcc/BASE-VER)
777 DEVPHASE := $(shell cat @srcdir@/../gcc/DEV-PHASE)
778@@ -64,7 +65,7 @@
779 libgnatvsn.so.$(LIB_VERSION): $(addprefix obj-shared/,$(OBJECTS))
780 : # Make libgnatvsn.so
781 $(GCC) -o $@ -shared -fPIC -Wl,--soname,$@ $^ \
782- -L../gcc/ada/rts -lgnat-$(LIB_VERSION)
783+ -L$(RTS) -lgnat-$(LIB_VERSION)
784 ln -s libgnatvsn.so.$(LIB_VERSION) libgnatvsn.so
785 chmod a=r obj-shared/*.ali
786 # Make the .ali files, but not the .o files, visible to the gnat tools.
787Index: src/gcc/ada/Make-lang.in
788===================================================================
789--- src.orig/gcc/ada/Make-lang.in
790+++ src/gcc/ada/Make-lang.in
791@@ -62,7 +62,8 @@
792 "ADA_FOR_TARGET=$(ADA_FOR_TARGET)" \
793 "INSTALL=$(INSTALL)" \
794 "INSTALL_DATA=$(INSTALL_DATA)" \
795- "INSTALL_PROGRAM=$(INSTALL_PROGRAM)"
796+ "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
797+ "GCC_FOR_TARGET=$(GCC_FOR_TARGET)"
798
799 # Say how to compile Ada programs.
800 .SUFFIXES: .ada .adb .ads
801Index: src/gcc/ada/system-linux-mips.ads
802===================================================================
803--- /dev/null
804+++ src/gcc/ada/system-linux-mips.ads
805@@ -0,0 +1,154 @@
806+------------------------------------------------------------------------------
807+-- --
808+-- GNAT RUN-TIME COMPONENTS --
809+-- --
810+-- S Y S T E M --
811+-- --
812+-- S p e c --
813+-- (GNU-Linux/MIPS Version) --
814+-- --
815+-- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
816+-- --
817+-- This specification is derived from the Ada Reference Manual for use with --
818+-- GNAT. The copyright notice above, and the license provisions that follow --
819+-- apply solely to the contents of the part following the private keyword. --
820+-- --
821+-- GNAT is free software; you can redistribute it and/or modify it under --
822+-- terms of the GNU General Public License as published by the Free Soft- --
823+-- ware Foundation; either version 2, or (at your option) any later ver- --
824+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
825+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
826+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
827+-- for more details. You should have received a copy of the GNU General --
828+-- Public License distributed with GNAT; see file COPYING. If not, write --
829+-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
830+-- Boston, MA 02110-1301, USA. --
831+-- --
832+-- As a special exception, if other files instantiate generics from this --
833+-- unit, or you link this unit with other files to produce an executable, --
834+-- this unit does not by itself cause the resulting executable to be --
835+-- covered by the GNU General Public License. This exception does not --
836+-- however invalidate any other reasons why the executable file might be --
837+-- covered by the GNU Public License. --
838+-- --
839+-- GNAT was originally developed by the GNAT team at New York University. --
840+-- Extensive contributions were provided by Ada Core Technologies Inc. --
841+-- --
842+------------------------------------------------------------------------------
843+
844+package System is
845+ pragma Pure;
846+ -- Note that we take advantage of the implementation permission to make
847+ -- this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada
848+ -- 2005, this is Pure in any case (AI-362).
849+
850+ type Name is (SYSTEM_NAME_GNAT);
851+ System_Name : constant Name := SYSTEM_NAME_GNAT;
852+
853+ -- System-Dependent Named Numbers
854+
855+ Min_Int : constant := Long_Long_Integer'First;
856+ Max_Int : constant := Long_Long_Integer'Last;
857+
858+ Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size;
859+ Max_Nonbinary_Modulus : constant := Integer'Last;
860+
861+ Max_Base_Digits : constant := Long_Long_Float'Digits;
862+ Max_Digits : constant := Long_Long_Float'Digits;
863+
864+ Max_Mantissa : constant := 63;
865+ Fine_Delta : constant := 2.0 ** (-Max_Mantissa);
866+
867+ Tick : constant := 0.000_001;
868+
869+ -- Storage-related Declarations
870+
871+ type Address is private;
872+ Null_Address : constant Address;
873+
874+ Storage_Unit : constant := 8;
875+ Word_Size : constant := 32;
876+ Memory_Size : constant := 2 ** 32;
877+
878+ -- Address comparison
879+
880+ function "<" (Left, Right : Address) return Boolean;
881+ function "<=" (Left, Right : Address) return Boolean;
882+ function ">" (Left, Right : Address) return Boolean;
883+ function ">=" (Left, Right : Address) return Boolean;
884+ function "=" (Left, Right : Address) return Boolean;
885+
886+ pragma Import (Intrinsic, "<");
887+ pragma Import (Intrinsic, "<=");
888+ pragma Import (Intrinsic, ">");
889+ pragma Import (Intrinsic, ">=");
890+ pragma Import (Intrinsic, "=");
891+
892+ -- Other System-Dependent Declarations
893+
894+ type Bit_Order is (High_Order_First, Low_Order_First);
895+ Default_Bit_Order : constant Bit_Order := High_Order_First;
896+ pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning
897+
898+ -- Priority-related Declarations (RM D.1)
899+
900+ Max_Priority : constant Positive := 30;
901+ Max_Interrupt_Priority : constant Positive := 31;
902+
903+ subtype Any_Priority is Integer range 0 .. 31;
904+ subtype Priority is Any_Priority range 0 .. 30;
905+ subtype Interrupt_Priority is Any_Priority range 31 .. 31;
906+
907+ Default_Priority : constant Priority := 15;
908+
909+private
910+
911+ type Address is mod Memory_Size;
912+ Null_Address : constant Address := 0;
913+
914+ --------------------------------------
915+ -- System Implementation Parameters --
916+ --------------------------------------
917+
918+ -- These parameters provide information about the target that is used
919+ -- by the compiler. They are in the private part of System, where they
920+ -- can be accessed using the special circuitry in the Targparm unit
921+ -- whose source should be consulted for more detailed descriptions
922+ -- of the individual switch values.
923+
924+ AAMP : constant Boolean := False;
925+ Backend_Divide_Checks : constant Boolean := False;
926+ Backend_Overflow_Checks : constant Boolean := False;
927+ Command_Line_Args : constant Boolean := True;
928+ Compiler_System_Version : constant Boolean := False;
929+ Configurable_Run_Time : constant Boolean := False;
930+ Denorm : constant Boolean := True;
931+ Duration_32_Bits : constant Boolean := False;
932+ Exit_Status_Supported : constant Boolean := True;
933+ Fractional_Fixed_Ops : constant Boolean := False;
934+ Frontend_Layout : constant Boolean := False;
935+ Functions_Return_By_DSP : constant Boolean := False;
936+ Machine_Overflows : constant Boolean := False;
937+ Machine_Rounds : constant Boolean := True;
938+ OpenVMS : constant Boolean := False;
939+ Preallocated_Stacks : constant Boolean := False;
940+ Signed_Zeros : constant Boolean := True;
941+ Stack_Check_Default : constant Boolean := False;
942+ Stack_Check_Probes : constant Boolean := False;
943+ Support_64_Bit_Divides : constant Boolean := True;
944+ Support_Aggregates : constant Boolean := True;
945+ Support_Composite_Assign : constant Boolean := True;
946+ Support_Composite_Compare : constant Boolean := True;
947+ Support_Long_Shifts : constant Boolean := True;
948+ Suppress_Standard_Library : constant Boolean := False;
949+ Use_Ada_Main_Program_Name : constant Boolean := False;
950+ ZCX_By_Default : constant Boolean := True;
951+ GCC_ZCX_Support : constant Boolean := True;
952+ Front_End_ZCX_Support : constant Boolean := False;
953+
954+ -- Obsolete entries, to be removed eventually (bootstrap issues!)
955+
956+ High_Integrity_Mode : constant Boolean := False;
957+ Long_Shifts_Inlined : constant Boolean := True;
958+
959+end System;
960Index: src/gcc/ada/system-linux-mipsel.ads
961===================================================================
962--- /dev/null
963+++ src/gcc/ada/system-linux-mipsel.ads
964@@ -0,0 +1,154 @@
965+------------------------------------------------------------------------------
966+-- --
967+-- GNAT RUN-TIME COMPONENTS --
968+-- --
969+-- S Y S T E M --
970+-- --
971+-- S p e c --
972+-- (GNU-Linux/MIPSEL Version) --
973+-- --
974+-- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
975+-- --
976+-- This specification is derived from the Ada Reference Manual for use with --
977+-- GNAT. The copyright notice above, and the license provisions that follow --
978+-- apply solely to the contents of the part following the private keyword. --
979+-- --
980+-- GNAT is free software; you can redistribute it and/or modify it under --
981+-- terms of the GNU General Public License as published by the Free Soft- --
982+-- ware Foundation; either version 2, or (at your option) any later ver- --
983+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
984+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
985+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
986+-- for more details. You should have received a copy of the GNU General --
987+-- Public License distributed with GNAT; see file COPYING. If not, write --
988+-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
989+-- Boston, MA 02110-1301, USA. --
990+-- --
991+-- As a special exception, if other files instantiate generics from this --
992+-- unit, or you link this unit with other files to produce an executable, --
993+-- this unit does not by itself cause the resulting executable to be --
994+-- covered by the GNU General Public License. This exception does not --
995+-- however invalidate any other reasons why the executable file might be --
996+-- covered by the GNU Public License. --
997+-- --
998+-- GNAT was originally developed by the GNAT team at New York University. --
999+-- Extensive contributions were provided by Ada Core Technologies Inc. --
1000+-- --
1001+------------------------------------------------------------------------------
1002+
1003+package System is
1004+ pragma Pure;
1005+ -- Note that we take advantage of the implementation permission to make
1006+ -- this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada
1007+ -- 2005, this is Pure in any case (AI-362).
1008+
1009+ type Name is (SYSTEM_NAME_GNAT);
1010+ System_Name : constant Name := SYSTEM_NAME_GNAT;
1011+
1012+ -- System-Dependent Named Numbers
1013+
1014+ Min_Int : constant := Long_Long_Integer'First;
1015+ Max_Int : constant := Long_Long_Integer'Last;
1016+
1017+ Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size;
1018+ Max_Nonbinary_Modulus : constant := Integer'Last;
1019+
1020+ Max_Base_Digits : constant := Long_Long_Float'Digits;
1021+ Max_Digits : constant := Long_Long_Float'Digits;
1022+
1023+ Max_Mantissa : constant := 63;
1024+ Fine_Delta : constant := 2.0 ** (-Max_Mantissa);
1025+
1026+ Tick : constant := 0.000_001;
1027+
1028+ -- Storage-related Declarations
1029+
1030+ type Address is private;
1031+ Null_Address : constant Address;
1032+
1033+ Storage_Unit : constant := 8;
1034+ Word_Size : constant := 32;
1035+ Memory_Size : constant := 2 ** 32;
1036+
1037+ -- Address comparison
1038+
1039+ function "<" (Left, Right : Address) return Boolean;
1040+ function "<=" (Left, Right : Address) return Boolean;
1041+ function ">" (Left, Right : Address) return Boolean;
1042+ function ">=" (Left, Right : Address) return Boolean;
1043+ function "=" (Left, Right : Address) return Boolean;
1044+
1045+ pragma Import (Intrinsic, "<");
1046+ pragma Import (Intrinsic, "<=");
1047+ pragma Import (Intrinsic, ">");
1048+ pragma Import (Intrinsic, ">=");
1049+ pragma Import (Intrinsic, "=");
1050+
1051+ -- Other System-Dependent Declarations
1052+
1053+ type Bit_Order is (High_Order_First, Low_Order_First);
1054+ Default_Bit_Order : constant Bit_Order := Low_Order_First;
1055+ pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning
1056+
1057+ -- Priority-related Declarations (RM D.1)
1058+
1059+ Max_Priority : constant Positive := 30;
1060+ Max_Interrupt_Priority : constant Positive := 31;
1061+
1062+ subtype Any_Priority is Integer range 0 .. 31;
1063+ subtype Priority is Any_Priority range 0 .. 30;
1064+ subtype Interrupt_Priority is Any_Priority range 31 .. 31;
1065+
1066+ Default_Priority : constant Priority := 15;
1067+
1068+private
1069+
1070+ type Address is mod Memory_Size;
1071+ Null_Address : constant Address := 0;
1072+
1073+ --------------------------------------
1074+ -- System Implementation Parameters --
1075+ --------------------------------------
1076+
1077+ -- These parameters provide information about the target that is used
1078+ -- by the compiler. They are in the private part of System, where they
1079+ -- can be accessed using the special circuitry in the Targparm unit
1080+ -- whose source should be consulted for more detailed descriptions
1081+ -- of the individual switch values.
1082+
1083+ AAMP : constant Boolean := False;
1084+ Backend_Divide_Checks : constant Boolean := False;
1085+ Backend_Overflow_Checks : constant Boolean := False;
1086+ Command_Line_Args : constant Boolean := True;
1087+ Compiler_System_Version : constant Boolean := False;
1088+ Configurable_Run_Time : constant Boolean := False;
1089+ Denorm : constant Boolean := True;
1090+ Duration_32_Bits : constant Boolean := False;
1091+ Exit_Status_Supported : constant Boolean := True;
1092+ Fractional_Fixed_Ops : constant Boolean := False;
1093+ Frontend_Layout : constant Boolean := False;
1094+ Functions_Return_By_DSP : constant Boolean := False;
1095+ Machine_Overflows : constant Boolean := False;
1096+ Machine_Rounds : constant Boolean := True;
1097+ OpenVMS : constant Boolean := False;
1098+ Preallocated_Stacks : constant Boolean := False;
1099+ Signed_Zeros : constant Boolean := True;
1100+ Stack_Check_Default : constant Boolean := False;
1101+ Stack_Check_Probes : constant Boolean := False;
1102+ Support_64_Bit_Divides : constant Boolean := True;
1103+ Support_Aggregates : constant Boolean := True;
1104+ Support_Composite_Assign : constant Boolean := True;
1105+ Support_Composite_Compare : constant Boolean := True;
1106+ Support_Long_Shifts : constant Boolean := True;
1107+ Suppress_Standard_Library : constant Boolean := False;
1108+ Use_Ada_Main_Program_Name : constant Boolean := False;
1109+ ZCX_By_Default : constant Boolean := True;
1110+ GCC_ZCX_Support : constant Boolean := True;
1111+ Front_End_ZCX_Support : constant Boolean := False;
1112+
1113+ -- Obsolete entries, to be removed eventually (bootstrap issues!)
1114+
1115+ High_Integrity_Mode : constant Boolean := False;
1116+ Long_Shifts_Inlined : constant Boolean := True;
1117+
1118+end System;
1119Index: src/gcc/ada/g-soccon-linux-mips.ads
1120===================================================================
1121--- /dev/null
1122+++ src/gcc/ada/g-soccon-linux-mips.ads
1123@@ -0,0 +1,184 @@
1124+------------------------------------------------------------------------------
1125+-- --
1126+-- GNAT COMPILER COMPONENTS --
1127+-- --
1128+-- G N A T . S O C K E T S . C O N S T A N T S --
1129+-- --
1130+-- S p e c --
1131+-- --
1132+-- Copyright (C) 2000-2005, Free Software Foundation, Inc. --
1133+-- --
1134+-- GNAT is free software; you can redistribute it and/or modify it under --
1135+-- terms of the GNU General Public License as published by the Free Soft- --
1136+-- ware Foundation; either version 2, or (at your option) any later ver- --
1137+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
1138+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
1139+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
1140+-- for more details. You should have received a copy of the GNU General --
1141+-- Public License distributed with GNAT; see file COPYING. If not, write --
1142+-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
1143+-- Boston, MA 02110-1301, USA. --
1144+-- --
1145+-- As a special exception, if other files instantiate generics from this --
1146+-- unit, or you link this unit with other files to produce an executable, --
1147+-- this unit does not by itself cause the resulting executable to be --
1148+-- covered by the GNU General Public License. This exception does not --
1149+-- however invalidate any other reasons why the executable file might be --
1150+-- covered by the GNU Public License. --
1151+-- --
1152+-- GNAT was originally developed by the GNAT team at New York University. --
1153+-- Extensive contributions were provided by Ada Core Technologies Inc. --
1154+-- --
1155+------------------------------------------------------------------------------
1156+
1157+-- This package provides target dependent definitions of constant for use
1158+-- by the GNAT.Sockets package (g-socket.ads). This package should not be
1159+-- directly with'ed by an applications program.
1160+
1161+-- This is the version for mips-linux, manually edited for the first shot
1162+-- no mips hardware at hand
1163+-- using http://www.gelato.unsw.edu.au/lxr/source/include/asm-mips/socket.h
1164+-- in order to find differents values
1165+-- This file is generated automatically, do not modify it by hand! Instead,
1166+-- make changes to gen-soccon.c and re-run it on each target.
1167+
1168+package GNAT.Sockets.Constants is
1169+
1170+ --------------
1171+ -- Families --
1172+ --------------
1173+
1174+ AF_INET : constant := 2; -- IPv4 address family
1175+ AF_INET6 : constant := 10; -- IPv6 address family
1176+
1177+ -----------
1178+ -- Modes --
1179+ -----------
1180+
1181+ SOCK_STREAM : constant := 1; -- Stream socket
1182+ SOCK_DGRAM : constant := 2; -- Datagram socket
1183+
1184+ -------------------
1185+ -- Socket errors --
1186+ -------------------
1187+
1188+ EACCES : constant := 13; -- Permission denied
1189+ EADDRINUSE : constant := 98; -- Address already in use
1190+ EADDRNOTAVAIL : constant := 99; -- Cannot assign address
1191+ EAFNOSUPPORT : constant := 97; -- Addr family not supported
1192+ EALREADY : constant := 114; -- Operation in progress
1193+ EBADF : constant := 9; -- Bad file descriptor
1194+ ECONNABORTED : constant := 103; -- Connection aborted
1195+ ECONNREFUSED : constant := 111; -- Connection refused
1196+ ECONNRESET : constant := 104; -- Connection reset by peer
1197+ EDESTADDRREQ : constant := 89; -- Destination addr required
1198+ EFAULT : constant := 14; -- Bad address
1199+ EHOSTDOWN : constant := 112; -- Host is down
1200+ EHOSTUNREACH : constant := 113; -- No route to host
1201+ EINPROGRESS : constant := 115; -- Operation now in progress
1202+ EINTR : constant := 4; -- Interrupted system call
1203+ EINVAL : constant := 22; -- Invalid argument
1204+ EIO : constant := 5; -- Input output error
1205+ EISCONN : constant := 106; -- Socket already connected
1206+ ELOOP : constant := 40; -- Too many symbolic lynks
1207+ EMFILE : constant := 24; -- Too many open files
1208+ EMSGSIZE : constant := 90; -- Message too long
1209+ ENAMETOOLONG : constant := 36; -- Name too long
1210+ ENETDOWN : constant := 100; -- Network is down
1211+ ENETRESET : constant := 102; -- Disconn. on network reset
1212+ ENETUNREACH : constant := 101; -- Network is unreachable
1213+ ENOBUFS : constant := 105; -- No buffer space available
1214+ ENOPROTOOPT : constant := 92; -- Protocol not available
1215+ ENOTCONN : constant := 107; -- Socket not connected
1216+ ENOTSOCK : constant := 88; -- Operation on non socket
1217+ EOPNOTSUPP : constant := 95; -- Operation not supported
1218+ EPFNOSUPPORT : constant := 96; -- Unknown protocol family
1219+ EPROTONOSUPPORT : constant := 93; -- Unknown protocol
1220+ EPROTOTYPE : constant := 91; -- Unknown protocol type
1221+ ESHUTDOWN : constant := 108; -- Cannot send once shutdown
1222+ ESOCKTNOSUPPORT : constant := 94; -- Socket type not supported
1223+ ETIMEDOUT : constant := 110; -- Connection timed out
1224+ ETOOMANYREFS : constant := 109; -- Too many references
1225+ EWOULDBLOCK : constant := 11; -- Operation would block
1226+
1227+ -----------------
1228+ -- Host errors --
1229+ -----------------
1230+
1231+ HOST_NOT_FOUND : constant := 1; -- Unknown host
1232+ TRY_AGAIN : constant := 2; -- Host name lookup failure
1233+ NO_DATA : constant := 4; -- No data record for name
1234+ NO_RECOVERY : constant := 3; -- Non recoverable errors
1235+
1236+ -------------------
1237+ -- Control flags --
1238+ -------------------
1239+
1240+ FIONBIO : constant := 16#667e#; -- Set/clear non-blocking io
1241+ FIONREAD : constant := 16#467f#; -- How many bytes to read
1242+
1243+ --------------------
1244+ -- Shutdown modes --
1245+ --------------------
1246+
1247+ SHUT_RD : constant := 0; -- No more recv
1248+ SHUT_WR : constant := 1; -- No more send
1249+ SHUT_RDWR : constant := 2; -- No more recv/send
1250+
1251+ ---------------------
1252+ -- Protocol levels --
1253+ ---------------------
1254+
1255+ SOL_SOCKET : constant := 1; -- Options for socket level
1256+ IPPROTO_IP : constant := 0; -- Dummy protocol for IP
1257+ IPPROTO_UDP : constant := 17; -- UDP
1258+ IPPROTO_TCP : constant := 6; -- TCP
1259+
1260+ -------------------
1261+ -- Request flags --
1262+ -------------------
1263+
1264+ MSG_OOB : constant := 1; -- Process out-of-band data
1265+ MSG_PEEK : constant := 2; -- Peek at incoming data
1266+ MSG_EOR : constant := 128; -- Send end of record
1267+ MSG_WAITALL : constant := 256; -- Wait for full reception
1268+ MSG_NOSIGNAL : constant := 16384; -- No SIGPIPE on send
1269+ MSG_Forced_Flags : constant := MSG_NOSIGNAL;
1270+ -- Flags set on all send(2) calls
1271+
1272+ --------------------
1273+ -- Socket options --
1274+ --------------------
1275+
1276+ TCP_NODELAY : constant := 1; -- Do not coalesce packets
1277+ SO_REUSEADDR : constant := 4; -- Bind reuse local address
1278+ SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs
1279+ SO_LINGER : constant := 16#80#; -- Defer close to flush data
1280+ SO_BROADCAST : constant := 16#20#; -- Can send broadcast msgs
1281+ SO_SNDBUF : constant := 16#1001#; -- Set/get send buffer size
1282+ SO_RCVBUF : constant := 16#1002#; -- Set/get recv buffer size
1283+ SO_SNDTIMEO : constant := 16#1005#; -- Emission timeout
1284+ SO_RCVTIMEO : constant := 16#1006#; -- Reception timeout
1285+ SO_ERROR : constant := 16#1007#; -- Get/clear error status
1286+ IP_MULTICAST_IF : constant := 32; -- Set/get mcast interface
1287+ IP_MULTICAST_TTL : constant := 33; -- Set/get multicast TTL
1288+ IP_MULTICAST_LOOP : constant := 34; -- Set/get mcast loopback
1289+ IP_ADD_MEMBERSHIP : constant := 35; -- Join a multicast group
1290+ IP_DROP_MEMBERSHIP : constant := 36; -- Leave a multicast group
1291+
1292+ -------------------
1293+ -- System limits --
1294+ -------------------
1295+
1296+ IOV_MAX : constant := 2147483647; -- Maximum writev iovcnt
1297+
1298+ ----------------------
1299+ -- Type definitions --
1300+ ----------------------
1301+
1302+ -- Sizes (in bytes) of the components of struct timeval
1303+
1304+ SIZEOF_tv_sec : constant := 4; -- tv_sec
1305+ SIZEOF_tv_usec : constant := 4; -- tv_usec
1306+
1307+end GNAT.Sockets.Constants;