home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / gnat_2 / !gcc / gnat / Help < prev    next >
Encoding:
Text File  |  1996-05-12  |  9.6 KB  |  257 lines

  1.                           GNAT
  2.                         ~~~~~~~~
  3.  
  4. This is a port of the GNAT (GNU/NYU Ada Translator) compiler (version
  5. 3.0.1) for the Ada programming language to the Acorn range of ARM based
  6. machines, running under RISC OS. As such, this package is covered by the
  7. FSF General Public License (see the files gnat.Copying and
  8. gnat.CopyingLib, and later for details).
  9.  
  10. This port is © 1995, 1996 Peter Burwood
  11.  
  12. As with as GNU programs, THERE IS NO WARRANTY OF ANY SORT
  13.  
  14. IMPORTANT: GNAT REQUIRES A LOT OF MEMORY. The wimpslot needs to be at
  15. least 6000K in size. GNAT is NOT capable of grabbing extra memory, so
  16. the initial WimpSlot sets the maximum memory available. GNAT can use
  17. dynamic areas on the Risc PC for the heap and stack and in this mode the
  18. wimpslot needs to be at least 3000K in size (though running from AMU can
  19. increase this). See Dynamic Areas below for further details.
  20.  
  21. Thanks go to various people for the help and assistance that they have
  22. given me. These are :
  23.  
  24. The GNAT development team for writing GNAT.
  25.  
  26. Nick Burrett, Simon Callen, Richard Earnshaw, Michael Ben-Gershon and
  27. Pietr Schonmaker, for most of the hard work involved in the ARM backend.
  28.  
  29. Niklas RÖjemo, for the assembler `as'
  30.  
  31. Huw Rogers and Simon Callen, for Unixlib.
  32.  
  33.  
  34. Files
  35. =====
  36.  
  37. There are over 900 files in the GNAT binary distribution, so I won't
  38. list them all, but the overall contents of this archive is as follows :-
  39.  
  40.    !gcc.adainc...        - Ada 95 standard library and GNAT extensions
  41.    !gcc.bin...           - GNAT binaries (see gnatinfo) and gcc binary
  42.    !gcc.gcc.adalib...    - object files for Ada library
  43.    !gcc.gcc.o.libgnat    - support library for GNAT using UnixLib
  44.    !gcc.gcc.o.libgnat_cc - support library for GNAT using SharedCLibrary
  45.    !gcc.gcc.o.libm       - empty maths library to stop complaints
  46.                            the functions are in UnixLib and stubs
  47.    !gcc.gnat             - documentation for GNAT
  48.    !gcc.gnat.examples    - examples from standard GNAT distribution
  49.                            included is a utility that works like Unix's
  50.                            rm command which is used by the makefile.
  51.  
  52.  
  53. Installation
  54. ============
  55.  
  56. Before attempting to use GNAT, it should be noted that this distribution
  57. of GNAT is not standalone, consisting of only the GNAT compiler, tools
  58. and library.
  59.  
  60. GNAT 3.01 requires GCC 2.7.2, as supplied by Nick Burrett and available
  61. from Acorn ftp sites such as Hensa, to be installed. Unpack this
  62. complete archive into the GCC 2.7.2 directory. Double click on !GCC to
  63. ensure the environment is correctly set for the compiler.
  64.  
  65. There is an replacement binary for !gcc.bin.gcc called !gcc.bin.gcc-gnat
  66. which should be copied over the original !gcc.bin.gcc file from the GCC
  67. 2.7.2 distribution (after taking a backup of the original file). This
  68. maybe necessary if the version from GCC 2.7.2 fails to work properly, by
  69. which I mean that running the makefile in the examples directory fails.
  70. This alternative binary is included because Nick Burrett sent me some
  71. changes for the gcc binary and I have just tried them and I can't get
  72. gcc working now. The version in this archive understands C, C++, Fortran
  73. and Ada filenames, so should work with those GNU compilers.
  74.  
  75. GNAT 3.01 also requires UnixLib 3.7a or later, but not UnixLib 4.0. GNAT
  76. will not work with UnixLib 3.6e. The following commands should be part
  77. of the !Run file that comes with GCC 2.7.2, but if not, then please add
  78. them before trying to use GNAT.
  79.  
  80.   | Set search paths for the Ada run time library files
  81.   *Set GNATada$Path <Obey$Dir>.adainc.
  82.   *Set GNATInc$Path gnatada:1.,gnatada:2.,gnatada:3.,gnatada:4.,gnatada:5.,gnatada:6.,gnatada:7.
  83.   *Set GNATlib$Path gcc:adalib.1.,gcc:adalib.2.,gcc:adalib.3.,gcc:adalib.4.,gcc:adalib.5.,gcc:adalib.6.,gcc:adalib.7.
  84.  
  85.   | Set search path for gnatbl
  86.   *SetMacro path "<Run$Path>"
  87.  
  88. GNAT uses the following filename extensions :-
  89.  
  90.    .ads   - Ada specifications (similar to C .h files).
  91.    .adb   - Ada bodies (similar to C .c files).
  92.    .adc   - The file gnat.adc can be used to override the normal file
  93.             naming convention (see !gcc.gnat.gnatinfo).
  94.    .ali   - GNAT's source code library support files (these are
  95.             generated by the compiler).
  96.    .xrs   - cross reference file for corresponding .ads file
  97.    .xrb   - cross reference file for corresponding .adb file
  98.  
  99. and these extensions must be included in the UnixFS$sfix environment
  100. variable. GCC 2.7.2's !Run file should already include these, but if not
  101. then change the '*Set UnixFS$sfix ...' to something like this :-
  102.  
  103.   *Set UnixFS$sfix "a:c:f:h:i:l:o:p:s:y:ads:adb:ali:adc:xrb:xrs"
  104.  
  105.  
  106. Using GNAT
  107. ==========
  108.  
  109. See the gnatinfo file in the gnat directory and the GCC-FAQ which is in
  110. the GCC 2.7.2 archive. Also look at the makefile in the gnat.examples
  111. directory which can be executed with amu. Ensure that you have a large
  112. enough WimpSlot, otherwise AMU will exit with a fatal error.
  113.  
  114.  
  115. Using the SharedCLibrary
  116. ========================
  117.  
  118. It is actually possible to use GNAT without UnixLib by using the
  119. SharedCLibrary and linking against Acorn's stubs. Do not try to use
  120. UnixLib and Acorn's stubs together in the same program - it will not
  121. work.
  122.  
  123. To use Acorn's stubs you will need Acorn's C compiler or a copy of
  124. gstubs from ftp sites such as Hensa. You must link with the libgnat_cc
  125. library instead of the libgnat library (these files are in !GCC.gcc.o).
  126. This can be accomplished by either replacing libgnat with libgnat_cc
  127. (after you have made a safe copy of libgnat) or by using
  128. "-mstubs -lgnat_cc" with gnatbl. The makefile in the examples directory
  129. has a line commented out which illustrates this method of using the
  130. SharedCLibrary. Simply uncomment this line and build the example
  131. programs with the makefile.
  132.  
  133.  
  134. File Name Rules
  135. ===============
  136.  
  137. The gnatinfo file explains how GNAT expects to find files. This naming
  138. convention is necessary for GNAT to find `with'ed units. Under RISC OS,
  139. the file name is crunched to 10 characters rather than 8 characters as
  140. with DOS. gnatk8 can be used to find out what the krunched name of a
  141. file should be by using `10' as the second argument to gnatk8.
  142.  
  143. File name rules can be overridden with the pragma Source_File_Name as
  144. described in gnatinfo.
  145.  
  146.  
  147. Dynamic Areas
  148. =============
  149.  
  150. I have modified UnixLib to use dynamic areas on the Risc PC and these
  151. modifications have been included in UnixLib 3.7a. This section applies
  152. to all GNU compilers supplied by either Nick Burrett, myself or
  153. (hopefully) anyone else providing they have used UnixLib 3.7a. A
  154. description of using dynamic areas is included with UnixLib 3.7a.
  155. Basically, use
  156.  
  157.   *Set GCC_Heap ""
  158.  
  159. to enable dynamic areas for the compiler and
  160.  
  161.   *UnSet GCC_Heap
  162.  
  163. to disable dynamic areas for the compiler.
  164.  
  165. Before running a program set the wimpslot in the normal way, but it only
  166. needs to be large enough to hold the sum of the largest executables that
  167. can be run concurrently. e.g., with gcc, use the unsqueezed size of gcc
  168. plus cc1. When running from a command line amu remember to allow
  169. additional space for the amu executable and amu's workspace (though this
  170. is tricky to estimate!).
  171.  
  172. If other programs that form part of GNAT are run directly from the
  173. command line, e.g., gnatmake, then separate environment variables must
  174. be set to allow these programs to use dynamic areas for the program's
  175. heap. So, with gnatmake,
  176.  
  177.    *Set gnatmake_heap ""
  178.  
  179.  
  180. Speeding up compilation
  181. =======================
  182.  
  183. If you have plenty of ram, then moving the Ada library units onto a ram
  184. disc should speed up compilations which "with" a lot of standard library
  185. units. This will require a ram disc of nearly 3MB, so is best done only
  186. if you have more than 20MB of ram. If the standard libraries are placed
  187. on the ram disc, then the GNATada$Path should be redefined to point to
  188. the ram disc. The Ada library units are the !gcc.adainc directory.
  189.  
  190. Placing the main compiler, gnat1, on the ram disc will also help,
  191. providing you have enough free ram. If gnat1 is put on the ram disc,
  192. then ensure that the ram location appears earlier in the run path.
  193.  
  194.  
  195. Known problems
  196. ==============
  197.  
  198. Known, damn if I'd known about them, I'd have fixed them. Please tell me
  199. all that you find and see below for how to contact me and the file
  200. !gcc.gnat.Bugs for what to do if you have found a bug.
  201.  
  202. Actually AMU behaviour is fun, see the examples directory for a working
  203. makefile.
  204.  
  205. RISC OS specific documentation is also lacking (i.e., no Intro file). It
  206. will improve soon.
  207.  
  208. GCC 2.4.5 produces incompatible code with 2.7.2 and that is simply that.
  209.  
  210.  
  211. Known Restrictions
  212. ==================
  213.  
  214. No tasking for RISC OS version, yet!
  215.  
  216. No interfaces specifications for the Wimp, though I am working on
  217. providing libraries. For the time being, implement a tight interface to
  218. the wimp with some high level C functions and write your own interface
  219. file.
  220.  
  221.  
  222. Pointers to Ada related items on the Web
  223. ========================================
  224.  
  225. The main GNAT ftp site is ftp://ftp.cs.nyu.edu:/pub/gnat.
  226.  
  227. Here are some WWW URL's for Ada. You can get to many other sites that
  228. have Ada related information from the first two pointers.
  229.  
  230.   Ada meta sites
  231.     http://www.cera.com/ada.htm
  232.   Home of the Brave Ada programmers
  233.     http://lglwww.epfl.ch/Ada/
  234.   Ada Lovelace tutorials
  235.     http://lglwww.epfl.ch/Ada/Tutorials/Lovelace/lovelace.html
  236.   AdaBasis - reusable component repository
  237.     http://www.informatik.uni-stuttgart.de/ifi/ps/ada-software/ada-software.html
  238.   Reusable Component Library
  239.     http://lglwww.epfl.ch/Components
  240.  
  241. See the end of the file !gcc.gnat.gnatinfo for some other pointers.
  242.  
  243.  
  244. Contacting me
  245. =============
  246.  
  247. If you wish to contact me, then I can be contacted as follows:
  248.  
  249. Peter Burwood
  250. 205 Masons Avenue
  251. Harrow
  252. Middlesex
  253. HA3 5AZ
  254.  
  255. Email: gnat@arcangel.demon.co.uk for gnat related queries
  256.        pjb@arcangel.demon.co.uk for anything else
  257.