install.doc 35 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150
  1. .\" $Header$
  2. .if n .nr PD 1v
  3. .if n .nr LL 78m
  4. .if n .ll 78m
  5. .TL
  6. Amsterdam Compiler Kit Installation Guide
  7. .AU
  8. Ed Keizer
  9. .AI
  10. Vakgroep Informatica
  11. Vrije Universiteit
  12. Amsterdam
  13. .NH
  14. Introduction
  15. .PP
  16. This document
  17. describes the process of installing Amsterdam Compiler Kit.
  18. It depends on your combination of hard- and software how
  19. hard it will be to install the Kit.
  20. This description is intended for a VAX running BSD 4.1
  21. .UX
  22. \.
  23. Installation on VAX BSD4.2/4.3 systems,
  24. Sun-2 or Sun-3 systems running Release 3.0 or newer, and some System V systems
  25. should be easy.
  26. Installation on PDP 11's running
  27. .UX
  28. Version 7, BSD 2.8, or 2.9
  29. should also be easy, as long
  30. as they have separate instruction and data space.
  31. Installation on machine's without this feature, like PDP 11/34,
  32. PDP 11/60 requires extensive surgery on some programs and is
  33. thought of as impossible.
  34. See section 7 for installation on other systems.
  35. .NH
  36. Restoring tree
  37. .PP
  38. The process of installing Amsterdam Compiler Kit is quite simple.
  39. It is important that the original Amsterdam Compiler Kit
  40. distribution tree structure is restored.
  41. Proceed as follows
  42. .IP " \-" 10
  43. Create a directory, for example /usr/em, on a device
  44. with at least 25 Megabytes left.
  45. .IP " \-"
  46. Change to that directory (cd ...); it will be the working directory.
  47. .IP " \-"
  48. Extract all files from the distribution medium, for instance
  49. magtape:
  50. \fBtar x\fP.
  51. .IP " \-"
  52. Keep a copy of the original distribution to be able to repeat the process
  53. of installation in case of disasters.
  54. This copy is also useful as a reference point for diff-listings.
  55. .LP
  56. .bp
  57. The directories in the tree contain the following information:
  58. .sp 1
  59. .nr PD 0
  60. .IP "bin" 14
  61. .br
  62. the few utilities that knot things together.
  63. See the section about "Commands".
  64. .IP "lib"
  65. .br
  66. root of a tree containing almost all binaries and libraries used by
  67. commands.
  68. All files specific to a certain machine are collected in one subtree
  69. per machine. E.g. "lib/pdp", "lib/z8000".
  70. The names used here are the same names as used for subtrees
  71. of "mach".
  72. .IP "lib/descr"
  73. .br
  74. Command descriptor files used by the program ack.
  75. .IP "lib/LLgen"
  76. .br
  77. Files used by the LL(1) Parser-generator.
  78. .br
  79. .IP "lib/ego"
  80. .br
  81. Files used by the global optimizer.
  82. .br
  83. .IP "etc"
  84. .br
  85. The main description of EM sits here.
  86. Files (e.g. em_table) describing
  87. the opcodes and pseudos in use,
  88. the operands allowed, effect in stack etc. etc.
  89. Make in this directory creates most of the files in "h"
  90. and "util/data".
  91. This make should only be called when the EM definition is
  92. changed.
  93. .IP "include/_tail_cc"
  94. .br
  95. Include files needed by modules
  96. in the C library from lang/cem/libcc.
  97. Especially needed for "stdio".
  98. .IP "inlude/_tail_mon"
  99. .br
  100. More or less system independent include files needed by modules
  101. in the library lang/cem/libcc/mon.
  102. .IP "h"
  103. .br
  104. The #include files for:
  105. .TS
  106. l l.
  107. arch.h Definition of the ACK archive format.
  108. as_spec.h Used by EM assembler and interpreters.
  109. bc_io.h Used by the Basic run-time system.
  110. bc_string.h Used by the Basic run-time system.
  111. cg_pattern.h Used by the backend program "cg" and its bootstrap.
  112. cgg_cg.h Used by the backend program "ncg" and its bootstrap.
  113. em_abs.h Contains trap numbers and address for lin and fil
  114. em_flag.h Definition of bits in array em_flag in lib/em_data.a
  115. Describes parameters effect on flow of instructions
  116. em_mes.h Definition of names for mes pseudo numbers
  117. em_mnem.h instruction => compact mapping.
  118. em_path.h Pathnames used by \fIack\fP, intended
  119. for all utilities
  120. em_pseu.h pseudo instruction => compact mapping
  121. em_ptyp.h Useful for compact code reading/writing,
  122. defines classes of parameters
  123. em_reg.h Definition of mnemonics indicating register type.
  124. em_spec.h Definition of constants used in compact code
  125. local.h Various definitions for local versions
  126. pc_err.h Definitions of error numbers in Pascal
  127. pc_file.h Macro's used in file handling in Pascal
  128. pc_size.h Sizes of objects used by Pascal compiler and
  129. run-time system.
  130. em_reg.h Definition of names for register types.
  131. ocm_chan.h Used by the occam run-time system
  132. ocm_parco.h Used by the occam run-time system
  133. ocm_proc.h Used by the occam run-time system
  134. .TE
  135. .IP "modules"
  136. .br
  137. root of a tree containing modules for compiler writers.
  138. .IP "modules/man"
  139. .br
  140. manual pages for all modules.
  141. .IP "modules/lib"
  142. .br
  143. contains module objects.
  144. .IP "modules/src"
  145. .br
  146. contains sources of the modules, each module in its own directory.
  147. .IP "modules/h"
  148. .br
  149. include files for some of the modules.
  150. .IP "modules/pkg"
  151. .br
  152. include files for some of the modules.
  153. .IP "doc"
  154. .br
  155. This directory contains the unformatted documents for the Kit.
  156. A list of the available documents can be found in the last section.
  157. .IP "doc/em"
  158. .br
  159. The EM-manual IR-81.
  160. .IP "doc/em/int"
  161. .br
  162. The EM interpreter written in Pascal.
  163. .IP "mkun"
  164. .br
  165. The PUBMAC macro package for nroff/troff from the Katholieke Universiteit at
  166. Nijmegen.
  167. It is used for the EM reference manual.
  168. The Makefile installs the macro package in
  169. /usr/lib/tmac.
  170. This package is in the public domain.
  171. .IP "mach"
  172. .br
  173. just there to group the directories with all sources for each machine.
  174. The section about "Machines" of this manual indicates which subdirectories
  175. are used for which systems.
  176. .br
  177. These directories have subdirectories named:
  178. .in +3n
  179. .TS
  180. l l.
  181. cg the backend (*.m => *.s)
  182. ncg the new backend (*.m => *.s)
  183. as the assembler (*.s => *.o) or
  184. assembler/linker (*.s + libraries => a.out)
  185. cv Conversion programs for a.out files.
  186. dl Down-load programs
  187. top the target optimizer
  188. libem Sources for EM runtime system, only depending on CPU type
  189. libbc Used to create Basic run-time system and libraries
  190. libcc Used to create C run-time system and libraries
  191. libpc Used to create Pascal run-time system and libraries
  192. liboc Used to create Occam run-time system and libraries
  193. libsys Sources for system-dependent EM library
  194. test Various tests
  195. int Source for an interpreter
  196. .TE
  197. .in -3n
  198. The directory proto contains files used by most machines,
  199. like machine-independent sources and Makefiles.
  200. .in +3n
  201. .TS
  202. l l.
  203. mach/proto/cg Current backend sources.
  204. mach/proto/ncg New backend sources.
  205. mach/proto/as Assembler sources.
  206. mach/proto/top Target optimizer sources.
  207. mach/proto/libg Makefile for compiling libraries.
  208. .TE
  209. .IP "emtest"
  210. .br
  211. Contains prototype of em test set.
  212. .IP "man"
  213. .br
  214. Man files for various utilities
  215. .IP "lang"
  216. .br
  217. Just there to group the directories for all front-ends
  218. .IP "lang/pc"
  219. .br
  220. Pascal front-end
  221. .IP "lang/pc/libpc"
  222. .br
  223. Source of Pascal run-time system (in EM or C)
  224. .IP "lang/pc/test"
  225. .br
  226. Some test programs written in Pascal
  227. .IP "lang/pc/pem"
  228. .br
  229. The Pascal compiler proper
  230. .IP "lang/cem"
  231. .br
  232. C front-end
  233. .IP "lang/cem/libcc"
  234. .br
  235. Directories with sources of C runtime system, libraries (in EM or C)
  236. .IP "lang/cem/libcc/gen"
  237. .br
  238. Sources for routines in chapter III of UNIX programmers manual,
  239. excluding Stdio
  240. .IP "lang/cem/libcc/stdio"
  241. .br
  242. Stdio sources
  243. .IP "lang/cem/libcc/mon"
  244. .br
  245. Sources for routines in chapter II, written in EM
  246. .IP "lang/cem/cemcom"
  247. .br
  248. The compiler proper
  249. .IP "lang/cem/ctest"
  250. .br
  251. C test set
  252. .IP "lang/cem/ctest/cterr"
  253. .br
  254. Programs developed for pinpointing previous errors
  255. .IP "lang/cem/ctest/ct*"
  256. .br
  257. The test programs.
  258. .IP "lang/basic/src"
  259. .br
  260. The compiler proper.
  261. .IP "lang/basic/lib"
  262. .br
  263. Basic run-time library source.
  264. .IP "lang/basic/test"
  265. .br
  266. Various Basic programs.
  267. .IP "lang/occam"
  268. .br
  269. Occam front-end.
  270. .IP "lang/occam/comp"
  271. .br
  272. The compiler proper.
  273. .IP "lang/occam/lib"
  274. .br
  275. Source of Occam run-time system (in EM or C).
  276. .IP "lang/occam/test"
  277. .br
  278. Some Occam programs.
  279. .IP "util"
  280. .br
  281. Contains directories with sources for various utilities
  282. .IP "util/ack"
  283. .br
  284. The program used for translation with the Kit.
  285. .IP "util/opt"
  286. .br
  287. EM peephole optimizer (*.k => *.m).
  288. .IP "util/ego"
  289. .br
  290. The global optimizer.
  291. .IP "util/topgen"
  292. .br
  293. The target optimizer generator..
  294. .IP "util/misc"
  295. .br
  296. Decode (*.[km] => *.e) + encode (*.e => *.k).
  297. .IP "util/data"
  298. .br
  299. The C-code for `lib/em_data.a`.
  300. These sources are created by the Makefile in `etc`.
  301. .IP "util/ass"
  302. .br
  303. The EM assembler (*.[km] + libraries => e.out).
  304. .IP "util/arch"
  305. .br
  306. The archivers to be used for ALL EM utilities.
  307. .IP "util/cgg"
  308. .br
  309. A program needed for compiling backends.
  310. .IP "util/ncgg"
  311. .br
  312. A program needed for compiling the newest backends.
  313. .IP "util/cpp"
  314. .br
  315. The C preprocessor.
  316. .IP "util/shf"
  317. .br
  318. Various shell files.
  319. .IP "util/LLgen"
  320. .br
  321. The extended LL(1) parser generator.
  322. .IP "util/amisc"
  323. .br
  324. Contains some programs handling ACK a.out format, such as anm, asize.
  325. .IP "util/cmisc"
  326. .br
  327. Contains some programs to help in resolving name conflicts, and
  328. a dependency generator for makefiles.
  329. .IP "util/led"
  330. .br
  331. The ACK link-editor, reading ACK relocatable a.out format, and writing
  332. ACK a.out format.
  333. .ne 4
  334. .LP
  335. All pathnames mentioned in the text of this document are relative to the
  336. ACK home directory, unless they start with '/'.
  337. .sp 1
  338. .NH
  339. Adapting ACK to your system
  340. .PP
  341. Before compiling the sources in the Kit some installation dependent
  342. actions have to be taken.
  343. Most of these are performed by an interactive shell script in the file
  344. .I first
  345. in a directory of the same name.
  346. .LP
  347. These actions are:
  348. .sp 1
  349. .IP \-
  350. Automatically checking whether you included the ACK bin directory in your
  351. shell PATH.
  352. See also the section on "commands".
  353. .IP \-
  354. Automatically setting the pathname of the parent directory in ../h/em_path.h.
  355. See also the section on "pathnames".
  356. .IP \-
  357. Discovering how to call
  358. .I cc
  359. to get it to include the
  360. .I lex
  361. library.
  362. .IP \-
  363. Asking you for the type of system you have
  364. and creating the shell script "ack_sys" in the Kit's bin directory.
  365. Several utilities make use of "ack_sys" to determine the type of
  366. system you have.
  367. The current choice is between:
  368. .sp 1
  369. .TS
  370. c c c
  371. l l l.
  372. answer system type default machine
  373. pdp_v7 PDP11 with sep I/D and version 7 pdp
  374. vax_bsd4_1a VAX11 with BSD4.1a vax4
  375. vax_bsd4_2 VAX11 with BSD4.2 vax4
  376. vax_sysV_2 VAX11 with System V.2 vax4
  377. pc_ix IBM PC with PC/IX i86
  378. m68_unisoft Motorola 68000 with Unisoft UNIX m68k2
  379. m68_pmds Philips PMDS pmds
  380. m68_sysV_0 68000 with Uniplus UNIX System V.0 mantra
  381. sun3 Sun 3 Motorola 68020 workstation sun3
  382. sun2 Sun 2 Motorola 68010 workstation sun2
  383. ANY Neither of the above m68k2
  384. .TE
  385. .sp 1
  386. For some of these, the installation procedure has not been tested, as
  387. we don't have them. However,
  388. the pdp_v7, vax_bsd4_1a, pc_ix, sun3 and m68 systems are known to behave
  389. reasonably.
  390. The Sun systems should run Release 3.0 or newer.
  391. For ANY you can use any name you fancy,
  392. but the Kit will not be able to compile programs for your system.
  393. If you want to do that you have to read the section about "compilation
  394. on a different machine".
  395. .IP \-
  396. Automatically setting the default machine for which code is
  397. produced to your own type of system according to the table above.
  398. This in done in the file "h/local.h".
  399. See also the section 8.2.
  400. .IP \-
  401. Automatically editing a few description files that tell
  402. ACK to use your system's assembler.
  403. On both the PDP and the VAX the Kit uses the native assembler and linker.
  404. The description files in lib/pdp/descr and
  405. lib/vax4/descr have to be altered to prevent
  406. attempts to assemble programs with unsuitable assemblers.
  407. The original descr files are copied to descr.orig.
  408. .IP \-
  409. The VAX backend cannot be booted on systems
  410. with a 16-bit address space systems.
  411. The program lib/cgg needs more memory than available to transform
  412. the table into files suitable for the C-compiler.
  413. Therefore files tables1.h and tables1.c have been provided in
  414. the directory mach/vax4/cg.
  415. These must be copied to tables.h and tables.c
  416. to get working code-generators for the VAX on PDP11's.
  417. You will hardly be able to use these, because the
  418. code generated by these programs cannot be
  419. assembled and loaded without a native VAX assembler,
  420. but its nice to be able to look at the code produced.
  421. The same problem occurs for the m68k2 backend and the m68020 backend,
  422. and the same solution is chosen.
  423. .IP \-
  424. On machines with a 16-bit address space, the C-compiler has no
  425. builtin preprocessor. Arangements are made to this effect.
  426. .IP \-
  427. On the PDP,
  428. .I ranlib
  429. is not used, because it does not work properly,
  430. at least, on our 2.9 BSD system it does'nt.
  431. This is done by creating a dummy shell script
  432. .I ranlib
  433. in the ACK bin directory.
  434. If you are sure that your
  435. .I ranlib
  436. does work properly, you can just remove the shell script before
  437. installing the Kit.
  438. .LP
  439. .sp 1
  440. Some actions still have to be done by hand.
  441. .sp 1
  442. .IP \-
  443. The installation of the PUBMAC macro package is not done
  444. automatically because you needs super-user privileges to do
  445. that on most systems.
  446. This macro package is used with several of the documents
  447. provided in the Kit.
  448. .IP \-
  449. UNIX V7 as originally distributed contains a few bugs that
  450. prevent correct execution of some of the larger programs.
  451. See the section named "Fixes for the UNIX V7 system"
  452. about what to do.
  453. Berkeley 2.8 or 2.9 may also have some of these bugs.
  454. .IP \-
  455. The manual files for the Kit can be copied to their
  456. appropriate place in the system by giving the command "make install"
  457. in the man directory, but only
  458. .B after
  459. running the installation of the
  460. Kit itself.
  461. .NH
  462. Compiling the Kit
  463. .PP
  464. The next step in the installation process is to compile
  465. the sources in the Kit and install them in their places
  466. in the lib and bin directories.
  467. .PP
  468. Most directories containing sources have Makefiles
  469. used to compile and install the programs in that
  470. directory.
  471. All programs needed for compilation and/or cross compilation
  472. with the Kit are installed in the directories "bin" and "lib"
  473. by these Makefiles.
  474. These Makefiles adhere to a standard which is described in the
  475. section 9.
  476. .LP
  477. You do not have to start all these Makefiles separately.
  478. We wrote a shell script calling the make's needed to install
  479. the whole Kit.
  480. This script consists of the file TakeAction in the Kit's root
  481. directory and a few files called Action in some directories.
  482. The Action files describe in a very simple form which actions
  483. have to be performed in which directories.
  484. The default action is to start "make install".
  485. The output of each make is diverted to a file called "Out"
  486. in the same directory as the make was started in.
  487. If the make was successful (return code 0) the Out file is removed
  488. and the script TakeAction produces a small message telling you
  489. that it succeeded in fulfilling its goal.
  490. If the make was not successful (any other return code) the Out file
  491. is left alone for further examination and a small message telling you
  492. to look at that file is produced by TakeAction.
  493. .LP
  494. For some programs the scripts already know they can't be
  495. installed on your type of system.
  496. In that case they produce a message "Sorry, ....." and
  497. happily proceed with further installation commands.
  498. .PP
  499. Compilation of the whole Kit might take anything from a few
  500. hours to more than a day.
  501. If you do not want to install libraries etc. for a particular
  502. machine you can edit the file Action and remove the relevant entries.
  503. .PP
  504. If this compilation went reasonably successful you should be able
  505. to use the Kit.
  506. Read the next section and the manuals provided
  507. with the Kit (in the man directory) on how to use it.
  508. .NH 2
  509. Problems you may meet
  510. .NH 3
  511. on Unisoft m68000 systems.
  512. .PP
  513. The Unisoft C compiler has a bug which impedes the correct
  514. translation of the peephole optimizer.
  515. For a more detailed description of this phenomenen see
  516. the file "mach/m68k2/Unisoft_bug".
  517. .NH 3
  518. with backends
  519. .PP
  520. The backends for the PDP11, VAX with BSD4.1, Motorola 68000 and
  521. Intel 8086 have been heavily used by ourselves and are well tested.
  522. The backends for the other machines are known to run our own
  523. test programs,
  524. but might reveal errors when more heavily used.
  525. .NH 2
  526. An example output of TakeAction.
  527. .PP
  528. .DS
  529. System definition -- done
  530. EM definition -- done
  531. LL(1) Parser generator -- done
  532. EM definition library -- done
  533. C utilities -- done
  534. system-call interface module -- done
  535. string routines module -- done
  536. formatted print module -- done
  537. assertion module -- done
  538. memory allocation module -- done
  539. fast, linear time malloc -- done
  540. EM messages generation module -- done
  541. identifier table module -- done
  542. input module -- done
  543. ACK-object reading and writing module -- done
  544. EM-code reading module -- done
  545. EM code generation module -- done
  546. Modules -- done
  547. C preprocessor -- done
  548. ACK object utilities -- done
  549. Encode/Decode -- done
  550. Shell files in bin -- done
  551. EM assembler -- done
  552. EM Peephole optimizer -- done
  553. .
  554. .
  555. .
  556. EM Global optimizer -- done
  557. ACK archiver -- done
  558. Program 'ack' -- done
  559. Bootstrap for backend tables -- done
  560. Bootstrap for newest form of backend tables -- done
  561. LED link editor -- done
  562. TOPGEN target optimizer generator -- done
  563. C frontend -- done
  564. Basic frontend -- done
  565. Occam frontend -- done
  566. Intel 8086 assembler -- done
  567. Intel 8086 backend -- done
  568. Intel 8086 C libraries -- done
  569. Intel 8086 EM library -- done
  570. Intel 8086 Pascal library -- done
  571. Intel 8086 PC/IX systemcall library -- done
  572. Intel 8086 Basic library -- done
  573. Intel 8086 Occam library -- done
  574. Intel 8086 conversion program from ack.out --> PC/IX a.out -- done
  575. Intel 8086 support -- done
  576. .
  577. .
  578. .
  579. Motorola 68000 assembler -- done
  580. Motorola 68000 2-4 backend -- done
  581. Motorola 68000 2-4 conversion program -- done
  582. Motorola 68000 target optimizer -- done
  583. Motorola 68000 2-4 C libraries -- done
  584. Motorola 68000 2-4 EM library -- done
  585. Motorola 68000 2-4 Pascal library -- done
  586. Motorola 68000 2-4 System library -- done
  587. Motorola 68000 2-4 Basic library -- done
  588. Motorola 68000 2-4 Occam library -- done
  589. Sorry, Motorola 68000 interpreters can only be made on m68* systems
  590. Motorola 68000 2-4 support -- done
  591. .
  592. .
  593. .
  594. PDP 11 assembler -- done
  595. PDP 11 backend -- done
  596. PDP 11 target optimizer -- done
  597. Sorry, PDP 11 interpreter can only be made on pdp* systems
  598. Sorry, PDP 11 C libraries can only be made on pdp* systems
  599. Sorry, PDP 11 EM library can only be made on pdp* systems
  600. Sorry, PDP 11 systemcall library can only be made on pdp* systems
  601. Sorry, PDP 11 Pascal library can only be made on pdp* systems
  602. Sorry, PDP 11 Basic library can only be made on pdp* systems
  603. Sorry, PDP 11 Occam library can only be made on pdp* systems
  604. PDP 11 support -- done
  605. .
  606. .
  607. .
  608. Vax 4-4 backend -- done
  609. Sorry, Vax 4-4 C libraries can only be made on vax* systems
  610. Sorry, Vax 4-4 EM library can only be made on vax* systems
  611. Sorry, Vax 4-4 Occam library can only be made on vax* systems
  612. Sorry, Vax 4-4 Basic library can only be made on vax* systems
  613. Sorry, Vax 4-4 systemcall interface can only be made on vax* systems
  614. Vax target optimizer -- done
  615. Vax 4-4 support -- done
  616. M68020 assembler -- done
  617. M68020 backend -- done
  618. M68020 EM library -- done
  619. M68020 system call library -- done
  620. M68020 C libraries -- done
  621. M68020 PC library -- done
  622. M68020 Basic library -- done
  623. M68020 Occam library -- done
  624. Sorry, M68020 VME131 System V/68 R2V2.1 conversion can only be made on m68020 systems
  625. M68020 System V/68 support -- done
  626. Ack.out --> Sun 3 M68020 a.out format conversion program -- done
  627. Sun 3 M68020 systemcall library -- done
  628. Sun 3 M68020 C libraries -- done
  629. Sun 3 M68020 support -- done
  630. Ack.out --> Sun 2 M68000 a.out format conversion program -- done
  631. Sun 2 M68000 systemcall library -- done
  632. Sun 2 M68000 C libraries -- done
  633. Sun 2 M68000 support -- done
  634. .
  635. .
  636. .
  637. Failed for Pascal frontend, see lang/pc/pem/Out
  638. .DE
  639. .PP
  640. The lines starting with "Sorry, " tell you that certain programs cannot
  641. be translated on your machine.
  642. The lines starting with "Failed for" tell
  643. you that certain programs/libraries which were expected to,
  644. but did not compile.
  645. Only the Pascal frontend failed to compile in this example.
  646. If you want to repeat a certain part of the installation, look in
  647. the Action file for the directory in which that part is to be found.
  648. If that directory contains an Action file issue the command
  649. "sh EM_DIR/TakeAction", otherwise type "make install".
  650. .NH
  651. Commands
  652. .PP
  653. The following commands are available in the bin directory after compilation
  654. of the Kit:
  655. .sp 1
  656. .IP "\fIack\fP, \fIacc\fP, \fIabc\fP, \fIapc\fP, \fIocm\fP and their links"
  657. .br
  658. The names mentioned here can be used to compile Pascal, C, etc... programs.
  659. Most of the links can be used to generate code for a particular
  660. machine.
  661. See also the section about "Machines".
  662. .IP \fIarch\fP
  663. .br
  664. The archiver used for the EM- and universal assembler/loader.
  665. .IP \fIaal\fP
  666. .br
  667. The archiver used for ACK objects.
  668. .IP \fIem\fP
  669. .br
  670. This program selects a interpreter to execute an e.out file.
  671. Interpreters exist for PDP-11 and Motorola 68000 systems.
  672. .IP \fIeminform\fP
  673. .br
  674. The program to unravel the post-mortem information of
  675. the EM interpretator for the PDP-11.
  676. .IP \fILLgen\fP
  677. .br
  678. The LL(1) parser generator.
  679. .IP \fIack_sys\fP
  680. .br
  681. A shell script producing an identification of your system.
  682. Used by some utilities to determine what is, and what is
  683. not feasible on your system. (Like translating PDP assembly).
  684. .IP \fImarch\fP
  685. .br
  686. A shell script used while compiling libraries.
  687. .IP "\fIasize\fP, \fIanm\fP, \fIastrip\fP"
  688. .br
  689. Do the same as \fIsize\fP, \fInm\fP and \fIstrip\fP, but for ACK object format.
  690. .IP \fImkdep\fP
  691. .br
  692. A dependency generator for makefiles.
  693. .IP "\fIcid\fP, \fIprid\fP, \fIcclash\fP"
  694. .br
  695. Some utilities for handling name clashes in C programs. Some
  696. systems have C-compilers with only 7 or 8 characters significant in
  697. identifiers.
  698. .sp 1
  699. .LP
  700. We currently make the Kit available to our users by telling
  701. them that they should include the bin directory of the Kit in
  702. their PATH shell variable.
  703. The programs will still work when moved to a different
  704. directory or linked to.
  705. Copying should preferably be done with tar, since links are
  706. heavily used.
  707. Renaming of the programs linked to \fIack\fP will not always
  708. produce the desired result.
  709. This program uses its call name as an argument.
  710. Any call name not being \fIcc\fP, \fIacc\fP, \fIabc\fP, \fIpc\fP or \fIapc\fP will be
  711. interpreted as the name of a 'machine description' and the
  712. program will try to find a description file with that name.
  713. The installation process will only touch the utilities in the Kit's bin
  714. directory, not your own copies.
  715. .NH
  716. Machines
  717. .PP
  718. Underneath you will find a table with entries for all commands in
  719. the bin directory used to (cross)compile for a particular machine.
  720. The name in the first column give the name in the bin directory.
  721. The column headed dir indicates which subdirectories of
  722. lib are needed for compilation.
  723. The column head i/p contains the integer and pointer size used in units of
  724. bytes.
  725. The subdirectories with the same name in mach contain the sources.
  726. A * in the column headed 'fp' indicates whether floating point can be used
  727. for that particular machine.
  728. .TS
  729. c c c c c c c
  730. l l l l l l l.
  731. command system i/p languages fp dir remarks
  732. pdp PDP/UNIX V7 2/2 C * pdp needs sep. I/D
  733. Pascal No assembler
  734. Basic
  735. Occam
  736. vax4 VAX/BSD 4.? 4/4 C * vax4 No assembler
  737. System V.2 Pascal
  738. Basic
  739. Occam
  740. m68k2 M68000/Unisoft 2/4 C m68k2
  741. Pascal
  742. Basic
  743. Occam
  744. m68k4 M68000/Unisoft 4/4 C m68k4
  745. Pascal m68k2
  746. Basic
  747. Occam
  748. pmds M68000/PMDS 2/4 C pmds Philips Micro
  749. Pascal m68k2 Devel. System
  750. Basic
  751. Occam
  752. pmds4 M68000/PMDS 4/4 C pmds4 Philips Micro
  753. Pascal m68k2 Devel. System
  754. Basic m68k4
  755. Occam
  756. mantra M68000/SysV.0 4/4 C mantra
  757. Pascal m68k2
  758. Basic m68k4
  759. Occam
  760. m68020 M68020/V/68 4/4 C m68020
  761. R2V2.1 Pascal
  762. Basic
  763. Occam
  764. sun3 SUN 3 R3.0 4/4 C sun3
  765. Pascal m68020
  766. Basic
  767. Occam
  768. sun2 SUN 2 R3.0 4/4 C sun2
  769. Pascal m68k4
  770. Basic m68k2
  771. Occam
  772. i86 IBM PC/IX 2/2 C i86 IBM PC with PC/IX
  773. Pascal Causes kernel crashes
  774. Basic
  775. Occam
  776. z8000 Zilog 8000 2/2 C z8000 Central Data
  777. Pascal CPU board
  778. Basic Uses assembler/loader
  779. Occam
  780. int Same as int22
  781. int22 EM machine 2/2 C * int22 Needs interpreter
  782. Pascal
  783. Basic
  784. Occam
  785. int24 EM machine 2/4 C * int24 Needs interpreter
  786. Pascal
  787. Basic
  788. Occam
  789. int44 EM machine 4/4 C * int44 Needs interpreter
  790. Pascal
  791. Basic
  792. Occam
  793. 6500 6502/BBC 2/2 C 6500 Uses assembler/loader
  794. Pascal
  795. Basic
  796. Occam
  797. 6800 Bare 6800 6800 Assembler only
  798. 6805 Bare 6805 6805 Assembler only
  799. 6809 Bare 6809 6809 Assembler only
  800. ns Bare NS16032 4/4 C ns
  801. Pascal
  802. Basic
  803. Occam
  804. i80 Hermac/z80 2/2 C i80
  805. Pascal
  806. Basic
  807. Occam
  808. z80 Hermac/z80 2/2 C z80 \fIi80\fP is faster
  809. Pascal
  810. Basic
  811. Occam
  812. s2650 Signetics 2650 s2650 Assembler only
  813. .TE
  814. .PP
  815. The commands \fBint\fP, \fBint22\fP, \fBint24\fP and \fBint44\fP
  816. produce e.out files with EM machine code which must be interpreted.
  817. The Kit contains two interpreters: one running under PDP 11/V7 UNIX,
  818. and one for the M68000, running under the PMDS system, SUN systems,
  819. the Mantra system, etc.
  820. The first one can only interpret 2/2 e.out files,
  821. the other takes 2/4 and 4/4 files.
  822. The PDP 11 interpreter executes floating point instructions.
  823. The interpreter on the PMDS traps if you try to use floating point.
  824. .LP
  825. The program \fBem\fP in the bin directory calls the appropriate
  826. interpreter.
  827. The interpreters are sought in the int22, int24 and int44
  828. subdirectories of lib.
  829. .NH
  830. Compilation on a different machine.
  831. .PP
  832. The Kit be installed and used as a cross-compiler
  833. for C and Basic programs on any UNIX machine.
  834. The presence of most UNIX utilities is essential for compilation.
  835. A few of the programs you certainly need are: C-compiler, Yacc, sed,
  836. make and lex.
  837. Except for the Pascal compiler proper all programs
  838. can be translated on a normal UNIX system, like V7, BSD4.1.
  839. .NH 2
  840. Backend
  841. .PP
  842. The existence of a backend with a system call library
  843. for your system is essential
  844. if you wish to produce executable files for that system.
  845. Rewriting the system call library if the one supplied does
  846. not work on your system is fairly straightforward.
  847. If no backend exists for your CPU type you have to write one yourself
  848. which is a major undertaking.
  849. .NH 2
  850. Pascal
  851. .PP
  852. When you can produce executable code it is also possible to boot the Pascal
  853. Compiler,
  854. which is written in Pascal itself.
  855. The Kit contains the compact code files for the 2/2, 4/4 and 2/4
  856. versions of the Pascal compiler.
  857. The Makefile automatically tries to boot the Pascal compiler
  858. from one of these compact code files, if the compiler proves
  859. unable to compile itself.
  860. .NH 2
  861. Universal assembler/loader, link editor
  862. .PP
  863. The native assemblers and loaders are used on PDP-11 and VAX.
  864. The description files in lib/*/descr for other systems use our
  865. universal assembler and for most machines our link editor.
  866. The load file produced is not directly
  867. usable in any system known to us,
  868. but has to be converted before it can be put to use.
  869. The \fIcv\fP programs convert our a.out format into
  870. executable files.
  871. The \fIdl\fP programs present for some machines unravel
  872. our a.out files and transmit commands to load memory
  873. to a microprocessor over a serial line.
  874. The file man/ack.out.5 contains a description of the format of
  875. the universal assembler load file.
  876. It might be useful to those who wish or need to write their
  877. own conversion programs.
  878. Also, a module is included to read and write our a.out format.
  879. See modules/man/object.3.
  880. .NH 2
  881. Compiling libraries
  882. .PP
  883. The Kit contains sources for part II and III of the C-library.
  884. These files can be used to make libraries for the Ack C-compiler.
  885. The recompilation process uses a few include files.
  886. The include directory in the EM home directory contains the include files
  887. it needs.
  888. An effort has been made to make the part III stuff as system independent as
  889. possible.
  890. .NH
  891. Options
  892. .NH 2
  893. Default machine
  894. .PP
  895. There is one important option in h/local.h.
  896. The utility \fIack\fP uses a default machine name when called
  897. as \fIacc\fP, \fIcc\fP, \fIabc\fP, \fIapc\fP, \fIpc\fP, \fIocm\fP, or \fIack\fP.
  898. The machine name used for default is determined by the
  899. definition of ACKM in h/local.h.
  900. The Kit is distributed with "vax4" as the default machine,
  901. but the shell script "first" in the directory "first" alters this
  902. to suit your own system.
  903. There is nothing against using the Kit as a cross-compiler
  904. and by default produce code that can't run on your own system.
  905. But...., you have to alter the Makefile for the Pascal frontend
  906. in that case.
  907. That Makefile assumes that calling \fBapc\fP and \fBacc\fP will
  908. produce a.out's that can run on your own system.
  909. Change the definitions of ACC and APC in that Makefile according to your
  910. needs.
  911. .NH 2
  912. Pathnames
  913. .PP
  914. Absolute pathnames are concentrated in "h/em_path.h".
  915. Only the Pascal runtime system and the utilities \fIack\fP and \fILLgen\fP use
  916. absolute pathnames to access files in the Kit.
  917. The tree is distributed with /usr/em as the working
  918. directory.
  919. The definition of EM_DIR in em_path.h should be altered to
  920. specify the root
  921. directory for the Compiler Kit distribution on your system.
  922. This is done automatically the the shell script "first" in the
  923. directory "first".
  924. Em_path.h also specifies which directory should be used for
  925. temporary files.
  926. Most programs from the Kit do indeed use that directory
  927. although some remain stubborn and use /tmp or /usr/tmp.
  928. .LP
  929. The shape of the tree should not be altered lightly because
  930. most Makefiles and the
  931. utility \fIack\fP know the shape of the ACK tree.
  932. All pathnames in all Makefiles are relative, that is do not
  933. have "/" as the first character.
  934. The knowledge of the utility \fIack\fP about the shape of the tree is
  935. concentrated in the files in the directory lib/*/descr and lib/descr/*.
  936. .NH
  937. Makefiles
  938. .PP
  939. Most directories contain a "Makefile".
  940. Apart from commands applying to that specific directory these
  941. files all recognize a few special commands.
  942. When called with one of these they will apply the command to
  943. their own directory and all subdirectories.
  944. The special commands are:
  945. .sp 1
  946. .IP "install" 20
  947. recompile and install all binaries and libraries.
  948. .br
  949. Some Makefiles allow errors to occur in the programs they call.
  950. They ignore such errors and notify the user with the message
  951. "~....... error code n: ignored".
  952. Whenever such a message appears in the output you can ignore it
  953. too.
  954. .IP "cmp"
  955. recompile all binaries and libraries and compare them to the
  956. ones already installed.
  957. .IP pr
  958. print the sources and documentation on the standard output.
  959. .IP opr
  960. make pr | opr
  961. .br
  962. Opr should be an off-line printer daemon.
  963. On some systems it exists under another name e.g. lpr.
  964. The easiest way to call such a spooler is using a shell script
  965. with the name opr that calls lpr.
  966. This script should be placed in /usr/bin or EM_DIR/bin or
  967. one of the directories in your PATH.
  968. .IP clean
  969. remove all files not needed for day-to-day use,
  970. that is binaries not in bin or lib, object files etc.
  971. .LP
  972. Example:
  973. .nf
  974. .sp 1
  975. make install
  976. .sp 1
  977. .fi
  978. given as command in the home directory will cause
  979. compilation of all programs in the directory and copying of the results
  980. to the bin and lib directories.
  981. .NH
  982. Fixes for the UNIX V7 system
  983. .PP
  984. UNIX System V7 has a few bugs that prevent a part of or the whole Kit
  985. from working properly. Berkeley 2.8 and/or 2.9 may also suffer from this
  986. problem.
  987. To be honest, we do not know which of the following changes are
  988. essential to the functioning of our Kit. The change to "ld" is.
  989. .PP
  990. The file "doc/v7bugs.doc" gives for each of the following bugs
  991. a small test program and a diff listing of the source files that have to be
  992. modified.
  993. .IP 1
  994. Bug in the C optimizer for unsigned comparison
  995. .nr PD 0
  996. .IP 2
  997. The loader 'ld' fails for large data and text portions
  998. .IP 3
  999. Floating point registers are not saved if more memory is needed.
  1000. .IP 4
  1001. Floating point registers are not copied to child in fork().
  1002. .nr PD 1v
  1003. .LP
  1004. Use the test programs to see if the errors are present in your system
  1005. and to check if the modifications are effective.
  1006. .PP
  1007. You may also have to change /usr/src/cmd/cc.c (/bin/cc) to pass the
  1008. .B -i
  1009. flag to
  1010. .I ld.
  1011. Also, /usr/src/cmd/ld.c (/bin/ld) may have to be changed to increase the
  1012. number of library positions it can hold.
  1013. On our (2.9 BSD) version, this is the constant
  1014. .I NROUT.
  1015. It must be at least 400.
  1016. This may require separate I&D.
  1017. Also, our version does not check that the table does not overflow.
  1018. .NH
  1019. Testing
  1020. .PP
  1021. Test sets are available in Pascal, C, Basic and EM assembly.
  1022. .IP em 8
  1023. .br
  1024. The directory emtest contains a few EM test programs.
  1025. The EM assembly files in these tests must be transformed into
  1026. load files.
  1027. These tests use the LIN and NOP instructions to mark the passing of each
  1028. test.
  1029. The NOP instruction prints the current line number during the
  1030. test phase.
  1031. Each test notifies its correctness by calling LIN with a unique
  1032. number followed by a NOP which prints this line number.
  1033. The test finishes normally with 0 as the last number printed
  1034. In all other cases a bug showed its
  1035. existence.
  1036. .IP Pascal
  1037. .br
  1038. The directory lang/pc/test contains a few Pascal test programs.
  1039. All these programs print the number of errors found and a
  1040. identification of these errors.
  1041. .sp 1
  1042. .ti +4
  1043. We also tested Pascal with the Validation Suite.
  1044. The Validation Suite is a collection of more than 200 Pascal programs,
  1045. designed by Brian Wichmann and Arthur Sale to test Pascal compilers.
  1046. We are not allowed to distribute it, but you may
  1047. request a copy from
  1048. .DS
  1049. Richard J. Cichelli
  1050. A.N.P.A.
  1051. 1350 Sullivan Trail
  1052. P.O. Box 598
  1053. Easton, Pennsylvania 18042
  1054. USA
  1055. .DE
  1056. .IP C
  1057. .br
  1058. The sub-directories in lang/cem/ctest contain C test programs.
  1059. The idea behind these tests is:
  1060. when you have a program called xx.c, compile it into xx.cem.
  1061. Run it with standard output to xx.cem.r, compare this file to
  1062. xx.cem.g, a file containing the 'ideal' output.
  1063. Any differences will point to implementation differences or
  1064. bugs.
  1065. Giving the command "run gen" or plain "run" starts this
  1066. process.
  1067. The differences will be presented on standard output.
  1068. The contents of the result files depend on the wordsize,
  1069. the xx.cem.g files on the distribution are intended for a
  1070. 32-bit machine.
  1071. .IP Basic
  1072. .br
  1073. The directory lang/basic/test contains some forty basic programs.
  1074. Not all of these programs are correct, some have syntactic errors,
  1075. some simply don't work.
  1076. The Makefile in that directory attempts to compile and run
  1077. these tests.
  1078. If it compiles its output is compared to a file with suffix .g
  1079. which contains the output to be expected.
  1080. The make should be started with its standard input diverted
  1081. to /dev/null.
  1082. An example of the output of a make is present in the file Out.std.
  1083. .NH
  1084. Documentation
  1085. .PP
  1086. Manual pages for Amsterdam Compiler Kit can be copied
  1087. to "/usr/man/man?" by the
  1088. following commands:
  1089. .DS
  1090. cd man
  1091. make install
  1092. .DE
  1093. but do this \fBafter\fR compiling the Kit.
  1094. .LP
  1095. Several documents are provided:
  1096. .TS
  1097. l l.
  1098. doc/toolkit.doc general overview (CACM article)
  1099. doc/em description of the EM machine architecture
  1100. doc/ack.doc format of machine description files (lib/*/descr)
  1101. doc/basic.doc Basic reference manual
  1102. doc/pcref.doc Pascal-frontend reference manual
  1103. doc/val.doc results of running the Pascal Validation Suite
  1104. doc/crefman.doc C-frontend description
  1105. doc/LLgen description of the LL(1) parser generator.
  1106. doc/peep.doc internal documentation for the peephole optimizer
  1107. doc/cg.doc documentation for backend writers and maintainers
  1108. doc/regadd.doc addendum to previous document describing register variables
  1109. doc/ncg.doc documentation for the newest backends
  1110. doc/v7bugs.doc bugs in the V7 system and how to fix them
  1111. doc/6500.doc MSC 6500 backend description.
  1112. doc/i80.doc Intel 8080 backend description.
  1113. doc/z80.doc Zilog Z80 backend description.
  1114. doc/m68020.doc Motorola M68000/M68020 backend description
  1115. doc/occam Occam-frontend description
  1116. doc/ego Global Optimizer description
  1117. doc/top Target Optimizer description
  1118. doc/install.doc this document
  1119. doc/install.pr this document (formatted)
  1120. .TE
  1121. .PP
  1122. The names in this list without a suffix are in fact a subdirectory.
  1123. Use the Makefile to get readable copies.
  1124. .LP
  1125. Good luck.