Node:ABI and ISA, Next:Notes for Package Builds, Previous:Build Options, Up:Installing GMP
ABI (Application Binary Interface) refers to the calling conventions between functions, meaning what registers are used and what sizes the various C data types are. ISA (Instruction Set Architecture) refers to the instructions and registers a CPU has available.
Some 64-bit ISA CPUs have both a 64-bit ABI and a 32-bit ABI defined, the
latter for compatibility with older CPUs in the family. GMP supports some
CPUs like this in both ABIs. In fact within GMP ABI
means a
combination of chip ABI, plus how GMP chooses to use it. For example in some
32-bit ABIs, GMP may support a limb as either a 32-bit long
or a 64-bit
long long
.
By default GMP chooses the best ABI available for a given system, and this
generally gives significantly greater speed. But an ABI can be chosen
explicitly to make GMP compatible with other libraries, or particular
application requirements. For example,
./configure ABI=32
In all cases it's vital that all object code used in a given program is compiled for the same ABI.
Usually a limb is implemented as a long
. When a long long
limb
is used this is encoded in the generated gmp.h
. This is convenient for
applications, but it does mean that gmp.h
will vary, and can't be just
copied around. gmp.h
remains compiler independent though, since all
compilers for a particular ABI will be expected to use the same limb type.
Currently no attempt is made to follow whatever conventions a system has for
installing library or header files built for a particular ABI. This will
probably only matter when installing multiple builds of GMP, and it might be
as simple as configuring with a special libdir
, or it might require
more than that. Note that builds for different ABIs need to done separately,
with a fresh ./configure
and make
each.
hppa2.0*
)
ABI=2.0w
cc
. gcc
support for this is in progress.
Applications must be compiled with
cc +DD64
ABI=2.0n
long long
. This is available on HP-UX 10 or up when using
cc
. No gcc
support is planned for this. Applications
must be compiled with
cc +DA2.0 +e
ABI=1.0
All three ABIs are available for CPUs hppa2.0w
and hppa2.0
, but
for CPU hppa2.0n
only 2.0n or 1.0 are allowed.
mips*-*-irix[6789]
)
gcc
is required (2.95 for instance).
ABI=n32
long long
. Applications must be compiled with
gcc -mabi=n32 cc -n32
ABI=64
gcc -mabi=64 cc -64
Note that MIPS GNU/Linux, as of kernel version 2.2, doesn't have the necessary
support for n32 or 64 and so only gets a 32-bit limb and the MIPS 2 code.
powerpc64*
)
ABI=aix64
powerpc64*-*-aix*
. Applications must be compiled (and linked) with
gcc -maix64 xlc -q64
ABI=32L
long long
in
64-bit registers. Applications must be compiled with
gcc -mpowerpc64
ABI=32
sparcv9
and ultrasparc*
)
ABI=64
cc
is required. Applications must be compiled with
gcc -m64 -mptr64 -Wa,-xarch=v9 -mcpu=v9 cc -xarch=v9
ABI=32
gcc -mv8plus cc -xarch=v8plus
gcc
2.8 and earlier only supports -mv8
though.
Don't be confused by the names of these sparc -m
and -x
options,
they're called arch
but they effectively control the ABI.
On Solaris 2.7 with the kernel in 32-bit-mode, a normal native build will
reject ABI=64
because the resulting executables won't run.
ABI=64
can still be built if desired by making it look like a
cross-compile, for example
./configure --build=none --host=sparcv9-sun-solaris2.7 ABI=64