annotate lwcc/README.txt @ 290:c648fc4bd006 ccdev

Updated lwcc README with info on the runtime support files Added description of -B and the runtime support files required for the lwcc program.
author William Astle <lost@l-w.ca>
date Sun, 08 Sep 2013 16:55:59 -0600
parents d9631a9a5b61
children 40ecbd5da481
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
286
d9631a9a5b61 Set up for lwcc development with README file.
William Astle <lost@l-w.ca>
parents:
diff changeset
1 This is the lwcc C compiler for lwtools. It was written using various other
d9631a9a5b61 Set up for lwcc development with README file.
William Astle <lost@l-w.ca>
parents:
diff changeset
2 C compilers as guides. Special thanks to the developers of the PCC compiler.
d9631a9a5b61 Set up for lwcc development with README file.
William Astle <lost@l-w.ca>
parents:
diff changeset
3 While none of the actual code from PCC was actually used, much of compiler
d9631a9a5b61 Set up for lwcc development with README file.
William Astle <lost@l-w.ca>
parents:
diff changeset
4 itself served as a template for creating lwcc.
d9631a9a5b61 Set up for lwcc development with README file.
William Astle <lost@l-w.ca>
parents:
diff changeset
5
d9631a9a5b61 Set up for lwcc development with README file.
William Astle <lost@l-w.ca>
parents:
diff changeset
6 This directory is arranged as follows:
d9631a9a5b61 Set up for lwcc development with README file.
William Astle <lost@l-w.ca>
parents:
diff changeset
7
d9631a9a5b61 Set up for lwcc development with README file.
William Astle <lost@l-w.ca>
parents:
diff changeset
8 driver/
d9631a9a5b61 Set up for lwcc development with README file.
William Astle <lost@l-w.ca>
parents:
diff changeset
9
d9631a9a5b61 Set up for lwcc development with README file.
William Astle <lost@l-w.ca>
parents:
diff changeset
10 This contains the source for the front end driver program which will be
d9631a9a5b61 Set up for lwcc development with README file.
William Astle <lost@l-w.ca>
parents:
diff changeset
11 called "lwcc" and is the public face of the compiler. The lwcc program
d9631a9a5b61 Set up for lwcc development with README file.
William Astle <lost@l-w.ca>
parents:
diff changeset
12 itself provides various options that are largely compatible with unix C
d9631a9a5b61 Set up for lwcc development with README file.
William Astle <lost@l-w.ca>
parents:
diff changeset
13 compilers like gcc. It should be noted that the internal interface between
d9631a9a5b61 Set up for lwcc development with README file.
William Astle <lost@l-w.ca>
parents:
diff changeset
14 the lwcc driver and its back end programs (the preprocessor and compiler
d9631a9a5b61 Set up for lwcc development with README file.
William Astle <lost@l-w.ca>
parents:
diff changeset
15 proper) is unspecified and subject to change without notice. The assembler
d9631a9a5b61 Set up for lwcc development with README file.
William Astle <lost@l-w.ca>
parents:
diff changeset
16 and linker (lwasm, lwlink) do have defined public interfaces are are not
d9631a9a5b61 Set up for lwcc development with README file.
William Astle <lost@l-w.ca>
parents:
diff changeset
17 likely to change substantially.
d9631a9a5b61 Set up for lwcc development with README file.
William Astle <lost@l-w.ca>
parents:
diff changeset
18
d9631a9a5b61 Set up for lwcc development with README file.
William Astle <lost@l-w.ca>
parents:
diff changeset
19
d9631a9a5b61 Set up for lwcc development with README file.
William Astle <lost@l-w.ca>
parents:
diff changeset
20 liblwcc/
d9631a9a5b61 Set up for lwcc development with README file.
William Astle <lost@l-w.ca>
parents:
diff changeset
21
d9631a9a5b61 Set up for lwcc development with README file.
William Astle <lost@l-w.ca>
parents:
diff changeset
22 This contains any runtime libraries the compiler needs to support its
d9631a9a5b61 Set up for lwcc development with README file.
William Astle <lost@l-w.ca>
parents:
diff changeset
23 output. This is usually assembly routines to support complex operations not
d9631a9a5b61 Set up for lwcc development with README file.
William Astle <lost@l-w.ca>
parents:
diff changeset
24 directly supported by the CPU instruction set.
d9631a9a5b61 Set up for lwcc development with README file.
William Astle <lost@l-w.ca>
parents:
diff changeset
25
290
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
26
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
27 RUNTIME INFORMATION
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
28 ===================
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
29
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
30 The compiler driver has a built in base directory where it searches for its
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
31 various components as needed. In the discussion below, BASEDIR stands for
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
32 that directory.
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
33
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
34 BASEDIR may be specified by the -B option to the driver. Care must be taken
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
35 when doing so, however, because specifying an invalid -B will cause the
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
36 compiler to fail completely. It will completely override the built in search
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
37 paths for the compiler provided files and programs.
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
38
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
39 Because BASEDIR is part of the actual compiler, it is not affected by
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
40 --sysroot or -isysroot options.
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
41
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
42 If BASEDIR does not exist, compiler component programs will be searched for
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
43 in the standard execution paths. This may lead to incorrect results so it is
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
44 important to make certain that the specified BASEDIR exists.
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
45
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
46 If -B is not specified, the default BASEDIR is
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
47 $(PREFIX)/lib/lwcc/$(VERSION)/ where PREFIX is the build prefix from the
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
48 Makefile and VERSION is the lwtools version.
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
49
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
50 The contents of BASEDIR are as follows:
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
51
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
52 BASEDIR/bin
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
53
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
54 Various binaries for the parts of the compiler system. Notably, this
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
55 includes the preprocessor and compiler proper. The specific names and
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
56 contents of this directory cannot be relied upon and these programs should
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
57 not be called directly. Ever. Don't do it.
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
58
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
59
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
60 BASEDIR/lib
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
61
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
62 This directory contains various libraries that provide support for any
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
63 portion of the compiler's output. The driver will arrange to pass the
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
64 appropriate arguments to the linker to include these as required.
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
65
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
66 The most notable file in this directory is liblwcc.a wich contains the
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
67 support routines for the compiler's code generation. Depending on ABI and
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
68 code generation options supported, there may be multiple versions of
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
69 liblwcc.a. The driver will arrange for the correct one to be referenced.
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
70
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
71
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
72 BASEDIR/include
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
73
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
74 This directory contains any C header files that the compiler provides.
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
75 Notably, this includes stdint.h, stdarg.h, and setjmp.h as these are
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
76 specific to the compiler. The driver will arrange for this directory to be
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
77 searched prior to the standard system directories so that these files will
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
78 override any present in those directories.
c648fc4bd006 Updated lwcc README with info on the runtime support files
William Astle <lost@l-w.ca>
parents: 286
diff changeset
79