Go to the previous, next section.
This section describes known problems that affect users of GNU CC. Most of these are not GNU CC bugs per se--if they were, we would fix them. But the result for a user may be like the result of a bug.
Some of these problems are due to bugs in other software, some are missing features that are too much work to add, and some are places where people's opinions differ as to what is best.
fixincludes
script interacts badly with automounters; if the
directory of system header files is automounted, it tends to be
unmounted while fixincludes
is running. This would seem to be a
bug in the automounter. We don't know any good way to work around it.
fixproto
script will sometimes add prototypes for the
sigsetjmp
and siglongjmp
functions that reference the
jmp_buf
type before that type is defined. To work around this,
edit the offending file and place the typedef in front of the
prototypes.
This is a list of problems (and some apparent problems which don't really mean anything is wrong) that show up during installation of GNU CC.
CC
can interfere with the functioning of make
.
fixincludes
if the
System V file system doesn't support symbolic links. These problems
result in a failure to fix the declaration of size_t
in
`sys/types.h'. If you find that size_t
is a signed type and
that type mismatches occur, this could be the cause.
The solution is not to use such a directory for building GNU CC.
gcc
driver program looked for
as
and ld
in various places; for example, in files
beginning with `/usr/local/lib/gcc-'. GNU CC version 2 looks for
them in the directory
`/usr/local/lib/gcc-lib/target/version'.
Thus, to use a version of as
or ld
that is not the system
default, for example gas
or GNU ld
, you must put them in
that directory (or make links to them from that directory).
make
. These failures, which
are often due to files that were not found, are expected, and can safely
be ignored.
make
recompiles parts of the compiler when installing
the compiler. In one case, this was traced down to a bug in
make
. Either ignore the problem or switch to GNU Make.
enquire
, which is part of building
GNU CC. The fix is to get rid of the file real-ld
which purify
installs--so that GNU CC won't try to use it.
__GNU_LIBRARY__
conditional
around line 31 to `#if 1'.
enquire
hangs due to a hardware problem in the motherboard--it
reports floating point exceptions to the kernel incorrectly. You can
install GNU CC except for `float.h' by patching out the command to
run enquire
. You may also be able to fix the problem for real by
getting a replacement motherboard. This problem was observed in
Revision 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 removing the FPU from the socket during the compilation. Alternatively, if you are running SCO Unix, you can reboot and force the FPU to be ignored. To do this, type `hd(40)unix auto ignorefpu'.
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:
ln /etc/emulator.rel1 /etc/emulator
and then reboot the system. (The default emulator file remains present under the name `emulator.dflt'.)
Try using `/etc/emulator.att', if you have such a problem on the SCO system.
Another system which has this problem is Esix. We don't know whether it has an alternate emulator that works.
On NetBSD 0.8, a similar problem manifests itself as these error messages:
enquire.c: In function `fprop': enquire.c:2328: floating overflow
genflags
or genoutput
while building GNU CC. This is said to
be due to a bug in sh
. You can probably get around it by running
genflags
or genoutput
manually and then retrying the
make
.
The solution is to compile the current version of GNU CC without `-g'. That makes a working compiler which you can use to recompile with `-g'.
To check whether an optional package is installed, use
the pkginfo
command. To add an optional package, use the
pkgadd
command. For further details, see the Solaris
documentation.
For Solaris 2.0 and 2.1, GNU CC needs six packages: `SUNWarc', `SUNWbtool', `SUNWesu', `SUNWhea', `SUNWlibm', and `SUNWtoo'.
For Solaris 2.2, GNU CC needs an additional seventh package: `SUNWsprot'.
PATH
.
add.d
.
It would be nice to extend GAS to produce the gp tables, but they are optional, and there should not be a warning about their absence.
fixincludes
. This causes
problems in building GNU CC. Once GNU CC is installed, the problems go
away.
To work around this problem, when making the stage 1 compiler, specify this option to Make:
GCC_FOR_TARGET="./xgcc -B./ -I./include"
When making stage 2 and stage 3, specify this option:
CFLAGS="-g -I./include"
alloca
against shared
libraries on RISC-OS 5.0, and DEC's OSF/1 systems. This is a bug
in the linker, that is supposed to be fixed in future revisions.
To protect against this, GNU CC passes `-non_shared' to the
linker unless you pass an explicit `-shared' or
`-call_shared' switch.
ld fatal: failed to write symbol name something in strings table for file whatever
This probably indicates that the disk is full or your ULIMIT won't allow the file to be as large as it needs to be.
This problem can also result because the kernel parameter MAXUMEM
is too small. If so, you must regenerate the kernel and make the value
much larger. The default value is reported to be 1024; a value of 32768
is said to work. Smaller values may also work.
/usr/local/lib/bison.simple: In function `yyparse': /usr/local/lib/bison.simple:625: virtual memory exhausted
that too indicates a problem with disk space, ULIMIT, or MAXUMEM
.
To solve this problem, reconfigure the kernel adding the following line to the configuration file:
MAXUMEM = 4096
_floatdisf cc1: warning: `-g' option not supported on this version of GCC cc1: warning: `-g1' option not supported on this version of GCC ./xgcc: Internal compiler error: program as got fatal signal 11
A patched version of the assembler is available by anonymous ftp from
altdorf.ai.mit.edu
as the 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 the
following note:
This is the patched assembler, to patch SR#1653-010439, where the assembler aborts on floating point constants.The bug is not really in the assembler, but in the shared library version of the function "cvtnum(3c)". The bug on "cvtnum(3c)" is SR#4701-078451. Anyway, the attached assembler uses the archive library version of "cvtnum(3c)" and thus does not exhibit the bug.
This patch is also known as PHCO_0800.
fixproto
shell script triggers a bug in the system shell.
If you encounter this problem, upgrade your operating system or
use BASH (the GNU shell) to run fixproto
.
muldi3
in 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 C compiler does not seem to affect GNU CC version 1.
va_arg
when you build GNU CC.
If this happens, then you need to link most programs with the library `iclib.a'. You must also modify `stdio.h' as follows: before the lines
#if defined(__i860__) && !defined(_VA_LIST) #include <va_list.h>
insert the line
#if __PGC__
and after the lines
extern int vprintf(const char *, va_list ); extern int vsprintf(char *, const char *, va_list ); #endif
insert the line
#endif /* __PGC__ */
These problems don't exist in operating system version 1.1.
You may run into problems with cross compilation on certain machines, for several reasons.
The compiler writes these integer constants by examining the floating point value as an integer and printing that integer, because this is simple to write and independent of the details of the floating point representation. But this does not work if the compiler is running on a different machine with an incompatible floating point format, or even a different byte-ordering.
In addition, correct constant folding of floating point values requires representing them in the target machine's format. (The C standard does not quite require this, but in practice it is the only way to win.)
It is now possible to overcome these problems by defining macros such
as REAL_VALUE_TYPE
. But doing so is a substantial amount of
work for each target machine.
See section Cross Compilation and Floating Point.
This section lists various difficulties encountered in using GNU C or GNU C++ together with other compilers or with the assemblers, linkers, libraries and debuggers on certain systems.
This effect is intentional, to protect you from more subtle problems. Compilers differ as to many internal details of C++ implementation, including: how class instances are laid out, how multiple inheritance is implemented, and how virtual function calls are handled. If the name encoding were made the same, your programs would link against libraries provided from other compilers--but the programs would then crash when run. Incompatible libraries are then detected at link time, rather than at run time.
Many systems come with header files that won't work with GNU CC unless
corrected by fixincludes
. The corrected header files go in a new
directory; GNU CC searches this directory before `/usr/include'.
If you use `-I/usr/include', this tells GNU CC to search
`/usr/include' earlier on, before the corrected headers. The
result is that you get the uncorrected header files.
Instead, you should use these options (when compiling C programs):
-I/usr/local/lib/gcc-lib/target/version/include -I/usr/include
For C++ programs, GNU CC also uses a special directory that defines C++ interfaces to standard C subroutines. This directory is meant to be searched before other standard include directories, so that it takes precedence. If you are compiling C++ programs and specifying include directories explicitly, use this option first, then the two options above:
-I/usr/local/lib/g++-include
double
on an 8-byte
boundary, and it expects every double
to be so aligned. The Sun
compiler usually gives double
values 8-byte alignment, with one
exception: function arguments of type double
may not be aligned.
As a result, if a function compiled with Sun CC takes the address of an
argument of type double
and passes this pointer of type
double *
to a function compiled with GNU CC, dereferencing the
pointer may cause a fatal signal.
One way to solve this problem is to compile your entire program with GNU
CC. Another solution is to modify the function that is compiled with
Sun CC to copy the argument into a local variable; local variables
are always properly aligned. A third solution is to modify the function
that uses the pointer to dereference it via the following function
access_double
instead of directly with `*':
inline double access_double (double *unaligned_ptr) { union d2i { double d; int i[2]; 2; union d2i *p = (union d2i *) unaligned_ptr; union d2i u; u.i[0] = p->i[0]; u.i[1] = p->i[1]; return u.d; }
Storing into the pointer can be done likewise with the same union.
malloc
function in the `libmalloc.a' library
may allocate memory that is only 4 byte aligned. Since GNU CC on the
Sparc assumes that doubles are 8 byte aligned, this may result in a
fatal signal if doubles are stored in memory allocated by the
`libmalloc.a' library.
The solution is to not use the `libmalloc.a' library. Use instead
malloc
and related functions from `libc.a'; they do not have
this problem.
This happens if you are using the GNU linker, because it does only static linking and looks only for unshared libraries. If you have a shared library with no unshared counterpart, the GNU linker won't find anything.
We hope to make a linker which supports Sun shared libraries, but please don't ask when it will be finished--we don't know.
_dlclose
, _dlsym
or _dlopen
when linking, compile and link against the file
`mit/util/misc/dlsym.c' from the MIT version of X windows.
A future implementation of the sparc long double support will use functions