* Configurations:: Configurations Supported by GNU CC.
* Other Dir:: Compiling in a separate directory (not where the source is).
* Cross-Compiler:: Building and installing a cross-compiler.
-* Sun Install:: See below for installation on the Sun.
* VMS Install:: See below for installation on VMS.
* Collect2:: How @code{collect2} works; how it finds @code{ld}.
* Header Dirs:: Understanding the standard header file directories.
You can also replace parts of the configuration by nicknames or aliases.
For example, @samp{sun3} stands for @samp{m68k-sun}, so
-@samp{sun3-sunos4.1} is another way to specify a Sun 3. You can also
-use simply @samp{sun3-sunos}, since the version of SunOS is assumed by
-default to be version 4.
+@samp{sun3-sunos4.1} is another way to specify a Sun 3.
You can specify a version number after any of the system types, and some
of the CPU types. In most cases, the version is irrelevant, and will be
is usually due to bugs in @code{make}. You should either ignore this
problem, or use GNU Make.
-@cindex @code{alloca} and SunOS
-@strong{Warning: there is a bug in @code{alloca} in the Sun library. To
-avoid this bug, be sure to install the executables of GNU CC that were
-compiled by GNU CC. (That is, the executables from stage 2 or 3, not
-stage 1.) They use @code{alloca} as a built-in function and never the
-one 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 other
compiler.)
@itemx i386-sequent-ptx2*
You must install GNU @file{sed} before running @file{configure}.
-@item i386-sun-sunos4
-You may find that you need another version of GNU CC to begin
-bootstrapping with, since the current version when built with the
-system's own compiler seems to get an infinite loop compiling part of
-@file{libgcc2.c}. GNU CC version 2 compiled with GNU CC (any version)
-seems not to have this problem.
-
-See @ref{Sun Install}, for information on installing GNU CC on Sun
-systems.
-
-@item i860-intel-osf1
-This is the Paragon.
-@ifset INSTALLONLY
-If you have version 1.0 of the operating system, you need to take
-special steps to build GNU CC due to peculiarities of the system. Newer
-system versions have no problem. See the section `Installation Problems'
-in the GNU CC Manual.
-@end ifset
-@ifclear INSTALLONLY
-If you have version 1.0 of the operating system,
-see @ref{Installation Problems}, for special things you need to do to
-compensate for peculiarities in the system.
-@end ifclear
-
@item *-lynx-lynxos
LynxOS 2.2 and earlier comes with GNU CC 1.x already installed as
@file{/bin/gcc}. You should compile with this instead of @file{/bin/cc}.
default, because programs that establish signal handlers for floating
point traps inherently cannot work with the FPA.
-See @ref{Sun Install}, for information on installing GNU CC on Sun
-systems.
-
@item m6811-elf
Motorola 68HC11 family micro controllers. These are used in embedded
applications. There are no standard Unix configurations.
@item mips-mips-bsd
MIPS machines running the MIPS operating system in BSD mode. It's
possible that some old versions of the system lack the functions
-@code{memcpy}, @code{memcmp}, and @code{memset}. If your system lacks
-these, you must remove or undo the definition of
+@code{memcpy}, @code{memmove}, @code{memcmp}, and @code{memset}. If your
+system lacks these, you must remove or undo the definition of
@code{TARGET_MEM_FUNCTIONS} in @file{mips-bsd.h}.
The MIPS C compiler needs to be told to increase its table size
You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
-@item powerpcle-*-solaris2*
-PowerPC system in little endian mode, running Solaris 2.5.1 or higher.
-
-You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
-switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
-Beta versions of the Sun 4.0 compiler do not seem to be able to build
-GNU CC correctly. There are also problems with the host assembler and
-linker that are fixed by using the GNU versions of these tools.
-
@item powerpcle-*-eabisim
Embedded PowerPC system in little endian mode for use in running under
the PSIM simulator.
problem, compile just the GNU C compiler first, and use it to recompile
building all the languages that you want to run.
-@item sparc-sun-*
-See @ref{Sun Install}, for information on installing GNU CC on Sun
-systems.
-
@item vax-dec-vms
See @ref{VMS Install}, for details on how to install GNU CC on VMS.
* Tools and Libraries:: Where to put the linker and assembler, and the C library.
* Cross Headers:: Finding and installing header files
for a cross-compiler.
-* Cross Runtime:: Supplying arithmetic runtime routines (@file{libgcc1.a}).
* Build Cross:: Actually compiling the cross-compiler.
@end menu
quit
@end example
-@node Cross Runtime
-@subsection @file{libgcc.a} and Cross-Compilers
-
-Code compiled by GNU CC uses certain runtime support functions
-implicitly. Some of these functions can be compiled successfully with
-GNU CC itself, but a few cannot be. These problem functions are in the
-source file @file{libgcc1.c}; the library made from them is called
-@file{libgcc1.a}.
-
-When you build a native compiler, these functions are compiled with some
-other compiler--the one that you use for bootstrapping GNU CC.
-Presumably it knows how to open code these operations, or else knows how
-to call the run-time emulation facilities that the machine comes with.
-But this approach doesn't work for building a cross-compiler. The
-compiler that you use for building knows about the host system, not the
-target system.
-
-So, when you build a cross-compiler you have to supply a suitable
-library @file{libgcc1.a} that does the job it is expected to do.
-
-To compile @file{libgcc1.c} with the cross-compiler itself does not
-work. The functions in this file are supposed to implement arithmetic
-operations that GNU CC does not know how to open code for your target
-machine. If these functions are compiled with GNU CC itself, they
-will compile into infinite recursion.
-
-On any given target, most of these functions are not needed. If GNU CC
-can open code an arithmetic operation, it will not call these functions
-to perform the operation. It is possible that on your target machine,
-none of these functions is needed. If so, you can supply an empty
-library as @file{libgcc1.a}.
-
-Many targets need library support only for multiplication and division.
-If you are linking with a library that contains functions for
-multiplication and division, you can tell GNU CC to call them directly
-by defining the macros @code{MULSI3_LIBCALL}, and the like. These
-macros need to be defined in the target description macro file. For
-some targets, they are defined already. This may be sufficient to
-avoid the need for libgcc1.a; if so, you can supply an empty library.
-
-Some targets do not have floating point instructions; they need other
-functions in @file{libgcc1.a}, which do floating arithmetic.
-Recent versions of GNU CC have a file which emulates floating point.
-With a certain amount of work, you should be able to construct a
-floating point emulator that can be used as @file{libgcc1.a}. Perhaps
-future versions will contain code to do this automatically and
-conveniently. That depends on whether someone wants to implement it.
-
-Some embedded targets come with all the necessary @file{libgcc1.a}
-routines written in C or assembler. These targets build
-@file{libgcc1.a} automatically and you do not need to do anything
-special for them. Other embedded targets do not need any
-@file{libgcc1.a} routines since all the necessary operations are
-supported by the hardware.
-
-If your target system has another C compiler, you can configure GNU CC
-as a native compiler on that machine, build just @file{libgcc1.a} with
-@samp{make libgcc1.a} on that machine, and use the resulting file with
-the cross-compiler. To do this, execute the following on the target
-machine:
-
-@example
-cd @var{target-build-dir}
-./configure --host=sparc --target=sun3
-make libgcc1.a
-@end example
-
-@noindent
-And then this on the host machine:
-
-@example
-ftp @var{target-machine}
-binary
-cd @var{target-build-dir}
-get libgcc1.a
-quit
-@end example
-
-Another way to provide the functions you need in @file{libgcc1.a} is to
-define the appropriate @code{perform_@dots{}} macros for those
-functions. If these definitions do not use the C arithmetic operators
-that they are meant to implement, you should be able to compile them
-with the cross-compiler you are building. (If these definitions already
-exist for your target file, then you are all set.)
-
-To build @file{libgcc1.a} using the perform macros, use
-@samp{LIBGCC1=libgcc1.a OLDCC=./xgcc} when building the compiler.
-Otherwise, you should place your replacement library under the name
-@file{libgcc1.a} in the directory in which you will build the
-cross-compiler, before you run @code{make}.
-
@node Cross Headers
@subsection Cross-Compilers and Header Files
@subsection Actually Building the Cross-Compiler
Now you can proceed just as for compiling a single-machine compiler
-through the step of building stage 1. If you have not provided some
-sort of @file{libgcc1.a}, then compilation will give up at the point
-where it needs that file, printing a suitable error message. If you
-do provide @file{libgcc1.a}, then building the compiler will automatically
-compile and link a test program called @file{libgcc1-test}; if you get
-errors in the linking, it means that not all of the necessary routines
-in @file{libgcc1.a} are available.
-
-You must provide the header file @file{float.h}. One way to do this is
-to compile @file{enquire} and run it on your target machine. The job of
-@file{enquire} is to run on the target machine and figure out by
-experiment the nature of its floating point representation.
-@file{enquire} records its findings in the header file @file{float.h}.
-If you can't produce this file by running @file{enquire} on the target
-machine, then you will need to come up with a suitable @file{float.h} in
-some other way (or else, avoid using it in your programs).
+through the step of building stage 1.
+
+If your target is exotic, you may need to provide the header file
+@file{float.h}.One way to do this is to compile @file{enquire} and run
+it on your target machine. The job of @file{enquire} is to run on the
+target machine and figure out by experiment the nature of its floating
+point representation. @file{enquire} records its findings in the header
+file @file{float.h}. If you can't produce this file by running
+@file{enquire} on the target machine, then you will need to come up with
+a suitable @file{float.h} in some other way (or else, avoid using it in
+your programs).
Do not try to build stage 2 for a cross-compiler. It doesn't work to
rebuild GNU CC as a cross-compiler using the cross-compiler, because
To install the cross-compiler, use @samp{make install}, as usual.
-@node Sun Install
-@section Installing GNU CC on the Sun
-@cindex Sun installation
-@cindex installing GNU CC on the Sun
-
-On Solaris, do not use the linker or other tools in
-@file{/usr/ucb} to build GNU CC. Use @code{/usr/ccs/bin}.
-
-If the assembler reports @samp{Error: misaligned data} when bootstrapping,
-you are probably using an obsolete version of the GNU assembler. Upgrade
-to the latest version of GNU @code{binutils}, or use the Solaris assembler.
-
-Make sure the environment variable @code{FLOAT_OPTION} is not set when
-you compile @file{libgcc.a}. If this option were set to @code{f68881}
-when @file{libgcc.a} is compiled, the resulting code would demand to be
-linked with a special startup file and would not link properly without
-special pains.
-
-@cindex @code{alloca}, for SunOS
-There is a bug in @code{alloca} in certain versions of the Sun library.
-To avoid this bug, install the binaries of GNU CC that were compiled by
-GNU CC. They use @code{alloca} as a built-in function and never the one
-in the library.
-
-Some versions of the Sun compiler crash when compiling GNU CC. The
-problem is a segmentation fault in cpp. This problem seems to be due to
-the bulk of data in the environment variables. You may be able to avoid
-it by using the following command to compile GNU CC with Sun CC:
-
-@example
-make CC="TERMCAP=x OBJS=x LIBFUNCS=x STAGESTUFF=x cc"
-@end example
-
-SunOS 4.1.3 and 4.1.3_U1 have bugs that can cause intermittent core
-dumps when compiling GNU CC. A common symptom is an
-internal compiler error which does not recur if you run it again.
-To fix the problem, install Sun recommended patch 100726 (for SunOS 4.1.3)
-or 101508 (for SunOS 4.1.3_U1), or upgrade to a later SunOS release.
-
@node VMS Install
@section Installing GNU CC on VMS
@cindex VMS installation
@code{fixincludes} on the header files in @file{$(tooldir)/include}.
(If the cross compilation header files need to be fixed, they must be
installed before GNU CC is built. If the cross compilation header files
-are already suitable for ANSI C and GNU CC, nothing special need be
+are already suitable for ISO C and GNU CC, nothing special need be
done).
@code{GPLUSPLUS_INCLUDE_DIR} means the same thing for native and cross. It