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

📄 install.texi

📁 早期freebsd实现
💻 TEXI
📖 第 1 页 / 共 4 页
字号:
Motorola m88k running DG/UX.  To build native or cross compilers onDG/UX, you must first change to the 88open BCS software developmentenvironment.  This is done by issuing this command:@exampleeval `sde-target m88kbcs`@end example@item mips-mips-bsdMIPS machines running the MIPS operating system in BSD mode.  It'spossible that some old versions of the system lack the functions@code{memcpy}, @code{memcmp}, and @code{memset}.  If your system lacksthese, you must remove or undo the definition of@code{TARGET_MEM_FUNCTIONS} in @file{mips-bsd.h}.@item mips-sony-sysvSony MIPS NEWS.  This works in NEWSOS 5.0.1, but not in 5.0.2 (whichuses ELF instead of COFF).  Support for 5.0.2 will probably be providedsoon by volunteers.@item ns32k-encoreEncore ns32000 system.  Encore systems are supported only under BSD.@item ns32k-*-genixNational Semiconductor ns32000 system.  Genix has bugs in @code{alloca}and @code{malloc}; you must get the compiled versions of these from GNUEmacs.@item ns32k-sequentGo to the Berkeley universe before compiling.  In addition, you probablyneed to create a file named @file{string.h} containing just one line:@samp{#include <strings.h>}.@item ns32k-utekUTEK ns32000 system (``merlin'').  The C compiler that comes with thissystem cannot compile GNU CC; contact @samp{tektronix!reed!mason} to getbinaries of GNU CC for bootstrapping.@item romp-*-aos@itemx romp-*-machThe only operating systems supported for the IBM RT PC are AOS andMACH.  GNU CC does not support AIX running on the RT.  We recommend youcompile GNU CC with an earlier version of itself; if you compile GNU CCwith @code{hc}, the Metaware compiler, it will work, but you will getmismatches between the stage 2 and stage 3 compilers in various files.These errors are minor differences in some floating-point constants andcan be safely ignored; the stage 3 compiler is correct.@item rs6000-*-aix@strong{Read the file @file{README.RS6000} for information on how to geta fix for a problem in the IBM assembler that prevents use of GNU CC.}You must either obtain the new assembler or avoid using the @samp{-g}switch.  Note that @file{Makefile.in} uses @samp{-g} by default whencompiling @file{libgcc2.c}.@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.@end tableHere we spell out what files will be set up by @code{configure}.  Normallyyou need not be concerned with these files.@itemize @bullet@item@ifset INTERNALSA symbolic link named @file{config.h} is made to the top-level configfile for the machine you will run the compiler on (@pxref{Config}).This file is responsible for defining information about the hostmachine.  It includes @file{tm.h}.@end ifset@ifclear INTERNALSA symbolic link named @file{config.h} is made to the top-level configfile for the machine you plan to run the compiler on (@pxref{Config,,TheConfiguration File, gcc.info, Using and Porting GCC}).  This file isresponsible for defining information about the host machine.  Itincludes @file{tm.h}.@end ifclearThe top-level config file is located in the subdirectory @file{config}.Its name is always @file{xm-@var{something}.h}; usually@file{xm-@var{machine}.h}, but there are some exceptions.If your system does not support symbolic links, you might want toset up @file{config.h} to contain a @samp{#include} command whichrefers to the appropriate file.@itemA symbolic link named @file{tconfig.h} is made to the top-level configfile for your target machine.  This is used for compiling certainprograms to run on that machine.@itemA symbolic link named @file{tm.h} is made to the machine-descriptionmacro file for your target machine.  It should be in the subdirectory@file{config} and its name is often @file{@var{machine}.h}.@itemA symbolic link named @file{md} will be made to the machine descriptionpattern file.  It should be in the @file{config} subdirectory and itsname should be @file{@var{machine}.md}; but @var{machine} is often notthe same as the name used in the @file{tm.h} file because the@file{md} files are more general.@itemA symbolic link named @file{aux-output.c} will be made to the outputsubroutine file for your machine.  It should be in the @file{config}subdirectory and its name should be @file{@var{machine}.c}.@itemThe command file @file{configure} also constructs @file{Makefile} byadding some text to the template file @file{Makefile.in}.  Theadditional text comes from files in the @file{config} directory, named@file{t-@var{target}} and @file{h-@var{host}}.  If these files do notexist, it means nothing needs to be added for a given target or host.@end itemize@cindex Bison parser generator@cindex parser generator, Bison@itemMake sure the Bison parser generator is installed.  (This isunnecessary if the Bison output files @file{c-parse.c} and@file{cexp.c} are more recent than @file{c-parse.y} and @file{cexp.y}and you do not plan to change the @samp{.y} files.)Bison versions older than Sept 8, 1988 will produce incorrect outputfor @file{c-parse.c}.@itemBuild the compiler.  Just type @samp{make LANGUAGES=c} in the compilerdirectory.@samp{LANGUAGES=c} specifies that only the C compiler should becompiled.  The makefile normally builds compilers for all the supportedlanguages; currently, C, C++ and Objective C.  However, C is the onlylanguage that is sure to work when you build with other non-GNU Ccompilers.  In addition, building anything but C at this stage is awaste of time.In general, you can specify the languages to build by typing theargument @samp{LANGUAGES="@var{list}"}, where @var{list} is one or morewords from the list @samp{c}, @samp{c++}, and @samp{objective-c}.Ignore any warnings you may see about ``statement not reached'' in@file{insn-emit.c}; they are normal.  Any other compilation errors mayrepresent bugs in the port to your machine or operating system, and@ifclear INSTALLONLYshould be investigated and reported (@pxref{Bugs}).@end ifclear@ifset INSTALLONLYshould be investigated and reported.@end ifsetSome commercial compilers fail to compile GNU CC because they have bugsor limitations.  For example, the Microsoft compiler is said to run outof macro space.  Some Ultrix compilers run out of expression space; thenyou need to break up the statement where the problem happens.If you are building with a previous GNU C compiler, do notuse @samp{CC=gcc} on the make command or by editing the Makefile.Instead, use a full pathname to specify the compiler, such as@samp{CC=/usr/local/bin/gcc}.  This is because make might executethe @file{gcc} in the current directory before all of thecompiler components have been built.@itemIf you are using COFF-encapsulation, you must convert @file{libgcc.a} toa GNU-format library at this point.  See the file @file{README.ENCAP}in the directory containing the GNU binary file utilities, fordirections.@itemIf you are building a cross-compiler, stop here.  @xref{Cross-Compiler}.@cindex stage1@itemMove the first-stage object files and executables into a subdirectorywith this command:@examplemake stage1@end exampleThe files are moved into a subdirectory named @file{stage1}.Once installation is complete, you may wish to delete these fileswith @code{rm -r stage1}.@itemRecompile the compiler with itself, with this command:@examplemake CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O"@end exampleThis 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:@examplemake CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O -msoft-float"@end example@itemIf you wish to test the compiler by compiling it with itself one moretime, do this:@examplemake stage2make CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O" @end example@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.Then compare the latest object files with the stage 2 objectfiles---they ought to be identical, unless they contain time stamps.You can compare the files, disregarding the time stamps if any, likethis:@examplemake compare@end exampleThis 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):@examplefor file in *.o; docmp $file stage2/$filedone@end exampleIf 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 support.You can use the following command:@examplemake install CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O" LANGUAGES="@var{list}"@end example@noindent(Use the same value for @code{CC}, @code{CFLAGS} and @code{LANGUAGES}that you used when compiling the files that are being installed.  Onereason this is necessary is that some versions of Make have bugs andrecompile files gratuitously when you do this step.  If you use the samevariable values, those files will be recompiled properly.This copies the files @file{cc1}, @file{cpp} and @file{libgcc.a} to files@file{cc1}, @file{cpp} and @file{libgcc.a} in directory@file{/usr/local/lib/gcc-lib/@var{target}/@var{version}}, which is where thecompiler driver program looks for them.  Here @var{target} is the targetmachine type specified when you ran @file{configure}, and @var{version}is the version number of GNU CC.  This naming scheme permits variousversions and/or cross-compilers to coexist.It also copies the driver program @file{gcc} into the directory@file{/usr/local/bin}, so that it appears in typical execution searchpaths.@refillOn some systems, this command will cause recompilation of some files.This is usually due to bugs in @code{make}.  You should either ignorethis problem, 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.)@itemInstall the Objective C library (if you have built the Objective Ccompiler).  Here is the command to do this:@examplemake install-libobjc CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O"@end example@itemCorrect errors in the header files on your machine.Various system header files often contain constructs which areerroneous, incompatible with ANSI C or otherwise unsuitable, and theywill not work when you compile programs with GNU CC.The most common erroneous construct is found in @file{ioctl.h}, where amacro expects argument values to be substituted for argument namesinside of character constants---something not done in ANSI C.  Thisparticular problem can be prevented by using @samp{-traditional}.  Otherproblems are not so easy to work around.GNU CC comes with shell scripts to fix known header file problems.  Theyinstall corrected copies of various header files in a special directorywhere only GNU CC will normally look for them.  The scripts adapt tovarious systems by searching all the system header files for the problemcases that we know about.Use the following command to do this:

⌨️ 快捷键说明

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