gcc.texi
来自「GCC编译器源代码」· TEXI 代码 · 共 1,739 行 · 第 1/5 页
TEXI
1,739 行
The @code{fixincludes} script interacts badly with automounters; if thedirectory of system header files is automounted, it tends to beunmounted while @code{fixincludes} is running. This would seem to be abug in the automounter. We don't know any good way to work around it.@itemThe @code{fixproto} script will sometimes add prototypes for the@code{sigsetjmp} and @code{siglongjmp} functions that reference the@code{jmp_buf} type before that type is defined. To work around this,edit the offending file and place the typedef in front of theprototypes.@itemThere are several obscure case of mis-using struct, union, andenum tags that are not detected as errors by the compiler.@itemWhen @samp{-pedantic-errors} is specified, GNU C will incorrectly givean error message when a function name is specified in an expressioninvolving the comma operator.@itemLoop unrolling doesn't work properly for certain C++ programs. This isa bug in the C++ front end. It sometimes emits incorrect debug info, andthe loop unrolling code is unable to recover from this error.@end itemize@node Installation Problems@section Installation ProblemsThis is a list of problems (and some apparent problems which don'treally mean anything is wrong) that show up during installation of GNUCC.@itemize @bullet@itemOn certain systems, defining certain environment variables such as@code{CC} can interfere with the functioning of @code{make}.@itemIf you encounter seemingly strange errors when trying to build thecompiler in a directory other than the source directory, it could bebecause you have previously configured the compiler in the sourcedirectory. Make sure you have done all the necessary preparations.@xref{Other Dir}.@itemIf you build GNU CC on a BSD system using a directory stored in a SystemV file system, problems may occur in running @code{fixincludes} if theSystem V file system doesn't support symbolic links. These problemsresult in a failure to fix the declaration of @code{size_t} in@file{sys/types.h}. If you find that @code{size_t} is a signed type andthat type mismatches occur, this could be the cause.The solution is not to use such a directory for building GNU CC.@itemIn previous versions of GNU CC, the @code{gcc} driver program looked for@code{as} and @code{ld} in various places; for example, in filesbeginning with @file{/usr/local/lib/gcc-}. GNU CC version 2 looks forthem in the directory@file{/usr/local/lib/gcc-lib/@var{target}/@var{version}}.Thus, to use a version of @code{as} or @code{ld} that is not the systemdefault, for example @code{gas} or GNU @code{ld}, you must put them inthat directory (or make links to them from that directory).@itemSome commands executed when making the compiler may fail (return anon-zero status) and be ignored by @code{make}. These failures, whichare often due to files that were not found, are expected, and can safelybe ignored.@itemIt is normal to have warnings in compiling certain files aboutunreachable code and about enumeration type clashes. These files' namesbegin with @samp{insn-}. Also, @file{real.c} may get some warnings thatyou can ignore.@itemSometimes @code{make} recompiles parts of the compiler when installingthe compiler. In one case, this was traced down to a bug in@code{make}. Either ignore the problem or switch to GNU Make.@itemIf you have installed a program known as purify, you may find that itcauses errors while linking @code{enquire}, which is part of buildingGNU CC. The fix is to get rid of the file @code{real-ld} which purifyinstalls---so that GNU CC won't try to use it.@itemOn GNU/Linux SLS 1.01, there is a problem with @file{libc.a}: it does notcontain the obstack functions. However, GNU CC assumes that the obstackfunctions are in @file{libc.a} when it is the GNU C library. To workaround this problem, change the @code{__GNU_LIBRARY__} conditionalaround line 31 to @samp{#if 1}.@itemOn some 386 systems, building the compiler never finishes because@code{enquire} hangs due to a hardware problem in the motherboard---itreports floating point exceptions to the kernel incorrectly. You caninstall GNU CC except for @file{float.h} by patching out the command torun @code{enquire}. You may also be able to fix the problem for real bygetting a replacement motherboard. This problem was observed inRevision E of the Micronics motherboard, and is fixed in Revision F.It has also been observed in the MYLEX MXA-33 motherboard.If you encounter this problem, you may also want to consider removingthe FPU from the socket during the compilation. Alternatively, if youare running SCO Unix, you can reboot and force the FPU to be ignored.To do this, type @samp{hd(40)unix auto ignorefpu}.@itemOn some 386 systems, GNU CC crashes trying to compile @file{enquire.c}.This happens on machines that don't have a 387 FPU chip. On 386machines, the system kernel is supposed to emulate the 387 when youdon't have one. The crash is due to a bug in the emulator.One of these systems is the Unix from Interactive Systems: 386/ix.On this system, an alternate emulator is provided, and it does work.To use it, execute this command as super-user:@exampleln /etc/emulator.rel1 /etc/emulator@end example@noindentand then reboot the system. (The default emulator file remains presentunder the name @file{emulator.dflt}.)Try using @file{/etc/emulator.att}, if you have such a problem on theSCO system.Another system which has this problem is Esix. We don't know whether ithas an alternate emulator that works.On NetBSD 0.8, a similar problem manifests itself as these error messages:@exampleenquire.c: In function `fprop':enquire.c:2328: floating overflow@end example@itemOn SCO systems, when compiling GNU CC with the system's compiler,do not use @samp{-O}. Some versions of the system's compiler miscompileGNU CC with @samp{-O}.@cindex @code{genflags}, crash on Sun 4@itemSometimes on a Sun 4 you may observe a crash in the program@code{genflags} or @code{genoutput} while building GNU CC. This is said tobe due to a bug in @code{sh}. You can probably get around it by running@code{genflags} or @code{genoutput} manually and then retrying the@code{make}.@itemOn Solaris 2, executables of GNU CC version 2.0.2 are commonlyavailable, but they have a bug that shows up when compiling currentversions of GNU CC: undefined symbol errors occur during assembly if youuse @samp{-g}.The solution is to compile the current version of GNU CC without@samp{-g}. That makes a working compiler which you can use to recompilewith @samp{-g}.@itemSolaris 2 comes with a number of optional OS packages. Some of thesepackages are needed to use GNU CC fully. If you did not install alloptional packages when installing Solaris, you will need to verify thatthe packages that GNU CC needs are installed.To check whether an optional package is installed, usethe @code{pkginfo} command. To add an optional package, use the@code{pkgadd} command. For further details, see the Solarisdocumentation.For Solaris 2.0 and 2.1, GNU CC needs six packages: @samp{SUNWarc},@samp{SUNWbtool}, @samp{SUNWesu}, @samp{SUNWhea}, @samp{SUNWlibm}, and@samp{SUNWtoo}.For Solaris 2.2, GNU CC needs an additional seventh package: @samp{SUNWsprot}.@itemOn Solaris 2, trying to use the linker and other tools in@file{/usr/ucb} to install GNU CC has been observed to cause trouble.For example, the linker may hang indefinitely. The fix is to remove@file{/usr/ucb} from your @code{PATH}.@itemIf you use the 1.31 version of the MIPS assembler (such as was shippedwith Ultrix 3.1), you will need to use the -fno-delayed-branch switchwhen optimizing floating point code. Otherwise, the assembler willcomplain when the GCC compiler fills a branch delay slot with afloating point instruction, such as @code{add.d}.@itemIf on a MIPS system you get an error message saying ``does not have gpsections for all it's [sic] sectons [sic]'', don't worry about it. Thishappens whenever you use GAS with the MIPS linker, but there is notreally anything wrong, and it is okay to use the output file. You canstop such warnings by installing the GNU linker.It would be nice to extend GAS to produce the gp tables, but they areoptional, and there should not be a warning about their absence.@itemIn Ultrix 4.0 on the MIPS machine, @file{stdio.h} does not work with GNUCC at all unless it has been fixed with @code{fixincludes}. This causesproblems in building GNU CC. Once GNU CC is installed, the problems goaway.To work around this problem, when making the stage 1 compiler, specifythis option to Make:@exampleGCC_FOR_TARGET="./xgcc -B./ -I./include"@end exampleWhen making stage 2 and stage 3, specify this option:@exampleCFLAGS="-g -I./include"@end example@itemUsers have reported some problems with version 2.0 of the MIPScompiler tools that were shipped with Ultrix 4.1. Version 2.10which came with Ultrix 4.2 seems to work fine.Users have also reported some problems with version 2.20 of theMIPS compiler tools that were shipped with RISC/os 4.x. The earlierversion 2.11 seems to work fine.@itemSome versions of the MIPS linker will issue an assertion failurewhen linking code that uses @code{alloca} against sharedlibraries on RISC-OS 5.0, and DEC's OSF/1 systems. This is a bugin the linker, that is supposed to be fixed in future revisions.To protect against this, GNU CC passes @samp{-non_shared} to thelinker unless you pass an explicit @samp{-shared} or@samp{-call_shared} switch.@itemOn System V release 3, you may get this error messagewhile linking:@smallexampleld fatal: failed to write symbol name @var{something} in strings table for file @var{whatever}@end smallexampleThis probably indicates that the disk is full or your ULIMIT won't allowthe file to be as large as it needs to be.This problem can also result because the kernel parameter @code{MAXUMEM}is too small. If so, you must regenerate the kernel and make the valuemuch larger. The default value is reported to be 1024; a value of 32768is said to work. Smaller values may also work.@itemOn System V, if you get an error like this,@example/usr/local/lib/bison.simple: In function `yyparse':/usr/local/lib/bison.simple:625: virtual memory exhausted@end example@noindentthat too indicates a problem with disk space, ULIMIT, or @code{MAXUMEM}.@itemCurrent GNU CC versions probably do not work on version 2 of the NeXToperating system.@itemOn NeXTStep 3.0, the Objective C compiler does not work, due,apparently, to a kernel bug that it happens to trigger. This problemdoes not happen on 3.1.@itemOn the Tower models 4@var{n}0 and 6@var{n}0, by default a process is notallowed to have more than one megabyte of memory. GNU CC cannot compileitself (or many other programs) with @samp{-O} in that much memory.To solve this problem, reconfigure the kernel adding the following lineto the configuration file:@smallexampleMAXUMEM = 4096@end smallexample@itemOn HP 9000 series 300 or 400 running HP-UX release 8.0, there is a bugin the assembler that must be fixed before GNU CC can be built. Thisbug manifests itself during the first stage of compilation, whilebuilding @file{libgcc2.a}:@smallexample_floatdisfcc1: warning: `-g' option not supported on this version of GCCcc1: warning: `-g1' option not supported on this version of GCC./xgcc: Internal compiler error: program as got fatal signal 11@end smallexampleA patched version of the assembler is available by anonymous ftp from@code{altdorf.ai.mit.edu} as the file@file{archive/cph/hpux-8.0-assembler}. If you have HP software support,the patch can also be obtained directly from HP, as described in thefollowing note:@quotationThis is the patched assembler, to patch SR#1653-010439, where theassembler aborts on floating point constants.The bug is not really in the assembler, but in the shared libraryversion of the function ``cvtnum(3c)''. The bug on ``cvtnum(3c)'' isSR#4701-078451. Anyway, the attached assembler uses the archivelibrary version of ``cvtnum(3c)'' and thus does not exhibit the bug.@end quotationThis patch is also known as PHCO_4484.@itemOn HP-UX version 8.05, but not on 8.07 or more recent versions,the @code{fixproto} shell script triggers a bug in the system shell.If you encounter this problem, upgrade your operating system oruse BASH (the GNU shell) to run @code{fixproto}.@itemSome versions of the Pyramid C compiler are reported to be unable tocompile GNU CC. You must use an older version of GNU CC forbootstrapping. One indication of this problem is if you get a crashwhen GNU CC compiles the function @code{muldi3} in file @file{libgcc2.c}.You may be able to succeed by getting GNU CC version 1, installing it,and using it to compile GNU CC version 2. The bug in the Pyramid Ccompiler does not seem to affect GNU CC version 1.@itemThere may be similar problems on System V Release 3.1 on 386 systems.@itemOn the Intel Paragon (an i860 machine), if you are using operatingsystem version 1.0, you will get warnings or errors about redefinitionof @code{va_arg} when you build GNU CC.If this happens, then you need to link most programs with the library
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?