bcc.1 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  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.
  31. The default operation is to produce an 8086 executable called
  32. .B a.out
  33. from the source file.
  34. .SH OPTIONS
  35. .TP
  36. .B -ansi
  37. Pass the C source through
  38. .B unprotoize
  39. after preprocessing and before code generation. This will allow
  40. .I some
  41. ansi C to be compiled but it is definitly
  42. .B NOT
  43. a true ansi-C compiler.
  44. .TP
  45. .B -0
  46. 8086 target (works on 80386 host, but not 6809)
  47. .TP
  48. .B -3
  49. 80386 target (may work on 8086 host, but not 6809)
  50. .TP
  51. .B -A
  52. pass remainder of option to assembler (e.g. -A-l -Alistfile for a listing)
  53. .TP
  54. .B -B
  55. prefix for executable search path (as usual; the search order is all paths
  56. specified using
  57. .BR -B ,
  58. in order, then the path given in the environment variable
  59. .B BCC_EXEC_PREFIX
  60. if that is set, then the compiled-in defaults
  61. (something like /usr/lib/bcc/ followed by /usr/bin/)
  62. .TP
  63. .B -C
  64. pass remainder of option to bcc-cc1, see code generation options.
  65. .TP
  66. .B -D
  67. preprocessor define
  68. .TP
  69. .B -E
  70. produce preprocessor output to standard out.
  71. .TP
  72. .B -G
  73. produce GCC objects (Same as -Mg)
  74. .TP
  75. .B -Ixyz
  76. include search 'xyz' path
  77. .TP
  78. .B -I
  79. don't add default include to search list
  80. .TP
  81. .B -Lxyz
  82. add directory name 'xyz' to the head of the list of library directories searched
  83. .TP
  84. .B -L
  85. don't add default library to search list
  86. .TP
  87. .B -Md
  88. alters the arguments for all passes to produce MSDOS executable COM files.
  89. These are small model executables, use
  90. .B -i
  91. to get tiny model.
  92. .TP
  93. .B -Mf
  94. sets bcc to pass the
  95. .B -c
  96. and
  97. .B -f
  98. arguments to the code generator for smaller faster code. Note this code is
  99. not compatible with the standard calling conventions so a different version
  100. of the C library is linked too.
  101. .TP
  102. .B -Mc
  103. sets bcc to pass the
  104. .B -c
  105. argument to the code generator for smaller faster code. Note the standard
  106. libc is normally transparent to this, but there are exceptions.
  107. .TP
  108. .B -Ms
  109. alters the arguments for all passes and selects C-library
  110. to produce standalone Linux-86 executables
  111. .TP
  112. .B -Ml
  113. switches to i386-Linux code generator and library.
  114. This configuration accepts the
  115. .B -z
  116. flag to generate QMAGIC a.out files instead of the normal OMAGIC.
  117. .TP
  118. .B -Mg
  119. switches to i386-Linux code generator and generates OMAGIC object files
  120. that can be linked with some versions of gcc; unfortunatly the most recent
  121. versions use 'collect2' to link and this crashes.
  122. .TP
  123. .B -N
  124. makes the linker produce a native a.out file (Linux OMAGIC) if combined
  125. with -3 the executable will run under Linux-i386.
  126. .TP
  127. .B -O
  128. optimize, call
  129. .BR copt ( 1 )
  130. to optimize 8086 code. Specifiers to choose which rules
  131. .B copt
  132. should use can be appended to the
  133. .B -O
  134. and the option can be repeated.
  135. .TP
  136. .B -P
  137. produce preprocessor output with no line numbers to standard output.
  138. .TP
  139. .B -Q
  140. pass full option to c386 (Only for c386 version)
  141. .TP
  142. .B -S
  143. produce assembler file
  144. .TP
  145. .B -T
  146. temporary directory (overrides previous value and default; default is
  147. from the environment variable TMPDIR if that is set, otherwise /tmp)
  148. .TP
  149. .B -U
  150. preprocessor undefine
  151. .TP
  152. .B -V
  153. print names of files being compiled
  154. .TP
  155. .B -X
  156. pass remainder of option to linker (e.g. -X-Ofile is passed to the linker
  157. as -Ofile)
  158. .TP
  159. .B -c
  160. produce object file
  161. .TP
  162. .B -f
  163. turn on floating point support, no effect with i386, changes libc library
  164. with 8086 code.
  165. .TP
  166. .B -g
  167. produce debugging info (ignored.)
  168. .TP
  169. .B -o
  170. output file name follows (assembler, object or executable) (as usual)
  171. .TP
  172. .B -p
  173. produce profiling info (ignored.)
  174. .TP
  175. .B -t1
  176. pass to the assembler to renumber the text segment for multi-segment programs.
  177. .TP
  178. .B -v
  179. print names and args of subprocesses being run. Two or more -v's print
  180. names of files being unlinked. Three or more -v's print names of paths
  181. being searched.
  182. .TP
  183. .B -w
  184. Supress any warning diagnostics.
  185. .TP
  186. .B -W
  187. Turn
  188. .B on
  189. assembler warning messages.
  190. .TP
  191. .B -x
  192. don't include crt0.o in the link.
  193. .TP
  194. .B -i
  195. don't pass
  196. .B -i
  197. to the linker so that it will create an impure executable.
  198. .TP
  199. .B -7
  200. Turn on ancient C mode (see CODE GENERATOR OPTIONS below).
  201. Among other things, this disables valuable
  202. error checks and even parses certain constructs incompatibly (e.g.
  203. .I =-
  204. is postdecrement instead of an assignment of a negative number)
  205. to later C standards, so this option should only be used with ancient
  206. code. To generate executables for a V7 variant you should tell
  207. linker to generate old a.out header with
  208. .B -X-7
  209. option.
  210. .P
  211. Other options are passed to the linker, in particular -lx, -M, -m, -s, -H.
  212. .SH CODE GENERATOR OPTIONS
  213. These are all options that the code generator pass
  214. .B bcc-cc1
  215. understands, only some will be useful for the
  216. .B -C
  217. option of bcc.
  218. .TP
  219. .B -0
  220. 8086 target (works even on 80386 host, not on 6809)
  221. .TP
  222. .B -3
  223. 80386 target (may work even on 8086 host, not on 6809)
  224. .TP
  225. .B -D
  226. define (as usual)
  227. .TP
  228. .B -E
  229. produce preprocessor output (as usual)
  230. .TP
  231. .B -I
  232. include search path (as usual)
  233. .TP
  234. .B -P
  235. produce preprocessor output with no line numbers (as usual)
  236. .TP
  237. .B -c
  238. produce code with caller saving regs before function calls
  239. .TP
  240. .B -d
  241. print debugging information in assembly output
  242. .TP
  243. .B -f
  244. produce code with 1st argument passed in a register (AX, EAX or X)
  245. .TP
  246. .B -l
  247. produce code for 2 3 1 0 long byte order (only works in 16-bit code),
  248. a special library of compiler helper functions is needed for this mode.
  249. .TP
  250. .B -o
  251. assembler output file name follows
  252. .TP
  253. .B -p
  254. produce (almost) position-independent code (only for the 6809)
  255. .TP
  256. .B -t
  257. print source code in assembly output
  258. .TP
  259. .B -w
  260. print what cc1 thinks is the location counter in assembly output
  261. .TP
  262. .B -7
  263. Accept various obsolete construct for ancient C compilers, including
  264. Ritchie's Sixth Edition UNIX C compiler and Seventh Edition UNIX
  265. Portable C compiler. Enough of these compilers is emulated to compile
  266. all of Seventh Edition userspace and kernel.
  267. .P
  268. All the options except -D, -I and -o may be turned off by following the
  269. option letter by a '-'. Options are processed left to right so the last
  270. setting has precedence.
  271. .SH PREPROCESSOR DEFINES
  272. The preprocessor has a number of manifest constants.
  273. .TP
  274. .B __BCC__ 1
  275. The compiler identifier, normally used to avoid compiler limitations.
  276. .TP
  277. .B __FILE__
  278. stringized name of current input file
  279. .TP
  280. .B __LINE__
  281. current line number
  282. .TP
  283. .B __MSDOS__ 1
  284. compiler is configured for generating MSDOS executable COM files.
  285. .TP
  286. .B __STANDALONE__ 1
  287. compiler is configured for generating standalone executables.
  288. .TP
  289. .B __AS386_16__ 1
  290. compiler is generating 16 bit 8086 assembler and the
  291. .B #asm
  292. keyword is available for including 8086 code.
  293. .TP
  294. .B __AS386_32__ 1
  295. compiler is generating 32 bit 80386 assembler and the
  296. .B #asm
  297. keyword is available for including 80386 code.
  298. .TP
  299. .B __CALLER_SAVES__ 1
  300. compiler calling conventions are altered so the calling function must save the
  301. .I SI
  302. and
  303. .I DI
  304. registers if they are in use (ESI and EDI on the 80386)
  305. .TP
  306. .B __FIRST_ARG_IN_AX__ 1
  307. compiler calling conventions are altered so the calling function is passing
  308. the first argument to the function in the
  309. .I AX
  310. (or
  311. .I EAX
  312. )
  313. register.
  314. .TP
  315. .B __LONG_BIG_ENDIAN__ 1
  316. alters the word order of code generated by the 8086 compiler.
  317. .P
  318. These defines only occur in the 6809 version of the compiler.
  319. .TP
  320. .B __AS09__ 1
  321. compiler is generating 6809 code
  322. .TP
  323. .B __FIRST_ARG_IN_X__ 1
  324. the first argument to functions is passed in the
  325. .I X
  326. register.
  327. .TP
  328. .B __POS_INDEPENDENT__ 1
  329. the code generated is (almost) position independent.
  330. .P
  331. .SH ENVIRONMENT
  332. .TP
  333. .B BCC_EXEC_PREFIX
  334. default directory to seach for compiler passes
  335. .TP
  336. .B TMPDIR
  337. directory to place temporary files (default /tmp)
  338. .P
  339. .SH DIRECTORIES
  340. All the include, library and compiler components are stored under the
  341. .I /usr/bcc
  342. directory under Linux-i386, this is laid out the same as a
  343. .I /usr
  344. filesystem and if bcc is to be the primary compiler on a system it should
  345. be moved there. The configuration for this is in the
  346. .B bcc.c
  347. source file only, all other executables are independent of location.
  348. The library installation also creates the file
  349. .BR /usr/lib/liberror.txt ,
  350. this path is hardcoded into the C library.
  351. The
  352. .B bcc
  353. executable itself,
  354. .B as86
  355. and
  356. .B ld86
  357. are in /usr/bin.
  358. .SH SEE ALSO
  359. as86(1), ld86(1), elksemu(1)
  360. .SH BUGS
  361. The bcc.c compiler driver source is very untidy.
  362. The linker, ld86, produces a broken a.out object file if given one input and
  363. the
  364. .B -r
  365. option this is so it is compatible with pre-dev86 versions.