* added compilers lcc and bcc (linux86)
[mascara-docs.git] / compilers / linux86-0.16.17 / man / bcc.1
blob1c9ffaca3364badb5454ef523e68e10a255449aa
1 .TH bcc 1 "Nov, 1997"
2 .BY Bruce Evans
3 .nh
4 .SH NAME
5 bcc \- Bruce's C compiler
6 .SH SYNOPSIS
7 .B bcc
8 .RB [ -03EGNOPSVcegvwxW ]
9 .RB [ -Aas_option ]
10 .RB [ -Bexecutable_prefix ]
11 .RB [ -Ddefine ]
12 .RB [ -Uundef ]
13 .RB [ -Mc_mode ]
14 .RB [ -o\ outfile ]
15 .RB [ -ansi ]
16 .RB [ -Ccc1_option ]
17 .RB [ -Pcpp_option ]
18 .RB [ -Iinclude_dir ]
19 .RB [ -Lld_option ]
20 .RB [ -Ttmpdir ]
21 .RB [ -Qc386_option ]
22 .RB [ -ttext_segno ]
23 .RB [ ld_options ]
24 .RB [ infiles ]
25 .SH DESCRIPTION
26 .B Bcc
27 is a simple C compiler that produces 8086 assembler, in addition compiler
28 compile time options allow 80386 or 6809 versions. The compiler understands
29 traditional K&R C with just the restriction that bit fields are mapped to
30 one of the other integer types.
32 The default operation is to produce an 8086 executable called
33 .B a.out
34 from the source file.
36 .SH OPTIONS
37 .TP
38 .B -ansi
39 Pass the C source through
40 .B unprotoize
41 after preprocessing and before code generation. This will allow
42 .I some
43 ansi C to be compiled but it is definitly
44 .B NOT
45 a true ansi-C compiler.
46 .TP
47 .B -0
48 8086 target (works on 80386 host, but not 6809)
49 .TP
50 .B -3
51 80386 target (may work on 8086 host, but not 6809)
52 .TP
53 .B -A
54 pass remainder of option to assembler (e.g. -A-l -Alistfile for a listing)
55 .TP
56 .B -B
57 prefix for executable search path (as usual; the search order is all paths
58 specified using
59 .BR -B ,
60 in order, then the path given in the environment variable
61 .B BCC_EXEC_PREFIX
62 if that is set, then the compiled-in defaults
63 (something like /usr/lib/bcc/ followed by /usr/bin/)
64 .TP
65 .B -C
66 pass remainder of option to bcc-cc1, see code generation options.
67 .TP
68 .B -D
69 preprocessor define
70 .TP
71 .B -E
72 produce preprocessor output to standard out.
73 .TP
74 .B -G
75 produce GCC objects (Same as -Mg)
76 .TP
77 .B -Ixyz
78 include search 'xyz' path
79 .TP
80 .B -I
81 don't add default include to search list
82 .TP
83 .B -Lxyz
84 add directory name 'xyz' to the head of the list of library directories searched
85 .TP
86 .B -L
87 don't add default library to search list
88 .TP
89 .B -Md
90 alters the arguments for all passes to produce MSDOS executable COM files.
91 These are small model executables, use
92 .B -i
93 to get tiny model.
94 .TP
95 .B -Mf
96 sets bcc to pass the
97 .B -c
98 and
99 .B -f
100 arguments to the code generator for smaller faster code. Note this code is
101 not compatible with the standard calling conventions so a different version
102 of the C library is linked too.
104 .B -Mc
105 sets bcc to pass the
106 .B -c
107 argument to the code generator for smaller faster code. Note the standard
108 libc is normally transparent to this, but there are exceptions.
110 .B -Ms
111 alters the arguments for all passes and selects C-library
112 to produce standalone Linux-86 executables
114 .B -Ml
115 switches to i386-Linux code generator and library.
116 This configuration accepts the
117 .B -z
118 flag to generate QMAGIC a.out files instead of the normal OMAGIC.
120 .B -Mg
121 switches to i386-Linux code generator and generates OMAGIC object files
122 that can be linked with some versions of gcc; unfortunatly the most recent
123 versions use 'collect2' to link and this crashes.
125 .B -N
126 makes the linker produce a native a.out file (Linux OMAGIC) if combined
127 with -3 the executable will run under Linux-i386.
129 .B -O
130 optimize, call
131 .BR copt ( 1 )
132 to optimize 8086 code. Specifiers to choose which rules 
133 .B copt
134 should use can be appended to the
135 .B -O
136 and the option can be repeated.
138 .B -P
139 produce preprocessor output with no line numbers to standard output.
141 .B -Q
142 pass full option to c386 (Only for c386 version)
144 .B -S
145 produce assembler file
147 .B -T
148 temporary directory (overrides previous value and default; default is
149 from the environment variable TMPDIR if that is set, otherwise /tmp)
151 .B -U
152 preprocessor undefine
154 .B -V
155 print names of files being compiled
157 .B -X
158 pass remainder of option to linker (e.g. -X-Ofile is passed to the linker
159 as -Ofile)
161 .B -c
162 produce object file
164 .B -f
165 turn on floating point support, no effect with i386, changes libc library
166 with 8086 code.
168 .B -g
169 produce debugging info (ignored.)
171 .B -o
172 output file name follows (assembler, object or executable) (as usual)
174 .B -p
175 produce profiling info (ignored.)
177 .B -t1
178 pass to the assembler to renumber the text segment for multi-segment programs.
180 .B -v
181 print names and args of subprocesses being run.  Two or more -v's print
182 names of files being unlinked.  Three or more -v's print names of paths
183 being searched.
185 .B -w
186 Supress any warning diagnostics.
188 .B -W
189 Turn
190 .B on
191 assembler warning messages.
193 .B -x
194 don't include crt0.o in the link.
196 .B -i
197 don't pass
198 .B -i
199 to the linker so that it will create an impure executable.
201 Other options are passed to the linker, in particular -lx, -M, -m, -s, -H.
203 .SH CODE GENERATOR OPTIONS
204 These are all options that the code generator pass
205 .B bcc-cc1
206 understands, only some will be useful for the
207 .B -C
208 option of bcc.
209 .TP 
210 .B -0
211 8086 target (works even on 80386 host, not on 6809)
212 .TP 
213 .B -3
214 80386 target (may work even on 8086 host, not on 6809)
215 .TP 
216 .B -D
217 define (as usual)
218 .TP 
219 .B -E
220 produce preprocessor output (as usual)
221 .TP 
222 .B -I
223 include search path (as usual)
224 .TP 
225 .B -P
226 produce preprocessor output with no line numbers (as usual)
227 .TP 
228 .B -c
229 produce code with caller saving regs before function calls
230 .TP 
231 .B -d
232 print debugging information in assembly output
233 .TP 
234 .B -f
235 produce code with 1st argument passed in a register (AX, EAX or X)
236 .TP 
237 .B -l
238 produce code for 2 3 1 0 long byte order (only works in 16-bit code),
239 a special library of compiler helper functions is needed for this mode.
240 .TP 
241 .B -o
242 assembler output file name follows
243 .TP 
244 .B -p
245 produce (almost) position-independent code (only for the 6809)
246 .TP 
247 .B -t
248 print source code in assembly output
249 .TP 
250 .B -w
251 print what cc1 thinks is the location counter in assembly output
253 All the options except -D, -I and -o may be turned off by following the
254 option letter by a '-'.  Options are processed left to right so the last
255 setting has precedence.
257 .SH PREPROCESSOR DEFINES
258 The preprocessor has a number of manifest constants.
260 .B __BCC__ 1
261 The compiler identifier, normally used to avoid compiler limitations.
263 .B __FILE__
264 stringized name of current input file
266 .B __LINE__
267 current line number
268 .TP 
269 .B __MSDOS__ 1
270 compiler is configured for generating MSDOS executable COM files.
271 .TP 
272 .B __STANDALONE__ 1
273 compiler is configured for generating standalone executables.
274 .TP 
275 .B __AS386_16__ 1
276 compiler is generating 16 bit 8086 assembler and the
277 .B #asm
278 keyword is available for including 8086 code.
279 .TP 
280 .B __AS386_32__ 1
281 compiler is generating 32 bit 80386 assembler and the
282 .B #asm
283 keyword is available for including 80386 code.
284 .TP 
285 .B __CALLER_SAVES__ 1
286 compiler calling conventions are altered so the calling function must save the
287 .I SI
289 .I DI
290 registers if they are in use (ESI and EDI on the 80386)
291 .TP 
292 .B __FIRST_ARG_IN_AX__ 1
293 compiler calling conventions are altered so the calling function is passing
294 the first argument to the function in the
295 .I AX
297 .I EAX
299 register.
300 .TP 
301 .B __LONG_BIG_ENDIAN__ 1
302 alters the word order of code generated by the 8086 compiler.
304 These defines only occur in the 6809 version of the compiler.
305 .TP 
306 .B __AS09__ 1
307 compiler is generating 6809 code
308 .TP 
309 .B __FIRST_ARG_IN_X__ 1
310 the first argument to functions is passed in the
311 .I X
312 register.
313 .TP 
314 .B __POS_INDEPENDENT__ 1
315 the code generated is (almost) position independent.
317 .SH ENVIRONMENT
319 .B BCC_EXEC_PREFIX
320 default directory to seach for compiler passes
322 .B TMPDIR
323 directory to place temporary files (default /tmp)
325 .SH DIRECTORIES
326 All the include, library and compiler components are stored under the
327 .I /usr/lib/bcc
328 directory under Linux-i386, this is laid out the same as a
329 .I /usr
330 filesystem and if bcc is to be the primary compiler on a system it should
331 be moved there. The configuration for this is in the
332 .B bcc.c
333 source file only, all other executables are independent of location.
335 The library installation also creates the file
336 .BR /usr/lib/liberror.txt ,
337 this path is hardcoded into the C library.
339 The 
340 .B bcc
341 executable itself,
342 .B as86
344 .B ld86
345 are in /usr/bin.
347 .SH SEE ALSO
348 as86(1), ld86(1), elksemu(1)
349 .SH BUGS
350 The bcc.c compiler driver source is very untidy.
352 The linker, ld86, produces a broken a.out object file if given one input and
354 .B -r
355 option this is so it is compatible with pre-dev86 versions.