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

📄 install.texi

📁 gcc库的原代码,对编程有很大帮助.
💻 TEXI
📖 第 1 页 / 共 5 页
字号:
Embedded PowerPC system in big endian mode for use in running under thePSIM simulator.  This system is currently under development.@item powerpc-*-eabiEmbedded PowerPC system in big endian mode.This configuration is currently under development.@item powerpcle-*-elf@itemx powerpcle-*-sysv4PowerPC system in little endian mode, running System V.4.This configuration is currently under development.@itemx powerpcle-*-sysv4Embedded PowerPC system in little endian mode.This system is currently under development.@item powerpcle-*-eabisimEmbedded PowerPC system in little endian mode for use in running underthe PSIM simulator.This system is currently under development.@itemx powerpcle-*-eabiEmbedded PowerPC system in little endian mode.This configuration is currently under development.@item vax-dec-ultrixDon't try compiling with Vax C (@code{vcc}).  It produces incorrect codein some cases (for example, when @code{alloca} is used).Meanwhile, compiling @file{cp/parse.c} with pcc does not work because ofan internal table size limitation in that compiler.  To avoid thisproblem, compile just the GNU C compiler first, and use it to recompile building all the languages that you want to run.@item sparc-sun-*See @ref{Sun Install}, for information on installing GNU CC on Sunsystems.@item vax-dec-vmsSee @ref{VMS Install}, for details on how to install GNU CC on VMS.@item we32k-*-*These computers are also known as the 3b2, 3b5, 3b20 and other similarnames.  (However, the 3b1 is actually a 68000; see@ref{Configurations}.)Don't use @samp{-g} when compiling with the system's compiler.  Thesystem's linker seems to be unable to handle such a large program withdebugging information.The system's compiler runs out of capacity when compiling @file{stmt.c}in GNU CC.  You can work around this by building @file{cpp} in GNU CCfirst, then use that instead of the system's preprocessor with thesystem's C compiler to compile @file{stmt.c}.  Here is how:@examplemv /lib/cpp /lib/cpp.attcp cpp /lib/cpp.gnuecho '/lib/cpp.gnu -traditional $@{1+"$@@"@}' > /lib/cppchmod +x /lib/cpp@end exampleThe system's compiler produces bad code for some of the GNU CCoptimization files.  So you must build the stage 2 compiler withoutoptimization.  Then build a stage 3 compiler with optimization.That executable should work.  Here are the necessary commands:@examplemake LANGUAGES=c CC=stage1/xgcc CFLAGS="-Bstage1/ -g"make stage2make CC=stage2/xgcc CFLAGS="-Bstage2/ -g -O"@end exampleYou may need to raise the ULIMIT setting to build a C++ compiler,as the file @file{cc1plus} is larger than one megabyte.@end table@node Other Dir@section Compilation in a Separate Directory@cindex other directory, compilation in@cindex compilation in a separate directory@cindex separate directory, compilation inIf you wish to build the object files and executables in a directoryother than the one containing the source files, here is what you mustdo differently:@enumerate@itemMake sure you have a version of Make that supports the @code{VPATH}feature.  (GNU Make supports it, as do Make versions on most BSDsystems.)@itemIf you have ever run @file{configure} in the source directory, you must undothe configuration.  Do this by running:@examplemake distclean@end example@itemGo to the directory in which you want to build the compiler beforerunning @file{configure}:@examplemkdir gcc-sun3cd gcc-sun3@end exampleOn systems that do not support symbolic links, this directory must beon the same file system as the source code directory.@itemSpecify where to find @file{configure} when you run it:@example../gcc/configure @dots{}@end exampleThis also tells @code{configure} where to find the compiler sources;@code{configure} takes the directory from the file name that was used toinvoke it.  But if you want to be sure, you can specify the sourcedirectory with the @samp{--srcdir} option, like this:@example../gcc/configure --srcdir=../gcc @var{other options}@end exampleThe directory you specify with @samp{--srcdir} need not be the sameas the one that @code{configure} is found in.@end enumerateNow, you can run @code{make} in that directory.  You need not repeat theconfiguration steps shown above, when ordinary source files change.  Youmust, however, run @code{configure} again when the configuration fileschange, if your system does not support symbolic links.@node Cross-Compiler@section Building and Installing a Cross-Compiler@cindex cross-compiler, installationGNU CC can function as a cross-compiler for many machines, but not all.@itemize @bullet@itemCross-compilers for the Mips as target using the Mips assemblercurrently do not work, because the auxiliary programs@file{mips-tdump.c} and @file{mips-tfile.c} can't be compiled onanything but a Mips.  It does work to cross compile for a Mipsif you use the GNU assembler and linker.@itemCross-compilers between machines with different floating point formatshave not all been made to work.  GNU CC now has a floating pointemulator with which these can work, but each target machine descriptionneeds to be updated to take advantage of it.@item Cross-compilation between machines of different word sizes issomewhat problematic and sometimes does not work.@end itemizeSince GNU CC generates assembler code, you probably need across-assembler that GNU CC can run, in order to produce object files.If you want to link on other than the target machine, you need across-linker as well.  You also need header files and libraries suitablefor the target machine that you can install on the host machine.@menu* Steps of Cross::      Using a cross-compiler involves several steps                          that may be carried out on different machines.* Configure Cross::     Configuring a cross-compiler.* Tools and Libraries:: Where to put the linker and assembler, and the C library.* Cross Headers::       Finding and installing header files                          for a cross-compiler.* Cross Runtime::       Supplying arithmetic runtime routines (@file{libgcc1.a}).* Build Cross::         Actually compiling the cross-compiler.@end menu@node Steps of Cross@subsection Steps of Cross-CompilationTo compile and run a program using a cross-compiler involves severalsteps:@itemize @bullet@itemRun the cross-compiler on the host machine to produce assembler filesfor the target machine.  This requires header files for the targetmachine.@itemAssemble the files produced by the cross-compiler.  You can do thiseither with an assembler on the target machine, or with across-assembler on the host machine.@itemLink those files to make an executable.  You can do this either with alinker on the target machine, or with a cross-linker on the hostmachine.  Whichever machine you use, you need libraries and certainstartup files (typically @file{crt@dots{}.o}) for the target machine.@end itemizeIt is most convenient to do all of these steps on the same host machine,since then you can do it all with a single invocation of GNU CC.  Thisrequires a suitable cross-assembler and cross-linker.  For some targets,the GNU assembler and linker are available.@node Configure Cross@subsection Configuring a Cross-CompilerTo build GNU CC as a cross-compiler, you start out by running@file{configure}.  Use the @samp{--target=@var{target}} to specify thetarget type.  If @file{configure} was unable to correctly identify thesystem you are running on, also specify the @samp{--build=@var{build}}option.  For example, here is how to configure for a cross-compiler thatproduces code for an HP 68030 system running BSD on a system that@file{configure} can correctly identify:@smallexample./configure --target=m68k-hp-bsd4.3@end smallexample@node Tools and Libraries@subsection Tools and Libraries for a Cross-CompilerIf you have a cross-assembler and cross-linker available, you shouldinstall them now.  Put them in the directory@file{/usr/local/@var{target}/bin}.  Here is a table of the toolsyou should put in this directory:@table @file@item asThis should be the cross-assembler.@item ldThis should be the cross-linker.@item arThis should be the cross-archiver: a program which can manipulatearchive files (linker libraries) in the target machine's format.@item ranlibThis should be a program to construct a symbol table in an archive file.@end tableThe installation of GNU CC will find these programs in that directory,and copy or link them to the proper place to for the cross-compiler tofind them when run later.The easiest way to provide these files is to build the Binutils packageand GAS.  Configure them with the same @samp{--host} and @samp{--target}options that you use for configuring GNU CC, then build and installthem.  They install their executables automatically into the properdirectory.  Alas, they do not support all the targets that GNU CCsupports.If you want to install libraries to use with the cross-compiler, such asa standard C library, put them in the directory@file{/usr/local/@var{target}/lib}; installation of GNU CC copies allall the files in that subdirectory into the proper place for GNU CC tofind them and link with them.  Here's an example of copying somelibraries from a target machine:@exampleftp @var{target-machine}lcd /usr/local/@var{target}/libcd /libget libc.acd /usr/libget libg.aget libm.aquit@end example@noindentThe precise set of libraries you'll need, and their locations onthe target machine, vary depending on its operating system.@cindex start filesMany targets require ``start files'' such as @file{crt0.o} and@file{crtn.o} which are linked into each executable; these too should beplaced in @file{/usr/local/@var{target}/lib}.  There may be severalalternatives for @file{crt0.o}, for use with profiling or othercompilation options.  Check your target's definition of@code{STARTFILE_SPEC} to find out what start files it uses.Here's an example of copying these files from a target machine:@exampleftp @var{target-machine}lcd /usr/local/@var{target}/libpromptcd /libmget *crt*.ocd /usr/libmget *crt*.oquit@end example@node Cross Runtime@subsection @file{libgcc.a} and Cross-CompilersCode compiled by GNU CC uses certain runtime support functionsimplicitly.  Some of these functions can be compiled successfully withGNU CC itself, but a few cannot be.  These problem functions are in thesource file @file{libgcc1.c}; the library made from them is called@file{libgcc1.a}.When you build a native compiler, these functions are compiled with someother compiler--the one that you use for bootstrapping GNU CC.Presumably it knows how to open code these operations, or else knows howto call the run-time emulation facilities that the machine comes with.But this approach doesn't work for building a cross-compiler.  Thecompiler that you use for building knows about the host system, not thetarget system.So, when you build a 

⌨️ 快捷键说明

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