Print this page
11461 should use a native link-editor during the build
11463 SUNWonld has passed its use-by date
11464 cmd/sgs/tools should contain tools, not common code
11465 sgsmsg should be built with the rest of the build tools
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/tools/cw/cw.1onbld.man.txt
+++ new/usr/src/tools/cw/cw.1onbld.man.txt
1 1 CW(1ONBLD) illumos Build Tools CW(1ONBLD)
2 2
3 3 NAME
4 4 cw - invoke one or more compilers with argument translation
5 5
6 6 SYNOPSIS
7 7 cw [-C] [--versions] [--noecho] --primary compiler
8 - [--shadow compiler ...] -- compiler args ...
8 + [--shadow compiler ...] [--linker linker] -- compiler args ...
9 9
10 10 DESCRIPTION
11 11 cw is a facility for invoking one or more compilers, providing
12 12 translation from Sun style arguments as appropriate. This allows the use
13 13 of arbitrary compilers without the need to alter large numbers of
14 14 makefiles. A mode called shadow compilation invokes multiple compilers
15 15 so that warnings and errors may be obtained from all of them. See SHADOW
16 16 COMPILATION for details. This version of cw supports compilers with both
17 17 Sun Studio 12 and GCC-style command lines.
18 18
19 19 ARGUMENTS
20 20 Both the --primary and --shadow parameters take a compiler specification.
21 21 This is a comma-separated list of the form name,executable,style Where
22 22 name is a name for the compiler, executable is the full path to the
23 23 compiler executable, and style is the style of command-line options the
24 24 compiler expects, either sun or gnu.
↓ open down ↓ |
6 lines elided |
↑ open up ↑ |
25 25
26 26 --primary compiler
27 27 Specify the compiler to be used primarily (that which is used for
28 28 link-editing and pre-processing, and whos objects we deliver).
29 29
30 30 --shadow compiler
31 31 Specify a shadow compiler, which builds sources for the sake of
32 32 checking code quality and compatibility, but has its output
33 33 discarded.
34 34
35 + --linker linker
36 + Specify a link-editor to use in place of /usr/bin/ld. ld(1)
37 + itself arranges for this to be executed by any subprocesses.
38 +
35 39 --noecho
36 40 Do not echo the actual command line of any compilers invoked.
37 41
38 42 --versions
39 43 Request from each configured primary and shadow compiler its
40 44 version information.
41 45
42 46 -C The sources being compiled are C++. This is necessary as it
43 47 affects the translation of compiler arguments.
44 48
45 49 -- Arguments intended for the compilers themselves must be separated
46 50 from those of cw by a --.
47 51
48 52 -_name=
49 53
50 54 -_style=
51 55 Parameters intended for the compiler be guarded with options of
52 56 the form -_name= and -_style= Where name and style are those
53 57 passed to --primary and --shadow this allows certain flags to be
54 58 passed only to certain classes of compiler.
55 59
56 60 For historical reasons, the -_style= option is also translated
57 61 such that a style of sun may use the flag -_cc= and a style of
58 62 gnu may use the flag -_gcc=, and when the -C option is given and
59 63 C++ is in use the style of sun may use the flag -_CC= and the
60 64 style of gnu may use the flag -_g++=.
61 65
62 66 SHADOW COMPILATION
63 67 If --shadow compilers are specified cw will invoke each shadow compiler,
64 68 with the outputs modified (as well as any translation for compiler style)
65 69 as follows:
66 70
67 71 1. If cw is invoked to link-edit without compilation (the input files
68 72 are all objects), the shadow compiler is not invoked.
69 73
70 74 2. If the -o filename option was provided, with or without a separating
71 75 space, it will be replaced with -o tempfile
72 76
73 77 3. If the option -o was not provided, -o tempfile will be added to the
74 78 end of the argument list used to invoke the shadow compilers.
75 79 When shadow compilation is in effect, cw writes to standard error each
76 80 compiler's standard error output following its argument list. Messages
77 81 from the compilers will not be interleaved. If cw is used to invoke the
78 82 preprocessor and no output location is specified, cw will write to
79 83 standard output the primary compiler's standard output.
80 84
81 85 Because the Sun compilers write intermediate objects to fixed filenames
82 86 in the current directory when instructed to compile and link multiple
83 87 source files via a single command line, it would be unsafe to invoke more
84 88 than one compiler in this fashion. Therefore cw does not accept multiple
85 89 source files unless the preprocessor is to be invoked. An attempt to
86 90 invoke cw in this manner will result in an error.
87 91
88 92 ARGUMENT TRANSLATION
89 93 If the compiler to be invoked is a GNU-style C or C++ compiler, a set of
90 94 default flags is added to the beginning of the argument list, and the
91 95 remaining arguments are translated to their closest appropriate semantic
92 96 equivalents and passed in the same order as their counterparts given to
93 97 cw. See the comments at the head of usr/src/tools/cw/cw.c for a detailed
94 98 list of translations.
95 99
96 100 ENVIRONMENT
97 101 CW_SHADOW_SERIAL
98 102 If this variable is set in the environment, invoke the primary
99 103 compiler, wait for it to complete, then invoke the shadow
100 104 compilers. Normally the primary and shadow compilers are invoked
101 105 in parallel.
102 106
103 107 CW_NO_EXEC
104 108 f this variable is set in the environment, write the usual output
105 109 to standard error but do not actually invoke any compiler. This
106 110 is useful for debugging the translation engine.
107 111
↓ open down ↓ |
63 lines elided |
↑ open up ↑ |
108 112 EXIT STATUS
109 113 The following exit status values are returned:
110 114
111 115 0 The primary compiler, and shadow compilers if invoked, all
112 116 completed successfully.
113 117
114 118 >0 A usage error occurred, or one or more compilers returned a
115 119 nonzero exit status.
116 120
117 121 SEE ALSO
118 - cc(1), CC(1), gcc(1)
122 + cc(1), CC(1), gcc(1), ld(1)
119 123
120 124 BUGS
121 125 The translations provided for gcc are not always exact and in some cases
122 126 reflect local policy rather than actual equivalence.
123 127
124 128 Additional compiler types should be supported.
125 129
126 130 The translation engine is hacky.
127 131
128 132 illumos September 4, 2018 illumos
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX