1bcc(1)                      General Commands Manual                     bcc(1)
2
3
4

NAME

6       bcc - Bruce's C compiler
7

SYNOPSIS

9       bcc  [-03EGNOPSVcegvwxW] [-Aas_option] [-Bexecutable_prefix] [-Ddefine]
10       [-Uundef] [-Mc_mode] [-o outfile] [-ansi] [-Ccc1_option] [-Pcpp_option]
11       [-Iinclude_dir] [-Lld_option] [-Ttmpdir] [-Qc386_option] [-ttext_segno]
12       [ld_options] [infiles]
13

DESCRIPTION

15       Bcc is a simple C compiler that produces 8086  assembler,  in  addition
16       compiler  compile  time  options  allow  80386  or  6809  versions. The
17       compiler understands traditional K&R C with just the  restriction  that
18       bit fields are mapped to one of the other integer types.
19
20       The  default  operation  is  to produce an 8086 executable called a.out
21       from the source file.
22
23

OPTIONS

25       -ansi  Pass the C source through  unprotoize  after  preprocessing  and
26              before  code  generation.  This  will  allow  some  ansi C to be
27              compiled but it is definitly NOT a true ansi-C compiler.
28
29       -0     8086 target (works on 80386 host, but not 6809)
30
31       -3     80386 target (may work on 8086 host, but not 6809)
32
33       -A     pass remainder of option to assembler (e.g. -A-l -Alistfile  for
34              a listing)
35
36       -B     prefix for executable search path (as usual; the search order is
37              all paths specified using -B, in order, then the path  given  in
38              the  environment  variable  BCC_EXEC_PREFIX if that is set, then
39              the compiled-in defaults (something like /usr/lib/bcc/  followed
40              by /usr/bin/)
41
42       -C     pass  remainder  of  option  to  bcc-cc1,  see  code  generation
43              options.
44
45       -D     preprocessor define
46
47       -E     produce preprocessor output to standard out.
48
49       -G     produce GCC objects (Same as -Mg)
50
51       -Ixyz  include search 'xyz' path
52
53       -I     don't add default include to search list
54
55       -Lxyz  add directory name 'xyz' to the head  of  the  list  of  library
56              directories searched
57
58       -L     don't add default library to search list
59
60       -Md    alters  the arguments for all passes to produce MSDOS executable
61              COM files.  These are small model executables,  use  -i  to  get
62              tiny model.
63
64       -Mf    sets  bcc  to pass the -c and -f arguments to the code generator
65              for smaller faster code. Note this code is not  compatible  with
66              the standard calling conventions so a different version of the C
67              library is linked too.
68
69       -Mc    sets bcc to pass the -c  argument  to  the  code  generator  for
70              smaller   faster  code.  Note  the  standard  libc  is  normally
71              transparent to this, but there are exceptions.
72
73       -Ms    alters the arguments for all passes  and  selects  C-library  to
74              produce standalone Linux-86 executables
75
76       -Ml    switches   to  i386-Linux  code  generator  and  library.   This
77              configuration accepts the -z flag to generate QMAGIC a.out files
78              instead of the normal OMAGIC.
79
80       -Mg    switches  to  i386-Linux  code  generator  and  generates OMAGIC
81              object files that can be  linked  with  some  versions  of  gcc;
82              unfortunatly the most recent versions use 'collect2' to link and
83              this crashes.
84
85       -N     makes the linker produce a native a.out file (Linux  OMAGIC)  if
86              combined with -3 the executable will run under Linux-i386.
87
88       -O     optimize,  call  copt(1)  to  optimize  8086 code. Specifiers to
89              choose which rules copt should use can be appended to the -O and
90              the option can be repeated.
91
92       -P     produce  preprocessor  output  with  no line numbers to standard
93              output.
94
95       -Q     pass full option to c386 (Only for c386 version)
96
97       -S     produce assembler file
98
99       -T     temporary  directory  (overrides  previous  value  and  default;
100              default  is from the environment variable TMPDIR if that is set,
101              otherwise /tmp)
102
103       -U     preprocessor undefine
104
105       -V     print names of files being compiled
106
107       -X     pass remainder of option to linker (e.g. -X-Ofile is  passed  to
108              the linker as -Ofile)
109
110       -c     produce object file
111
112       -f     turn  on  floating  point  support, no effect with i386, changes
113              libc library with 8086 code.
114
115       -g     produce debugging info (ignored.)
116
117       -o     output file name follows (assembler, object or  executable)  (as
118              usual)
119
120       -p     produce profiling info (ignored.)
121
122       -t1    pass  to  the  assembler to renumber the text segment for multi-
123              segment programs.
124
125       -v     print names and args of subprocesses being  run.   Two  or  more
126              -v's  print  names  of files being unlinked.  Three or more -v's
127              print names of paths being searched.
128
129       -w     Supress any warning diagnostics.
130
131       -W     Turn on assembler warning messages.
132
133       -x     don't include crt0.o in the link.
134
135       -i     don't pass -i to the linker so that it  will  create  an  impure
136              executable.
137
138       -7     Turn  on  ancient  C  mode  (see  CODE GENERATOR OPTIONS below).
139              Among other things, this disables valuable error checks and even
140              parses    certain   constructs   incompatibly   (e.g.    =-   is
141              postdecrement instead of an assignment of a negative number)  to
142              later  C  standards,  so  this  option  should only be used with
143              ancient code. To generate  executables  for  a  V7  variant  you
144              should  tell  linker  to  generate  old  a.out  header with -X-7
145              option.
146
147       Other options are passed to the linker, in particular -lx, -M, -m,  -s,
148       -H.
149
150

CODE GENERATOR OPTIONS

152       These are all options that the code generator pass bcc-cc1 understands,
153       only some will be useful for the -C option of bcc.
154
155       -0     8086 target (works even on 80386 host, not on 6809)
156
157       -3     80386 target (may work even on 8086 host, not on 6809)
158
159       -D     define (as usual)
160
161       -E     produce preprocessor output (as usual)
162
163       -I     include search path (as usual)
164
165       -P     produce preprocessor output with no line numbers (as usual)
166
167       -c     produce code with caller saving regs before function calls
168
169       -d     print debugging information in assembly output
170
171       -f     produce code with 1st argument passed in a register (AX, EAX  or
172              X)
173
174       -l     produce  code  for 2 3 1 0 long byte order (only works in 16-bit
175              code), a special library of compiler helper functions is  needed
176              for this mode.
177
178       -o     assembler output file name follows
179
180       -p     produce (almost) position-independent code (only for the 6809)
181
182       -t     print source code in assembly output
183
184       -w     print what cc1 thinks is the location counter in assembly output
185
186       -7     Accept  various  obsolete  construct  for  ancient  C compilers,
187              including Ritchie's Sixth Edition UNIX C  compiler  and  Seventh
188              Edition  UNIX  Portable C compiler. Enough of these compilers is
189              emulated to compile all of Seventh Edition userspace and kernel.
190
191       All the options except -D, -I and -o may be turned off by following the
192       option  letter  by  a  '-'.  Options are processed left to right so the
193       last setting has precedence.
194
195

PREPROCESSOR DEFINES

197       The preprocessor has a number of manifest constants.
198
199       __BCC__ 1
200              The  compiler  identifier,  normally  used  to  avoid   compiler
201              limitations.
202
203       __FILE__
204              stringized name of current input file
205
206       __LINE__
207              current line number
208
209       __MSDOS__ 1
210              compiler  is  configured  for  generating  MSDOS  executable COM
211              files.
212
213       __STANDALONE__ 1
214              compiler is configured for generating standalone executables.
215
216       __AS386_16__ 1
217              compiler is generating  16  bit  8086  assembler  and  the  #asm
218              keyword is available for including 8086 code.
219
220       __AS386_32__ 1
221              compiler  is  generating  32  bit  80386  assembler and the #asm
222              keyword is available for including 80386 code.
223
224       __CALLER_SAVES__ 1
225              compiler calling conventions are altered so the calling function
226              must  save  the  SI and DI registers if they are in use (ESI and
227              EDI on the 80386)
228
229       __FIRST_ARG_IN_AX__ 1
230              compiler calling conventions are altered so the calling function
231              is  passing the first argument to the function in the AX (or EAX
232              ) register.
233
234       __LONG_BIG_ENDIAN__ 1
235              alters the word order of code generated by the 8086 compiler.
236
237       These defines only occur in the 6809 version of the compiler.
238
239       __AS09__ 1
240              compiler is generating 6809 code
241
242       __FIRST_ARG_IN_X__ 1
243              the first argument to functions is passed in the X register.
244
245       __POS_INDEPENDENT__ 1
246              the code generated is (almost) position independent.
247

ENVIRONMENT

249       BCC_EXEC_PREFIX
250              default directory to seach for compiler passes
251
252       TMPDIR directory to place temporary files (default /tmp)
253

DIRECTORIES

255       All the include, library and compiler components are stored  under  the
256       /usr/bcc  directory  under  Linux-i386,  this is laid out the same as a
257       /usr filesystem and if bcc is to be the primary compiler on a system it
258       should  be  moved  there.  The  configuration  for this is in the bcc.c
259       source file only, all other executables are independent of location.
260
261       The library installation also creates the  file  /usr/lib/liberror.txt,
262       this path is hardcoded into the C library.
263
264       The bcc executable itself, as86 and ld86 are in /usr/bin.
265
266

SEE ALSO

268       as86(1), ld86(1), elksemu(1)
269

BUGS

271       The bcc.c compiler driver source is very untidy.
272
273       The  linker,  ld86,  produces  a  broken a.out object file if given one
274       input and the -r option this is so  it  is  compatible  with  pre-dev86
275       versions.
276
277
278
279                                   Nov, 1997                            bcc(1)
Impressum