]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/gcc/doc/install-old.texi
This commit was generated by cvs2svn to compensate for changes in r94670,
[FreeBSD/FreeBSD.git] / contrib / gcc / doc / install-old.texi
1 @c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
2 @c This is part of the GCC manual.
3 @c For copying conditions, see the file install.texi.
4
5 @ifnothtml
6 @comment node-name,     next,          previous, up
7 @node    Old, GNU Free Documentation License, Specific, Top
8 @end ifnothtml
9 @html
10 <h1 align="center">Old installation documentation</h1>
11 @end html
12 @ifnothtml
13 @chapter Old installation documentation
14 @end ifnothtml
15
16 Note most of this information is out of date and superseded by the
17 previous chapters of this manual.  It is provided for historical
18 reference only, because of a lack of volunteers to merge it into the
19 main manual.
20
21 @ifnothtml
22 @menu
23 * Configurations::    Configurations Supported by GNU CC.
24 * Cross-Compiler::   Building and installing a cross-compiler.
25 * VMS Install::   See below for installation on VMS.
26 @end menu
27 @end ifnothtml
28
29 Here is the procedure for installing GNU CC on a GNU or Unix system.
30 See @ref{VMS Install}, for VMS systems.
31
32 @enumerate
33 @item
34 If you have chosen a configuration for GNU CC which requires other GNU
35 tools (such as GAS or the GNU linker) instead of the standard system
36 tools, install the required tools in the build directory under the names
37 @file{as}, @file{ld} or whatever is appropriate.  This will enable the
38 compiler to find the proper tools for compilation of the program
39 @file{enquire}.
40
41 Alternatively, you can do subsequent compilation using a value of the
42 @code{PATH} environment variable such that the necessary GNU tools come
43 before the standard system tools.
44
45 @item
46 Specify the host, build and target machine configurations.  You do this
47 when you run the @file{configure} script.
48
49 The @dfn{build} machine is the system which you are using, the
50 @dfn{host} machine is the system where you want to run the resulting
51 compiler (normally the build machine), and the @dfn{target} machine is
52 the system for which you want the compiler to generate code.
53
54 If you are building a compiler to produce code for the machine it runs
55 on (a native compiler), you normally do not need to specify any operands
56 to @file{configure}; it will try to guess the type of machine you are on
57 and use that as the build, host and target machines.  So you don't need
58 to specify a configuration when building a native compiler unless
59 @file{configure} cannot figure out what your configuration is or guesses
60 wrong.
61
62 In those cases, specify the build machine's @dfn{configuration name}
63 with the @option{--host} option; the host and target will default to be
64 the same as the host machine.  (If you are building a cross-compiler,
65 see @ref{Cross-Compiler}.)
66
67 Here is an example:
68
69 @smallexample
70 ./configure --host=sparc-sun-sunos4.1
71 @end smallexample
72
73 A configuration name may be canonical or it may be more or less
74 abbreviated.
75
76 A canonical configuration name has three parts, separated by dashes.
77 It looks like this: @samp{@var{cpu}-@var{company}-@var{system}}.
78 (The three parts may themselves contain dashes; @file{configure}
79 can figure out which dashes serve which purpose.)  For example,
80 @samp{m68k-sun-sunos4.1} specifies a Sun 3.
81
82 You can also replace parts of the configuration by nicknames or aliases.
83 For example, @samp{sun3} stands for @samp{m68k-sun}, so
84 @samp{sun3-sunos4.1} is another way to specify a Sun 3.
85
86 You can specify a version number after any of the system types, and some
87 of the CPU types.  In most cases, the version is irrelevant, and will be
88 ignored.  So you might as well specify the version if you know it.
89
90 See @ref{Configurations}, for a list of supported configuration names and
91 notes on many of the configurations.  You should check the notes in that
92 section before proceeding any further with the installation of GNU CC@.
93
94 @end enumerate
95
96 @ifnothtml
97 @node Configurations, Cross-Compiler, , Old
98 @section Configurations Supported by GNU CC
99 @end ifnothtml
100 @html
101 <h2>@anchor{Configurations}Configurations Supported by GNU CC</h2>
102 @end html
103 @cindex configurations supported by GNU CC
104
105 Here are the possible CPU types:
106
107 @quotation
108 @c gmicro, fx80, spur and tahoe omitted since they don't work.
109 1750a, a29k, alpha, arm, avr, c@var{n}, clipper, dsp16xx, elxsi, fr30, h8300,
110 hppa1.0, hppa1.1, i370, i386, i486, i586, i686, i786, i860, i960, m32r,
111 m68000, m68k, m6811, m6812, m88k, mcore, mips, mipsel, mips64, mips64el,
112 mn10200, mn10300, ns32k, pdp11, powerpc, powerpcle, romp, rs6000, sh, sparc,
113 sparclite, sparc64, v850, vax, we32k.
114 @end quotation
115
116 Here are the recognized company names.  As you can see, customary
117 abbreviations are used rather than the longer official names.
118
119 @c What should be done about merlin, tek*, dolphin?
120 @quotation
121 acorn, alliant, altos, apollo, apple, att, bull,
122 cbm, convergent, convex, crds, dec, dg, dolphin,
123 elxsi, encore, harris, hitachi, hp, ibm, intergraph, isi,
124 mips, motorola, ncr, next, ns, omron, plexus,
125 sequent, sgi, sony, sun, tti, unicom, wrs.
126 @end quotation
127
128 The company name is meaningful only to disambiguate when the rest of
129 the information supplied is insufficient.  You can omit it, writing
130 just @samp{@var{cpu}-@var{system}}, if it is not needed.  For example,
131 @samp{vax-ultrix4.2} is equivalent to @samp{vax-dec-ultrix4.2}.
132
133 Here is a list of system types:
134
135 @quotation
136 386bsd, aix, acis, amigaos, aos, aout, aux, bosx, bsd, clix, coff, ctix, cxux,
137 dgux, dynix, ebmon, ecoff, elf, esix, freebsd, hms, genix, gnu, linux,
138 linux-gnu, hiux, hpux, iris, irix, isc, luna, lynxos, mach, minix, msdos, mvs,
139 netbsd, newsos, nindy, ns, osf, osfrose, ptx, riscix, riscos, rtu, sco, sim,
140 solaris, sunos, sym, sysv, udi, ultrix, unicos, uniplus, unos, vms, vsta,
141 vxworks, winnt, xenix.
142 @end quotation
143
144 @noindent
145 You can omit the system type; then @file{configure} guesses the
146 operating system from the CPU and company.
147
148 You can add a version number to the system type; this may or may not
149 make a difference.  For example, you can write @samp{bsd4.3} or
150 @samp{bsd4.4} to distinguish versions of BSD@.  In practice, the version
151 number is most needed for @samp{sysv3} and @samp{sysv4}, which are often
152 treated differently.
153
154 @samp{linux-gnu} is the canonical name for the GNU/Linux target; however
155 GNU CC will also accept @samp{linux}.  The version of the kernel in use is
156 not relevant on these systems.  A suffix such as @samp{libc1} or @samp{aout}
157 distinguishes major versions of the C library; all of the suffixed versions
158 are obsolete.
159
160 If you specify an impossible combination such as @samp{i860-dg-vms},
161 then you may get an error message from @file{configure}, or it may
162 ignore part of the information and do the best it can with the rest.
163 @file{configure} always prints the canonical name for the alternative
164 that it used.  GNU CC does not support all possible alternatives.
165
166 Often a particular model of machine has a name.  Many machine names are
167 recognized as aliases for CPU/company combinations.  Thus, the machine
168 name @samp{sun3}, mentioned above, is an alias for @samp{m68k-sun}.
169 Sometimes we accept a company name as a machine name, when the name is
170 popularly used for a particular machine.  Here is a table of the known
171 machine names:
172
173 @quotation
174 3300, 3b1, 3b@var{n}, 7300, altos3068, altos,
175 apollo68, att-7300, balance,
176 convex-c@var{n}, crds, decstation-3100,
177 decstation, delta, encore,
178 fx2800, gmicro, hp7@var{nn}, hp8@var{nn},
179 hp9k2@var{nn}, hp9k3@var{nn}, hp9k7@var{nn},
180 hp9k8@var{nn}, iris4d, iris, isi68,
181 m3230, magnum, merlin, miniframe,
182 mmax, news-3600, news800, news, next,
183 pbd, pc532, pmax, powerpc, powerpcle, ps2, risc-news,
184 rtpc, sun2, sun386i, sun386, sun3,
185 sun4, symmetry, tower-32, tower.
186 @end quotation
187
188 @noindent
189 Remember that a machine name specifies both the cpu type and the company
190 name.
191 If you want to install your own homemade configuration files, you can
192 use @samp{local} as the company name to access them.  If you use
193 configuration @samp{@var{cpu}-local}, the configuration name
194 without the cpu prefix
195 is used to form the configuration file names.
196
197 Thus, if you specify @samp{m68k-local}, configuration uses
198 files @file{m68k.md}, @file{local.h}, @file{m68k.c},
199 @file{xm-local.h}, @file{t-local}, and @file{x-local}, all in the
200 directory @file{config/m68k}.
201
202 Here is a list of configurations that have special treatment or special
203 things you must know:
204
205 @table @samp
206 @item vax-dec-vms
207 See @ref{VMS Install}, for details on how to install GNU CC on VMS@.
208 @end table
209
210 @ifnothtml
211 @node Cross-Compiler, VMS Install, Configurations, Old
212 @section Building and Installing a Cross-Compiler
213 @end ifnothtml
214 @html
215 <h2>@anchor{Cross-Compiler}Building and Installing a Cross-Compiler</h2>
216 @end html
217 @cindex cross-compiler, installation
218
219 GNU CC can function as a cross-compiler for many machines, but not all.
220
221 @itemize @bullet
222 @item
223 Cross-compilers for the Mips as target using the Mips assembler
224 currently do not work, because the auxiliary programs
225 @file{mips-tdump.c} and @file{mips-tfile.c} can't be compiled on
226 anything but a Mips.  It does work to cross compile for a Mips
227 if you use the GNU assembler and linker.
228
229 @item
230 Cross-compilers between machines with different floating point formats
231 have not all been made to work.  GNU CC now has a floating point
232 emulator with which these can work, but each target machine description
233 needs to be updated to take advantage of it.
234
235 @item
236 Cross-compilation between machines of different word sizes is
237 somewhat problematic and sometimes does not work.
238 @end itemize
239
240 Since GNU CC generates assembler code, you probably need a
241 cross-assembler that GNU CC can run, in order to produce object files.
242 If you want to link on other than the target machine, you need a
243 cross-linker as well.  You also need header files and libraries suitable
244 for the target machine that you can install on the host machine.
245
246 @ifnothtml
247 @menu
248 * Steps of Cross::      Using a cross-compiler involves several steps
249                           that may be carried out on different machines.
250 * Configure Cross::     Configuring a cross-compiler.
251 * Tools and Libraries:: Where to put the linker and assembler, and the C library.
252 * Cross Headers::       Finding and installing header files
253                           for a cross-compiler.
254 * Build Cross::         Actually compiling the cross-compiler.
255 @end menu
256 @end ifnothtml
257
258 @ifnothtml
259 @node Steps of Cross, Configure Cross, , Cross-Compiler
260 @subsection Steps of Cross-Compilation
261 @end ifnothtml
262 @html
263 <h2>Steps of Cross-Compilation</h2>
264 @end html
265
266 To compile and run a program using a cross-compiler involves several
267 steps:
268
269 @itemize @bullet
270 @item
271 Run the cross-compiler on the host machine to produce assembler files
272 for the target machine.  This requires header files for the target
273 machine.
274
275 @item
276 Assemble the files produced by the cross-compiler.  You can do this
277 either with an assembler on the target machine, or with a
278 cross-assembler on the host machine.
279
280 @item
281 Link those files to make an executable.  You can do this either with a
282 linker on the target machine, or with a cross-linker on the host
283 machine.  Whichever machine you use, you need libraries and certain
284 startup files (typically @file{crt@dots{}.o}) for the target machine.
285 @end itemize
286
287 It is most convenient to do all of these steps on the same host machine,
288 since then you can do it all with a single invocation of GNU CC@.  This
289 requires a suitable cross-assembler and cross-linker.  For some targets,
290 the GNU assembler and linker are available.
291
292 @ifnothtml
293 @node Configure Cross, Tools and Libraries, Steps of Cross, Cross-Compiler
294 @subsection Configuring a Cross-Compiler
295 @end ifnothtml
296 @html
297 <h2>Configuring a Cross-Compiler</h2>
298 @end html
299
300 To build GNU CC as a cross-compiler, you start out by running
301 @file{configure}.  Use the @option{--target=@var{target}} to specify the
302 target type.  If @file{configure} was unable to correctly identify the
303 system you are running on, also specify the @option{--build=@var{build}}
304 option.  For example, here is how to configure for a cross-compiler that
305 produces code for an HP 68030 system running BSD on a system that
306 @file{configure} can correctly identify:
307
308 @smallexample
309 ./configure --target=m68k-hp-bsd4.3
310 @end smallexample
311
312 @ifnothtml
313 @node Tools and Libraries, Cross Headers, Configure Cross, Cross-Compiler
314 @subsection Tools and Libraries for a Cross-Compiler
315 @end ifnothtml
316 @html
317 <h2>Tools and Libraries for a Cross-Compiler</h2>
318 @end html
319
320 If you have a cross-assembler and cross-linker available, you should
321 install them now.  Put them in the directory
322 @file{/usr/local/@var{target}/bin}.  Here is a table of the tools
323 you should put in this directory:
324
325 @table @file
326 @item as
327 This should be the cross-assembler.
328
329 @item ld
330 This should be the cross-linker.
331
332 @item ar
333 This should be the cross-archiver: a program which can manipulate
334 archive files (linker libraries) in the target machine's format.
335
336 @item ranlib
337 This should be a program to construct a symbol table in an archive file.
338 @end table
339
340 The installation of GNU CC will find these programs in that directory,
341 and copy or link them to the proper place to for the cross-compiler to
342 find them when run later.
343
344 The easiest way to provide these files is to build the Binutils package
345 and GAS@.  Configure them with the same @option{--host} and @option{--target}
346 options that you use for configuring GNU CC, then build and install
347 them.  They install their executables automatically into the proper
348 directory.  Alas, they do not support all the targets that GNU CC
349 supports.
350
351 If you want to install libraries to use with the cross-compiler, such as
352 a standard C library, put them in the directory
353 @file{/usr/local/@var{target}/lib}; installation of GNU CC copies
354 all the files in that subdirectory into the proper place for GNU CC to
355 find them and link with them.  Here's an example of copying some
356 libraries from a target machine:
357
358 @example
359 ftp @var{target-machine}
360 lcd /usr/local/@var{target}/lib
361 cd /lib
362 get libc.a
363 cd /usr/lib
364 get libg.a
365 get libm.a
366 quit
367 @end example
368
369 @noindent
370 The precise set of libraries you'll need, and their locations on
371 the target machine, vary depending on its operating system.
372
373 @cindex start files
374 Many targets require ``start files'' such as @file{crt0.o} and
375 @file{crtn.o} which are linked into each executable; these too should be
376 placed in @file{/usr/local/@var{target}/lib}.  There may be several
377 alternatives for @file{crt0.o}, for use with profiling or other
378 compilation options.  Check your target's definition of
379 @code{STARTFILE_SPEC} to find out what start files it uses.
380 Here's an example of copying these files from a target machine:
381
382 @example
383 ftp @var{target-machine}
384 lcd /usr/local/@var{target}/lib
385 prompt
386 cd /lib
387 mget *crt*.o
388 cd /usr/lib
389 mget *crt*.o
390 quit
391 @end example
392
393 @ifnothtml
394 @node Cross Headers, Build Cross, Tools and Libraries, Cross-Compiler
395 @subsection Cross-Compilers and Header Files
396 @end ifnothtml
397 @html
398 <h2>Cross-Compilers and Header Files</h2>
399 @end html
400
401 If you are cross-compiling a standalone program or a program for an
402 embedded system, then you may not need any header files except the few
403 that are part of GNU CC (and those of your program).  However, if you
404 intend to link your program with a standard C library such as
405 @file{libc.a}, then you probably need to compile with the header files
406 that go with the library you use.
407
408 The GNU C compiler does not come with these files, because (1) they are
409 system-specific, and (2) they belong in a C library, not in a compiler.
410
411 If the GNU C library supports your target machine, then you can get the
412 header files from there (assuming you actually use the GNU library when
413 you link your program).
414
415 If your target machine comes with a C compiler, it probably comes with
416 suitable header files also.  If you make these files accessible from the host
417 machine, the cross-compiler can use them also.
418
419 Otherwise, you're on your own in finding header files to use when
420 cross-compiling.
421
422 When you have found suitable header files, you should put them in the
423 directory @file{/usr/local/@var{target}/include}, before building the
424 cross compiler.  Then installation will run fixincludes properly and
425 install the corrected versions of the header files where the compiler
426 will use them.
427
428 Provide the header files before you build the cross-compiler, because
429 the build stage actually runs the cross-compiler to produce parts of
430 @file{libgcc.a}.  (These are the parts that @emph{can} be compiled with
431 GNU CC@.)  Some of them need suitable header files.
432
433 Here's an example showing how to copy the header files from a target
434 machine.  On the target machine, do this:
435
436 @example
437 (cd /usr/include; tar cf - .) > tarfile
438 @end example
439
440 Then, on the host machine, do this:
441
442 @example
443 ftp @var{target-machine}
444 lcd /usr/local/@var{target}/include
445 get tarfile
446 quit
447 tar xf tarfile
448 @end example
449
450 @ifnothtml
451 @node Build Cross, , Cross Headers, Cross-Compiler
452 @subsection Actually Building the Cross-Compiler
453 @end ifnothtml
454 @html
455 <h2>Actually Building the Cross-Compiler</h2>
456 @end html
457
458 Now you can proceed just as for compiling a single-machine compiler
459 through the step of building stage 1.
460
461 If your target is exotic, you may need to provide the header file
462 @file{float.h}.One way to do this is to compile @file{enquire} and run
463 it on your target machine.  The job of @file{enquire} is to run on the
464 target machine and figure out by experiment the nature of its floating
465 point representation.  @file{enquire} records its findings in the header
466 file @file{float.h}.  If you can't produce this file by running
467 @file{enquire} on the target machine, then you will need to come up with
468 a suitable @file{float.h} in some other way (or else, avoid using it in
469 your programs).
470
471 Do not try to build stage 2 for a cross-compiler.  It doesn't work to
472 rebuild GNU CC as a cross-compiler using the cross-compiler, because
473 that would produce a program that runs on the target machine, not on the
474 host.  For example, if you compile a 386-to-68030 cross-compiler with
475 itself, the result will not be right either for the 386 (because it was
476 compiled into 68030 code) or for the 68030 (because it was configured
477 for a 386 as the host).  If you want to compile GNU CC into 68030 code,
478 whether you compile it on a 68030 or with a cross-compiler on a 386, you
479 must specify a 68030 as the host when you configure it.
480
481 To install the cross-compiler, use @samp{make install}, as usual.
482
483 @ifnothtml
484 @node VMS Install, , Cross-Compiler, Old
485 @section Installing GNU CC on VMS
486 @end ifnothtml
487 @html
488 <h2>@anchor{VMS Install}Installing GNU CC on VMS</h2>
489 @end html
490 @cindex VMS installation
491 @cindex installing GNU CC on VMS
492
493 The VMS version of GNU CC is distributed in a backup saveset containing
494 both source code and precompiled binaries.
495
496 To install the @file{gcc} command so you can use the compiler easily, in
497 the same manner as you use the VMS C compiler, you must install the VMS CLD
498 file for GNU CC as follows:
499
500 @enumerate
501 @item
502 Define the VMS logical names @samp{GNU_CC} and @samp{GNU_CC_INCLUDE}
503 to point to the directories where the GNU CC executables
504 (@file{gcc-cpp.exe}, @file{gcc-cc1.exe}, etc.) and the C include files are
505 kept respectively.  This should be done with the commands:
506
507 @smallexample
508 $ assign /system /translation=concealed -
509   disk:[gcc.] gnu_cc
510 $ assign /system /translation=concealed -
511   disk:[gcc.include.] gnu_cc_include
512 @end smallexample
513
514 @noindent
515 with the appropriate disk and directory names.  These commands can be
516 placed in your system startup file so they will be executed whenever
517 the machine is rebooted.  You may, if you choose, do this via the
518 @file{GCC_INSTALL.COM} script in the @file{[GCC]} directory.
519
520 @item
521 Install the @file{GCC} command with the command line:
522
523 @smallexample
524 $ set command /table=sys$common:[syslib]dcltables -
525   /output=sys$common:[syslib]dcltables gnu_cc:[000000]gcc
526 $ install replace sys$common:[syslib]dcltables
527 @end smallexample
528
529 @item
530 To install the help file, do the following:
531
532 @smallexample
533 $ library/help sys$library:helplib.hlb gcc.hlp
534 @end smallexample
535
536 @noindent
537 Now you can invoke the compiler with a command like @samp{gcc /verbose
538 file.c}, which is equivalent to the command @samp{gcc -v -c file.c} in
539 Unix.
540 @end enumerate
541
542 If you wish to use GNU C++ you must first install GNU CC, and then
543 perform the following steps:
544
545 @enumerate
546 @item
547 Define the VMS logical name @samp{GNU_GXX_INCLUDE} to point to the
548 directory where the preprocessor will search for the C++ header files.
549 This can be done with the command:
550
551 @smallexample
552 $ assign /system /translation=concealed -
553   disk:[gcc.gxx_include.] gnu_gxx_include
554 @end smallexample
555
556 @noindent
557 with the appropriate disk and directory name.  If you are going to be
558 using a C++ runtime library, this is where its install procedure will install
559 its header files.
560
561 @item
562 Obtain the file @file{gcc-cc1plus.exe}, and place this in the same
563 directory that @file{gcc-cc1.exe} is kept.
564
565 The GNU C++ compiler can be invoked with a command like @samp{gcc /plus
566 /verbose file.cc}, which is equivalent to the command @samp{g++ -v -c
567 file.cc} in Unix.
568 @end enumerate
569
570 We try to put corresponding binaries and sources on the VMS distribution
571 tape.  But sometimes the binaries will be from an older version than the
572 sources, because we don't always have time to update them.  (Use the
573 @samp{/version} option to determine the version number of the binaries and
574 compare it with the source file @file{version.c} to tell whether this is
575 so.)  In this case, you should use the binaries you get to recompile the
576 sources.  If you must recompile, here is how:
577
578 @enumerate
579 @item
580 Execute the command procedure @file{vmsconfig.com} to set up the files
581 @file{tm.h}, @file{config.h}, @file{aux-output.c}, and @file{md.}, and
582 to create files @file{tconfig.h} and @file{hconfig.h}.  This procedure
583 also creates several linker option files used by @file{make-cc1.com} and
584 a data file used by @file{make-l2.com}.
585
586 @smallexample
587 $ @@vmsconfig.com
588 @end smallexample
589
590 @item
591 Setup the logical names and command tables as defined above.  In
592 addition, define the VMS logical name @samp{GNU_BISON} to point at the
593 to the directories where the Bison executable is kept.  This should be
594 done with the command:
595
596 @smallexample
597 $ assign /system /translation=concealed -
598   disk:[bison.] gnu_bison
599 @end smallexample
600
601 You may, if you choose, use the @file{INSTALL_BISON.COM} script in the
602 @file{[BISON]} directory.
603
604 @item
605 Install the @samp{BISON} command with the command line:
606
607 @smallexample
608 $ set command /table=sys$common:[syslib]dcltables -
609   /output=sys$common:[syslib]dcltables -
610   gnu_bison:[000000]bison
611 $ install replace sys$common:[syslib]dcltables
612 @end smallexample
613
614 @item
615 Type @samp{@@make-gcc} to recompile everything, or submit the file
616 @file{make-gcc.com} to a batch queue.  If you wish to build the GNU C++
617 compiler as well as the GNU CC compiler, you must first edit
618 @file{make-gcc.com} and follow the instructions that appear in the
619 comments.
620
621 @item
622 In order to use GCC, you need a library of functions which GCC compiled code
623 will call to perform certain tasks, and these functions are defined in the
624 file @file{libgcc2.c}.  To compile this you should use the command procedure
625 @file{make-l2.com}, which will generate the library @file{libgcc2.olb}.
626 @file{libgcc2.olb} should be built using the compiler built from
627 the same distribution that @file{libgcc2.c} came from, and
628 @file{make-gcc.com} will automatically do all of this for you.
629
630 To install the library, use the following commands:
631
632 @smallexample
633 $ library gnu_cc:[000000]gcclib/delete=(new,eprintf)
634 $ library gnu_cc:[000000]gcclib/delete=L_*
635 $ library libgcc2/extract=*/output=libgcc2.obj
636 $ library gnu_cc:[000000]gcclib libgcc2.obj
637 @end smallexample
638
639 The first command simply removes old modules that will be replaced with
640 modules from @file{libgcc2} under different module names.  The modules
641 @code{new} and @code{eprintf} may not actually be present in your
642 @file{gcclib.olb}---if the VMS librarian complains about those modules
643 not being present, simply ignore the message and continue on with the
644 next command.  The second command removes the modules that came from the
645 previous version of the library @file{libgcc2.c}.
646
647 Whenever you update the compiler on your system, you should also update the
648 library with the above procedure.
649
650 @item
651 You may wish to build GCC in such a way that no files are written to the
652 directory where the source files reside.  An example would be the when
653 the source files are on a read-only disk.  In these cases, execute the
654 following DCL commands (substituting your actual path names):
655
656 @smallexample
657 $ assign dua0:[gcc.build_dir.]/translation=concealed, -
658          dua1:[gcc.source_dir.]/translation=concealed  gcc_build
659 $ set default gcc_build:[000000]
660 @end smallexample
661
662 @noindent
663 where the directory @file{dua1:[gcc.source_dir]} contains the source
664 code, and the directory @file{dua0:[gcc.build_dir]} is meant to contain
665 all of the generated object files and executables.  Once you have done
666 this, you can proceed building GCC as described above.  (Keep in mind
667 that @file{gcc_build} is a rooted logical name, and thus the device
668 names in each element of the search list must be an actual physical
669 device name rather than another rooted logical name).
670
671 @item
672 @strong{If you are building GNU CC with a previous version of GNU CC,
673 you also should check to see that you have the newest version of the
674 assembler}.  In particular, GNU CC version 2 treats global constant
675 variables slightly differently from GNU CC version 1, and GAS version
676 1.38.1 does not have the patches required to work with GCC version 2.
677 If you use GAS 1.38.1, then @code{extern const} variables will not have
678 the read-only bit set, and the linker will generate warning messages
679 about mismatched psect attributes for these variables.  These warning
680 messages are merely a nuisance, and can safely be ignored.
681
682 @item
683 If you want to build GNU CC with the VAX C compiler, you will need to
684 make minor changes in @file{make-cccp.com} and @file{make-cc1.com}
685 to choose alternate definitions of @code{CC}, @code{CFLAGS}, and
686 @code{LIBS}.  See comments in those files.  However, you must
687 also have a working version of the GNU assembler (GNU as, aka GAS) as
688 it is used as the back end for GNU CC to produce binary object modules
689 and is not included in the GNU CC sources.  GAS is also needed to
690 compile @file{libgcc2} in order to build @file{gcclib} (see above);
691 @file{make-l2.com} expects to be able to find it operational in
692 @file{gnu_cc:[000000]gnu-as.exe}.
693
694 To use GNU CC on VMS, you need the VMS driver programs
695 @file{gcc.exe}, @file{gcc.com}, and @file{gcc.cld}.  They are
696 distributed with the VMS binaries (@file{gcc-vms}) rather than the
697 GNU CC sources.  GAS is also included in @file{gcc-vms}, as is Bison.
698
699 Once you have successfully built GNU CC with VAX C, you should use the
700 resulting compiler to rebuild itself.  Before doing this, be sure to
701 restore the @code{CC}, @code{CFLAGS}, and @code{LIBS} definitions in
702 @file{make-cccp.com} and @file{make-cc1.com}.  The second generation
703 compiler will be able to take advantage of many optimizations that must
704 be suppressed when building with other compilers.
705 @end enumerate
706
707 Under previous versions of GNU CC, the generated code would occasionally
708 give strange results when linked with the sharable @file{VAXCRTL} library.
709 Now this should work.
710
711 Even with this version, however, GNU CC itself should not be linked with
712 the sharable @file{VAXCRTL}.  The version of @code{qsort} in
713 @file{VAXCRTL} has a bug (known to be present in VMS versions V4.6
714 through V5.5) which causes the compiler to fail.
715
716 The executables are generated by @file{make-cc1.com} and
717 @file{make-cccp.com} use the object library version of @file{VAXCRTL} in
718 order to make use of the @code{qsort} routine in @file{gcclib.olb}.  If
719 you wish to link the compiler executables with the shareable image
720 version of @file{VAXCRTL}, you should edit the file @file{tm.h} (created
721 by @file{vmsconfig.com}) to define the macro @code{QSORT_WORKAROUND}.
722
723 @code{QSORT_WORKAROUND} is always defined when GNU CC is compiled with
724 VAX C, to avoid a problem in case @file{gcclib.olb} is not yet
725 available.