NASM 0.98p3.5
[nasm.git] / Readme
blob6e7c56c70efff34cfffbc5cf64dfed8d825898e3
1 This directory contains the necessary files to port the C compiler
2 ``LCC'' (available by FTP from sunsite.doc.ic.ac.uk in the directory
3 /computing/programming/languages/c/lcc) to compile for Linux (a.out or
4 ELF) or other supported operating systems by using NASM as a back-end
5 code generator.
7 This patch has been tested on lcc version 4.0.
9 To install:
11 - Copy `x86nasm.md' into the `src' directory of the lcc tree.
13 - Copy either `lin-elf.c' or `lin-aout.c' into the `etc' directory.
15 - With previous versions, you had to modify x86-nasm.md if you weren't
16   using ELF.  There is now inbuilt support within NASM in the shape
17   of the __CDECL__ macro, so this modification is no longer necessary.
19 - Make the following changes to `bind.c' in the `src' directory:
21   - Near the top of the file, add a line that reads
22         extern Interface x86nasmIR;
24   - In the `bindings' array, add the lines
25         "x86-nasm",      &x86nasmIR,
26         "x86/nasm",      &x86nasmIR,
27     (in sensible looking places...)
29   A sample `bind.c' has been provided to show what the result of
30   this might look like. You might be able to get away with using it
31   directly...
33 - Modify the lcc makefile to include rules for x86nasm.o: this will
34   have to be done in about three places. Just copy any line with
35   `x86' on it and modify it to read `x86nasm' everywhere. (Except
36   that in the list of object files that rcc is made up from, do
37   remember to ensure that every line but the last has a trailing
38   backslash...)
40 - You may have to modify the contents of `lin-elf.c' or `lin-aout.c'
41   to reflect the true locations of files such as crt0.o, crt1.o,
42   ld-linux.so and so forth. If you don't know where to find these,
43   compile a short C program with `gcc -v' and see what command line
44   gcc feeds to `ld'.
46 - You should now be able to build lcc, using `lin-elf.c' or
47   `lin-aout.c' as the system-dependent part of the `lcc' wrapper
48   program.
50 - Symlink x86nasm.c into the `src' directory before attempting the
51   triple test, or the compile will fail.
53 - Now it should pass the triple test, on either ELF or a.out. Voila!