⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 install.texi

📁 gcc库的原代码,对编程有很大帮助.
💻 TEXI
📖 第 1 页 / 共 5 页
字号:
@end smallexampleThe files are moved into a subdirectory named @file{stage1}.Once installation is complete, you may wish to delete these fileswith @code{rm -r stage1}.@itemIf you have chosen a configuration for GNU CC which requires other GNUtools (such as GAS or the GNU linker) instead of the standard systemtools, install the required tools in the @file{stage1} subdirectoryunder the names @file{as}, @file{ld} or whatever is appropriate.  Thiswill enable the stage 1 compiler to find the proper tools in thefollowing stage.Alternatively, you can do subsequent compilation using a value of the@code{PATH} environment variable such that the necessary GNU tools comebefore the standard system tools.@itemRecompile the compiler with itself, with this command:@smallexamplemake CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O2"@end smallexampleThis is called making the stage 2 compiler.The command shown above builds compilers for all the supportedlanguages.  If you don't want them all, you can specify the languages tobuild by typing the argument @samp{LANGUAGES="@var{list}"}.  @var{list}should contain one or more words from the list @samp{c}, @samp{c++},@samp{objective-c}, and @samp{proto}.  Separate the words with spaces.@samp{proto} stands for the programs @code{protoize} and@code{unprotoize}; they are not a separate language, but you use@code{LANGUAGES} to enable or disable their installation.If you are going to build the stage 3 compiler, then you might want tobuild only the C language in stage 2.Once you have built the stage 2 compiler, if you are short of diskspace, you can delete the subdirectory @file{stage1}.On a 68000 or 68020 system lacking floating point hardware,unless you have selected a @file{tm.h} file that expects by defaultthat there is no such hardware, do this instead:@smallexamplemake CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O2 -msoft-float"@end smallexample@itemIf you wish to test the compiler by compiling it with itself one moretime, install any other necessary GNU tools (such as GAS or the GNUlinker) in the @file{stage2} subdirectory as you did in the@file{stage1} subdirectory, then do this:@smallexamplemake stage2make CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O2" @end smallexample@noindentThis is called making the stage 3 compiler.  Aside from the @samp{-B}option, the compiler options should be the same as when you made thestage 2 compiler.  But the @code{LANGUAGES} option need not be thesame.  The command shown above builds compilers for all the supportedlanguages; if you don't want them all, you can specify the languages tobuild by typing the argument @samp{LANGUAGES="@var{list}"}, as describedabove.If you do not have to install any additional GNU tools, you may use thecommand@smallexamplemake bootstrap LANGUAGES=@var{language-list} BOOT_CFLAGS=@var{option-list}@end smallexample@noindentinstead of making @file{stage1}, @file{stage2}, and performingthe two compiler builds.@itemThen compare the latest object files with the stage 2 objectfiles---they ought to be identical, aside from time stamps (if any).On some systems, meaningful comparison of object files is impossible;they always appear ``different.''  This is currently true on Solaris andsome systems that use ELF object file format.  On some versions of Irixon SGI machines and DEC Unix (OSF/1) on Alpha systems, you will not beable to compare the files without specifying @file{-save-temps}; see thedescription of individual systems above to see if you get comparisonfailures.  You may have similar problems on other systems.Use this command to compare the files:@smallexamplemake compare@end smallexampleThis will mention any object files that differ between stage 2 and stage3.  Any difference, no matter how innocuous, indicates that the stage 2compiler has compiled GNU CC incorrectly, and is therefore a potentially@ifclear INSTALLONLYserious bug which you should investigate and report (@pxref{Bugs}).@end ifclear@ifset INSTALLONLYserious bug which you should investigate and report.@end ifsetIf your system does not put time stamps in the object files, then thisis a faster way to compare them (using the Bourne shell):@smallexamplefor file in *.o; docmp $file stage2/$filedone@end smallexampleIf you have built the compiler with the @samp{-mno-mips-tfile} option onMIPS machines, you will not be able to compare the files.@itemInstall the compiler driver, the compiler's passes and run-time supportwith @samp{make install}.  Use the same value for @code{CC},@code{CFLAGS} and @code{LANGUAGES} that you used when compiling thefiles that are being installed.  One reason this is necessary is thatsome versions of Make have bugs and recompile files gratuitously whenyou do this step.  If you use the same variable values, those files willbe recompiled properly.For example, if you have built the stage 2 compiler, you can use thefollowing command:@smallexamplemake install CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O" LANGUAGES="@var{list}"@end smallexample@noindentThis copies the files @file{cc1}, @file{cpp} and @file{libgcc.a} tofiles @file{cc1}, @file{cpp} and @file{libgcc.a} in the directory@file{/usr/local/lib/gcc-lib/@var{target}/@var{version}}, which is wherethe compiler driver program looks for them.  Here @var{target} is thetarget machine type specified when you ran @file{configure}, and@var{version} is the version number of GNU CC.  This naming schemepermits various versions and/or cross-compilers to coexist.This also copies the driver program @file{xgcc} into@file{/usr/local/bin/gcc}, so that it appears in typical executionsearch paths.On some systems, this command causes recompilation of some files.  Thisis usually due to bugs in @code{make}.  You should either ignore thisproblem, or use GNU Make.@cindex @code{alloca} and SunOs@strong{Warning: there is a bug in @code{alloca} in the Sun library.  Toavoid this bug, be sure to install the executables of GNU CC that werecompiled by GNU CC.  (That is, the executables from stage 2 or 3, notstage 1.)  They use @code{alloca} as a built-in function and never theone in the library.}(It is usually better to install GNU CC executables from stage 2 or 3,since they usually run faster than the ones compiled with some othercompiler.)@itemIf you're going to use C++, it's likely that you need to also installthe libg++ distribution.  It should be available from the sameplace where you got the GNU C distribution.  Just as GNU C does notdistribute a C runtime library, it also does not include a C++ run-timelibrary.  All I/O functionality, special class libraries, etc., areavailable in the libg++ distribution.@end enumerate@node Configurations@section Configurations Supported by GNU CC@cindex configurations supported by GNU CCHere are the possible CPU types:@quotation@c gmicro, alliant, spur and tahoe omitted since they don't work.1750a, a29k, alpha, arm, c@var{n}, clipper, dsp16xx, elxsi, h8300,hppa1.0, hppa1.1, i370, i386, i486, i586, i860, i960, m68000, m68k,m88k, mips, mipsel, mips64, mips64el, ns32k, powerpc, powerpcle,pyramid, romp, rs6000, sh, sparc, sparclite, sparc64, vax, we32k.@end quotationHere are the recognized company names.  As you can see, customaryabbreviations are used rather than the longer official names.@c What should be done about merlin, tek*, dolphin?@quotationacorn, alliant, altos, apollo, att, bull,cbm, convergent, convex, crds, dec, dg, dolphin,elxsi, encore, harris, hitachi, hp, ibm, intergraph, isi,mips, motorola, ncr, next, ns, omron, plexus,sequent, sgi, sony, sun, tti, unicom, wrs.@end quotationThe company name is meaningful only to disambiguate when the rest ofthe information supplied is insufficient.  You can omit it, writingjust @samp{@var{cpu}-@var{system}}, if it is not needed.  For example,@samp{vax-ultrix4.2} is equivalent to @samp{vax-dec-ultrix4.2}.Here is a list of system types:@quotation386bsd, aix, acis, amigados, aos, aout, bosx, bsd, clix, coff, ctix, cxux,dgux, dynix, ebmon, ecoff, elf, esix, freebsd, hms, genix, gnu, gnu/linux,hiux, hpux, iris, irix, isc, luna, lynxos, mach, minix, msdos, mvs,netbsd, newsos, nindy, ns, osf, osfrose, ptx, riscix, riscos, rtu, sco, sim,solaris, sunos, sym, sysv, udi, ultrix, unicos, uniplus, unos, vms, vsta,vxworks, winnt, xenix.@end quotation@noindentYou can omit the system type; then @file{configure} guesses theoperating system from the CPU and company.You can add a version number to the system type; this may or may notmake a difference.  For example, you can write @samp{bsd4.3} or@samp{bsd4.4} to distinguish versions of BSD.  In practice, the versionnumber is most needed for @samp{sysv3} and @samp{sysv4}, which are oftentreated differently.If you specify an impossible combination such as @samp{i860-dg-vms},then you may get an error message from @file{configure}, or it mayignore part of the information and do the best it can with the rest.@file{configure} always prints the canonical name for the alternativethat it used.  GNU CC does not support all possible alternatives.Often a particular model of machine has a name.  Many machine names arerecognized as aliases for CPU/company combinations.  Thus, the machinename @samp{sun3}, mentioned above, is an alias for @samp{m68k-sun}.Sometimes we accept a company name as a machine name, when the name ispopularly used for a particular machine.  Here is a table of the knownmachine names:@quotation3300, 3b1, 3b@var{n}, 7300, altos3068, altos,apollo68, att-7300, balance,convex-c@var{n}, crds, decstation-3100,decstation, delta, encore,fx2800, gmicro, hp7@var{nn}, hp8@var{nn},hp9k2@var{nn}, hp9k3@var{nn}, hp9k7@var{nn},hp9k8@var{nn}, iris4d, iris, isi68,m3230, magnum, merlin, miniframe,mmax, news-3600, news800, news, next,pbd, pc532, pmax, powerpc, powerpcle, ps2, risc-news,rtpc, sun2, sun386i, sun386, sun3,sun4, symmetry, tower-32, tower.@end quotation @noindentRemember that a machine name specifies both the cpu type and the companyname.If you want to install your own homemade configuration files, you canuse @samp{local} as the company name to access them.  If you use configuration @samp{@var{cpu}-local}, the configuration namewithout the cpu prefix is used to form the configuration file names.Thus, if you specify @samp{m68k-local}, configuration usesfiles @file{m68k.md}, @file{local.h}, @file{m68k.c},@file{xm-local.h}, @file{t-local}, and @file{x-local}, all in thedirectory @file{config/m68k}.Here is a list of configurations that have special treatment or specialthings you must know:@table @samp@item 1750a-*-*MIL-STD-1750A processors.Starting with GCC 2.6.1, the MIL-STD-1750A cross configuration no longersupports the Tektronix Assembler, but instead produces output for@code{as1750}, an assembler/linker available under the GNU PublicLicense for the 1750A. Contact @emph{kellogg@@space.otn.dasa.de} for moredetails on obtaining @samp{as1750}.  A similarly licensed simulator forthe 1750A is available from same address.You should ignore a fatal error during the building of libgcc (libgcc isnot yet implemented for the 1750A.)The @code{as1750} assembler requires the file @file{ms1750.inc}, which isfound in the directory @file{config/1750a}.GNU CC produced the same sections as the Fairchild F9450 C Compiler,namely:@table @code@item NormalThe program code section.@item StaticThe read/write (RAM) data section.@item KonstThe read-only (ROM) constants section.@item InitInitialization section (code to copy KREL to SREL).@end tableThe smallest addressable unit is 16 bits (BITS_PER_UNIT is 16).  Thismeans that type `char' is represented with a 16-bit word per character.The 1750A's "Load/Store Upper/Lower Byte" instructions are not used byGNU CC.@item alpha-*-osf1Systems using processors that implement the DEC Alpha architecture andare running the DEC Unix (OSF/1) operating system, for example the DECAlpha AXP systems.  (VMS on the Alpha is not currently supported by GNUCC.)GNU CC writes a @samp{.verstamp} directive to the assembler output fileunless it is built as a cross-compiler.  It gets the version to use fromthe system header file @file{/usr/include/stamp.h}.  If you install anew version of DEC Unix, you should rebuild GCC to pick up the new versionstamp.Note that since the Alpha is a 64-bit architecture, cross-compilers from32-bit machines will not generate code as efficient as that generatedwhen the compiler is running on a 64-bit machine because manyoptimizations that depend on being able to represent a word on thetarget in an integral value on the host cannot be performed.  Building

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -