home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 7
/
FreshFishVol7.bin
/
bbs
/
gnu
/
gcc-2.3.3-src.lha
/
GNU
/
src
/
amiga
/
gcc-2.3.3
/
gcc.info-7
(
.txt
)
< prev
next >
Wrap
GNU Info File
|
1994-02-06
|
50KB
|
857 lines
This is Info file gcc.info, produced by Makeinfo-1.49 from the input
file gcc.texi.
This file documents the use and the internals of the GNU compiler.
Copyright (C) 1988, 1989, 1992 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.
Permission is granted to copy and distribute modified versions of
this manual under the conditions for verbatim copying, provided also
that the sections entitled "GNU General Public License" and "Protect
Your Freedom--Fight `Look And Feel'" are included exactly as in the
original, and provided that the entire resulting derived work is
distributed under the terms of a permission notice identical to this
Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that the sections entitled "GNU General Public
License" and "Protect Your Freedom--Fight `Look And Feel'", and this
permission notice, may be included in translations approved by the Free
Software Foundation instead of in the original English.
File: gcc.info, Node: Interoperation, Next: Incompatibilities, Prev: Cross-Compiler Problems, Up: Trouble
Interoperation
==============
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.
* GNU C normally compiles functions to return small structures and
unions in registers. Most other compilers arrange to return them
just like larger structures and unions. This can lead to trouble
when you link together code compiled by different compilers. To
avoid the problem, you can use the option `-fpcc-struct-return'
when compiling with GNU CC.
* GNU C++ does not do name mangling in the same way as other C++
compilers. This means that object files compiled with one compiler
cannot be used with another.
GNU C++ also uses different techniques for arranging virtual
function tables and the layout of class instances. In general,
therefore, linking code compiled with different C++ compilers does
not work.
* Older GDB versions sometimes fail to read the output of GNU CC
version 2. If you have trouble, get GDB version 4.4 or later.
* DBX rejects some files produced by GNU CC, though it accepts
similar constructs in output from PCC. Until someone can supply a
coherent description of what is valid DBX input and what is not,
there is nothing I can do about these problems. You are on your
own.
* The GNU assembler (GAS) does not support PIC. To generate PIC
code, you must use some other assembler, such as `/bin/as'.
* On some BSD systems including some versions of Ultrix, use of
profiling causes static variable destructors (currently used only
in C++) not to be run.
* Use of `-I/usr/include' may cause trouble.
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:
-I/usr/local/lib/gcc-lib/TARGET/VERSION/include -I/usr/include
* On a Sparc, GNU CC aligns all values of type `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]; };
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.
* On a Sun, linking using GNU CC fails to find a shared library and
reports that the library doesn't exist at all.
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.
* Sun forgot to include a static version of `libdl.a' with some
versions of SunOS (mainly 4.1). This results in undefined symbols
when linking static binaries (that is, if you use `-static'). If
you see undefined symbols `_dlclose', `_dlsym' or `_dlopen' when
linking, compile and link against the file `mit/util/misc/dlsym.c'
from the MIT version of X windows.
* On the HP PA machine, ADB sometimes fails to work on functions
compiled with GNU CC. Specifically, it fails to work on functions
that use `alloca' or variable-size arrays. This is because GNU CC
doesn't generate HP-UX unwind descriptors for such functions. It
may even be impossible to generate them.
* Debugging (`-g') is not supported on the HP PA machine, unless you
use the preliminary GNU tools (*note Installation::.).
* The HP-UX linker has a bug which can cause programs which make use
of `const' variables to fail in unusual ways. If your program
makes use of global `const' variables, we suggest you compile with
the following additional options:
-Dconst="" -D__const="" -D__const__="" -fwritable-strings
This will force the `const' variables into the DATA subspace which
will avoid the linker bug.
Another option one might use to work around this problem is
`-mkernel'. `-mkernel' changes how the address of variables is
computed to a sequence less likely to tickle the HP-UX linker bug.
We hope to work around this problem in GNU CC 2.4, if HP does not
fix it.
* Taking the address of a label may generate errors from the HP-UX
PA assembler. GAS for the PA does not have this problem.
* GNU CC produced code will not yet link against HP-UX 8.0 shared
libraries. We expect to fix this problem in GNU CC 2.4.
* The current version of the assembler (`/bin/as') for the RS/6000
has certain problems that prevent the `-g' option in GCC from
working.
IBM has produced a fixed version of the assembler. The replacement
assembler is not a standard component of either AIX 3.1.5 or AIX
3.2, but is expected to become standard in a future distribution.
This assembler is available from IBM as APAR IX22829. Yet more
bugs have been fixed in a newer assembler, which will shortly be
available as APAR IX26107. See the file `README.RS6000' for more
details on these assemblers.
* On the IBM RS/6000, compiling code of the form
extern int foo;
... foo ...
static int foo;
will cause the linker to report an undefined symbol `foo'.
Although this behavior differs from most other systems, it is not a