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

📄 install.texi

📁 早期freebsd实现
💻 TEXI
📖 第 1 页 / 共 4 页
字号:
If linking @file{cc1} fails, try putting the object files into a libraryand linking from that library.@node VMS Install@section Installing GNU CC on VMS@cindex VMS installation@cindex installing GNU CC on VMSThe VMS version of GNU CC is distributed in a backup saveset containingboth source code and precompiled binaries.To install the @file{gcc} command so you can use the compiler easily, inthe same manner as you use the VMS C compiler, you must install the VMS CLDfile for GNU CC as follows:@enumerate@itemDefine the VMS logical names @samp{GNU_CC} and @samp{GNU_CC_INCLUDE}to point to the directories where the GNU CC executables(@file{gcc-cpp.exe}, @file{gcc-cc1.exe}, etc.) and the C include files arekept respectively.  This should be done with the commands:@refill@smallexample$ assign /system /translation=concealed -  disk:[gcc.] gnu_cc$ assign /system /translation=concealed -  disk:[gcc.include.] gnu_cc_include@end smallexample@noindentwith the appropriate disk and directory names.  These commands can beplaced in your system startup file so they will be executed wheneverthe machine is rebooted.  You may, if you choose, do this via the@file{GCC_INSTALL.COM} script in the @file{[GCC]} directory.@itemInstall the @file{GCC} command with the command line:@smallexample$ set command /table=sys$common:[syslib]dcltables -  /output=sys$common:[syslib]dcltables gnu_cc:[000000]gcc$ install replace sys$common:[syslib]dcltables@end smallexample@itemTo install the help file, do the following:@smallexample$ library/help sys$library:helplib.hlb gcc.hlp@end smallexample@noindentNow you can invoke the compiler with a command like @samp{gcc /verbosefile.c}, which is equivalent to the command @samp{gcc -v -c file.c} inUnix.@end enumerateIf you wish to use GNU C++ you must first install GNU CC, and thenperform the following steps:@enumerate@itemDefine the VMS logical name @samp{GNU_GXX_INCLUDE} to point to thedirectory where the preprocessor will search for the C++ header files.This can be done with the command:@refill@smallexample$ assign /system /translation=concealed -  disk:[gcc.gxx_include.] gnu_gxx_include@end smallexample@noindentwith the appropriate disk and directory name.  If you are going to beusing libg++, this is where the libg++ install procedure will installthe libg++ header files.@itemObtain the file @file{gcc-cc1plus.exe}, and place this in the samedirectory that @file{gcc-cc1.exe} is kept.The GNU C++ compiler can be invoked with a command like @samp{gcc /plus/verbose file.cc}, which is equivalent to the command @samp{g++ -v -cfile.cc} in Unix.@end enumerateWe try to put corresponding binaries and sources on the VMS distributiontape.  But sometimes the binaries will be from an older version than thesources, because we don't always have time to update them.  (Use the@samp{/version} option to determine the version number of the binaries andcompare it with the source file @file{version.c} to tell whether this isso.)  In this case, you should use the binaries you get to recompile thesources.  If you must recompile, here is how:@enumerate@itemExecute the command procedure @file{vmsconfig.com} to copy files@file{vax-vms.h}, @file{xm-vax-vms.h}, @file{vax.c} and @file{vax.md} to@file{tm.h}, @file{config.h}, @file{aux-output.c}, and @file{md.}respectively, and to create files @file{tconfig.h} and@file{hconfig.h}.  This procedure also creates several linker optionfiles used by @file{make-cc1.com} and a data file used by@file{make-l2.com}.@refill@smallexample$ @@vmsconfig.com@end smallexample@itemSetup the logical names and command tables as defined above.  Inaddition, define the VMS logical name @samp{GNU_BISON} to point at theto the directories where the Bison executable is kept.  This should bedone with the command:@refill@smallexample$ assign /system /translation=concealed -  disk:[bison.] gnu_bison@end smallexampleYou may, if you choose, use the @file{INSTALL_BISON.COM} script in the@file{[BISON]} directory.@itemInstall the @samp{BISON} command with the command line:@refill@smallexample$ set command /table=sys$common:[syslib]dcltables -  /output=sys$common:[syslib]dcltables -  gnu_bison:[000000]bison$ install replace sys$common:[syslib]dcltables@end smallexample@itemType @samp{@@make-gcc} to recompile everything (alternatively, you maysubmit the file @file{make-gcc.com} to a batch queue).  If you wish tobuild the GNU C++ compiler as well as the GNU CC compiler, you mustfirst edit @file{make-gcc.com} and follow the instructions that appearin the comments.@refill@itemIn order to use GCC, you need a library of functions which GCC compiled codewill call to perform certain tasks, and these functions are defined in thefile @file{libgcc2.c}.  To compile this you should use the command procedure@file{make-l2.com}, which will generate the library @file{libgcc2.olb}.@file{libgcc2.olb} should be built using the compiler built fromthe same distribution that @file{libgcc2.c} came from, and@file{make-gcc.com} will automatically do all of this for you.To install the library, use the following commands:@refill@smallexample$ library gnu_cc:[000000]gcclib/delete=(new,eprintf)$ library libgcc2/extract=*/output=libgcc2.obj$ library gnu_cc:[000000]gcclib libgcc2.obj@end smallexampleThe first command simply removes old modules that will be replaced with modulesfrom libgcc2.  If the VMS librarian complains about those modules not beingpresent, simply ignore the message and continue on with the next command.Whenever you update the compiler on your system, you should also update thelibrary with the above procedure.@itemYou may wish to build GCC in such a way that no files are written to thedirectory where the source files reside.  An example would be the whenthe source files are on a read-only disk.  In these cases, execute thefollowing DCL commands (substituting your actual path names):@smallexample$ assign dua0:[gcc.build_dir.]/translation=concealed, -         dua1:[gcc.source_dir.]/translation=concealed  gcc_build$ set default gcc_build:[000000]@end smallexamplewhere @file{dua1:[gcc.source_dir]}contains the source code, and@file{dua0:[gcc.build_dir]} is meant to contain all of the generated objectfiles and executables.  Once you have done this, you can proceed building GCCas described above.  (Keep in mind that @file{gcc_build} is a rooted logicalname, and thus the device names in each element of the search list must be anactual physical device name rather than another rooted logical name).@item@strong{If you are building GNU CC with a previous version of GNU CC,you also should check to see that you have the newest version of theassembler}.  In particular, GNU CC version 2 treats global constantvariables slightly differently from GNU CC version 1, and GAS version1.38.1 does not have the patches required to work with GCC version 2.If you use GAS 1.38.1, then @code{extern const} variables will not havethe read-only bit set, and the linker will generate warning messagesabout mismatched psect attributes for these variables.  These warningmessages are merely a nuisance, and can safely be ignored.If you are compiling with a version of GNU CC older than 1.33, specify@samp{/DEFINE=("inline=")} as an option in all the compilations.  Thisrequires editing all the @code{gcc} commands in @file{make-cc1.com}.(The older versions had problems supporting @code{inline}.)  Once youhave a working 1.33 or newer GNU CC, you can change this file back.@itemIf you want to build GNU CC with the VAX C compiler, you will need tomake minor changes in @file{make-cccp.com} and @file{make-cc1.com}to choose alternate definitions of @code{CC}, @code{CFLAGS}, and@code{LIBS}.  See comments in those files.  However, you mustalso have a working version of the GNU assembler (GNU as, aka GAS) asit is used as the back-end for GNU CC to produce binary object modulesand is not included in the GNU CC sources.  GAS is also needed tocompile @file{libgcc2} in order to build @file{gcclib} (see above);@file{make-l2.com} expects to be able to find it operational in@file{gnu_cc:[000000]gnu-as.exe}.To use GNU CC on VMS, you need the VMS driver programs@file{gcc.exe}, @file{gcc.com}, and @file{gcc.cld}.  They aredistributed with the VMS binaries (@file{gcc-vms}) rather than theGNU CC sources.  GAS is also included in @file{gcc-vms}, as is Bison.Once you have successfully built GNU CC with VAX C, you should use theresulting compiler to rebuild itself.  Before doing this, be sure torestore the @code{CC}, @code{CFLAGS}, and @code{LIBS} definitions in@file{make-cccp.com} and @file{make-cc1.com}.  The second generationcompiler will be able to take advantage of many optimizations that mustbe suppressed when building with other compilers.@end enumerateUnder previous versions of GNU CC, the generated code would occasionallygive strange results when linked with the sharable @file{VAXCRTL} library.Now this should work.Even with this version, however, GNU CC itself should not be linked withthe sharable @file{VAXCRTL}.  The version of @code{qsort} in@file{VAXCRTL} has a bug (known to be present in VMS versions V4.6through V5.5) which causes the compiler to fail.The executables that are generated by @file{make-cc1.com} and@file{make-cccp.com} use the object library version of @file{VAXCRTL} inorder to make use of the @code{qsort} routine in @file{gcclib.olb}.  Ifyou wish to link the compiler executables with the shareable imageversion of @file{VAXCRTL}, you should edit the file @file{tm.h} (createdby @file{vmsconfig.com}) to define the macro @code{QSORT_WORKAROUND}.@code{QSORT_WORKAROUND} is always defined when GNU CC is compiled withVAX C, to avoid a problem in case @file{gcclib.olb} is not yetavailable.@node WE32K Install@section Installing GNU CC on the WE32KThese computers are also known as the 3b2, 3b5, 3b20 and other similarnames.  (However, the 3b1 is actually a 68000; see @ref{3b1 Install}.)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 $*" > /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.@node MIPS Install@section Installing GNU CC on the MIPSSee @ref{Installation} about whether to use @samp{--with-stabs} ornot.The MIPS C compiler needs to be told to increase its table sizefor switch statements with the @samp{-Wf,-XNg1500} option inorder to compile @file{cp-parse.c}.  If you use the @samp{-O2}optimization option, you also need to use @samp{-Olimit 3000}.Both of these options are automatically generated in the@file{Makefile} that the shell script @file{configure} builds.If you override the @code{CC} make variable and use the MIPScompilers, you may need to add @samp{-Wf,-XNg1500 -Olimit 3000}.MIPS computers running RISC-OS can support four differentpersonalities: default, BSD 4.3, System V.3, and System V.4(older versions of RISC-OS don't support V.4).  To configure GCCfor these platforms use the following configurations:@table @samp@item mips-mips-riscos@code{rev}Default configuration for RISC-OS, revision @code{rev}.@item mips-mips-riscos@code{rev}bsdBSD 4.3 configuration for RISC-OS, revision @code{rev}.@item mips-mips-riscos@code{rev}sysv4System V.4 configuration for RISC-OS, revision @code{rev}.@item mips-mips-riscos@code{rev}sysvSystem V.3 configuration for RISC-OS, revision @code{rev}.@end tableThe revision @code{rev} mentioned above is the revision ofRISC-OS to use.  You must reconfigure GCC when going from aRISC-OS revision 4 to RISC-OS revision 5.  This has the effect ofavoiding a linker@ifclear INSTALLONLYbug (see @ref{Installation Problems} for more details).@end ifclear@ifset INSTALLONLYbug.@end ifsetDECstations can support three different personalities: Ultrix,DEC OSF/1, and OSF/rose.  To configure GCC for these platformsuse the following configurations:@table @samp@item decstation-ultrixUltrix configuration.@item decstation-osf1Dec's version of OSF/1.@item decstation-osfroseOpen Software Foundation reference port of OSF/1 which uses theOSF/rose object file format instead of ECOFF.  Normally, youwould not select this configuration.@end table

⌨️ 快捷键说明

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