install.doc 36 KB

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