summaryrefslogtreecommitdiff
path: root/bcc/bcc.doc
blob: 31c19f9ca5bc51ab094f5e028c90229b38eef4da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
WARNING: This document bis out of date; it's kept mainly for the 6809 notes.

bcc options
-----------

bcc [-03EGOPSVcegv] [-Aas_option] [-Bexecutable_prefix] [-Ccc1_option]
    [-Ddefine] [-Iinclude_dir] [-Lld_option] [-Qc386_option] [-Ttmpdir]
    [-Uundef] [-o outfile] [-fpt error] [ld_options] [infiles]

The 6809 version does not support -0, -3 or -G.
Only the c386 version supports -Q.

defaults (off or none except for these):
-03		native
outfile		stdout for preprocessor output
		somewhere/file.[ci] -> file.s for compiler output
		somewhere/file.[cis] -> file.o for assembler output
		a.out for ld output

-ansi  Pass the source through 'unproto' first
-0  8086 target (works even on 80386 host)
-3  80386 target (works even on 8086 host)
-A  pass remainder of option to assembler (e.g. -A-l -Alistfile for a listing)
-B  prefix for executable search path (as usual; the search order is all paths
    specified using -B, in order, then the path given in the environment
    variable BCC_EXEC_PREFIX if that is set, then the compiled-in defaults
    (something like /usr/libexec/i386/bcc/ followed by /usr/bin/))
-C  pass remainder of option to cc1 (e.g. -C-c for caller-saves)
-D  define (as usual)
-E  produce preprocessor output (as usual)
-G  produce gnu-Minix objects (link with gnu ld)
-Ix include search path (as usual)
-I  don't add default include to search list
-Lx add dir name x to the head of the list of library dirs searched
-L  don't add default library to search list
-X  pass remainder of option to linker
-O  optimize (does nothing)
-P  produce preprocessor output with no line numbers (as usual)
-Q  pass full option to c386
-S  produce assembler file (as usual)
-T  temporary directory (overrides previous value and default; default is
    from the environment variable TMPDIR if that is set, otherwise /tmp)
-U  undefine (as usual)
-V  print names of files being compiled
-c  produce object file (as usual)
-e  run the preprocess pass separately.  This takes less memory, and may help
    or harm by giving more traditional semantics like token pasting with /**/.
-f  error (float emulation not supported)
-g  produce debugging info (does nothing)
-o  output file name follows (assembler, object or executable) (as usual)
-p  error (profiling not supported)
-t  error (substitution of some cc passes not supported)
-v  print names and args of subprocesses being run.  Two or more -v's:
    print names of files being unlinked.  Three or more -v's:
    print names of paths being searched.

Other options are passed to the linker, in particular -i-, -lx, -M, -m, -s.
The -i option is always passed to the linker but can be cancelled using -i-.

This is supposed to match the V7 manual except for -0, -3, -A, -C, -G, -L,
-T, -V, -e, -v and where not supported.

cc1 options
----------

cc1 [-03EPcdfltw[-]] [-Ddefine] [-Iinclude_dir] [-Uundef] [-o outfile] [infile]

The 6809 version does not support -0 or -3 but it supports -p.

defaults (off or none except for these):
-03		native
-c		on for 6809
-f		on for 6809
outfile		stdout
infile		stdin

-0  8086 target (works even on 80386 host)
-3  80386 target (works even on 8086 host)
-D  define (as usual)
-E  produce preprocessor output (as usual)
-I  include search path (as usual)
-P  produce preprocessor output with no line numbers (as usual)
-c  produce code with caller saving regs before function calls
-d  print debugging information in assembly output
-f  produce code with 1st argument passed in a register
-l  produce code for 2 3 1 0 long byte order (only works in 16-bit versions)
-o  assembler output file name follows
-p  produce (almost) position-independent code
-t  print source code in assemby output
-w  print what cc1 thinks is the location counter in assembly output

All the options except -D, -I and -o may be turned off by following the
option letter by a '-'.  Options are processed left to right so the last
setting has precedence.

The following is defined before option processing:

__BCC__			1

The following may be defined after option processing:

__AS09__		1 if 6809 version
__AS386_16__		1 if -0 option on 80*86
__AS386_32__		1 if -3 option on 80*86
__CALLER_SAVES__	1 if -c option
__FIRST_ARG_IN_AX__	1 if -f option on 80*86
__FIRST_ARG_IN_X__	1 if -f option on 6809
__LONG_BIG_ENDIAN__	1 if -l option
__POS_INDEPENDENT__	1 if -p option on 6809

The following are standard builtins:

__FILE__		stringized name of current input file
__LINE__		current line number

as options
----------

as [-03agjuw] [-b [bin]] [-lm [list]] [-n name] [-o obj] [-s sym] src

The 6809 version does not support -0, -3, -a or -j.

defaults (off or none except for these; no output is produced without a flag):
-03		native
list		stdout (beware of clobbering next arg)
name		basename of the source name

-0  start with 16-bit code segment
-3  start with 32-bit code segment
-a  enable partial compatibility with asld
-g  only put global symbols in object file
-j  force all jumps to be long
-l  produce list file, filename may follow
-m  print macro expansions in listing
-n  name of module follows (goes in object instead of source name)
-o  produce object file, filename follows
-b  produce binary file, filename may follow
-s  produce symbol file, filename follows
-u  take undefined symbols as imported-with-unspecified segment
-w  don't print warnings

The -u and -w options are perhaps back to front because they are needed for
cc1 output and Minix's make does the wrong thing with .s files left around.
However, all assembler code not written by compilers should assemble with
them turned off.

The -b flag now produces a 'raw' binary file with no header, if there's no
-s flag the file starts at location 0. The -s generates an ASCII symbol
table, if a binary file doesn't start at location zero the first two items
are the start and end addresses of the binary file.

ld options
----------

ld [-03Mimrstz[-]] [-llib_extension] [-o outfile] [-Ccrtfile]
       [-Llibdir] [-Olibfile] [-T textaddr] infile...

The version that produces old Minix a.out format does not support -r.

The 6809 version does not support -i or -r.

defaults (off or none except for these):
-03		native
-L/usr/local/lib/m/	(m is machine-dependent)
outfile		a.out

-0  produce header with 16-bit magic and use library subdir i86 for -lx
-3  produce header with 32-bit magic and use library subdir i386 for -lx
-Cx add file libdir-from-search/crtx.o to list of files linked
-Lx add dir name x to the head of the list of library dirs searched
-M  print symbols linked on stdout
-Ox add library libdir-from-search/x to list of files linked
-T  text base address follows (in format suitable for strtoul)
-i  separate I&D output
-lx add library libdir-from-search/libx.a to list of files linked
-m  print modules linked on stdout
-o  output file name follows
-r  produce output suitable for further relocation
-s  strip symbols
-t  trace modules being looked at on stdout
-z  produce "unmapped zero page" executables

All the options not taking an argument may be turned off by following the
option letter by a '-', as for cc1.