32-bit OSs on 64-bit processors (x86_64)

18 views
Skip to first unread message

leif

unread,
Oct 2, 2011, 8:12:45 PM10/2/11
to mpir-devel
gcc -v
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i686-redhat-linux/4.5.1/lto-
wrapper
Target: i686-redhat-linux
...

If one happens to have '-m32' in CFLAGS (and ABI *not* set) on such a
system, MPIR fails to build, because of:

checking build system type... core2-pc-linux-gnu
checking host system type... core2-pc-linux-gnu
...
checking ABI=64
checking compiler gcc -m32 -O2 -fomit-frame-pointer -mtune=core2 -
march=core2 ... yes
[This is actually MPIR fed with its "own" CFLAGS.]
...
checking C++ compiler g++ -m32 -O2 -fomit-frame-pointer -mtune=core2 -
march=core2 ... yes
...

using ABI="64"
CC="gcc -std=gnu99"
CFLAGS="-m32 -O2 -fomit-frame-pointer -mtune=core2 -march=core2
"
CPPFLAGS=""
CXX="g++"
CXXFLAGS="-m32 -O2 -fomit-frame-pointer -mtune=core2 -
march=core2 "
MPN_PATH=" x86_64/core2 x86_64 generic"

(The latter should be MPN_PATH=" x86/core2 x86 generic", otherwise the
assembler a while later of course complains about the use of %r...
registers.)


Is this a known issue?

It's a minor one of course, but -- at least for gcc -- one could
append '-m64' to the compiler flags in the ABI=64 check such that the
generated test program will fail on 32-bit systems.


Cheers,

-leif

leif

unread,
Oct 10, 2011, 9:31:29 AM10/10/11
to mpir-devel
On 3 Okt., 02:12, leif <not.rea...@online.de> wrote:
> It's a minor one of course, but -- at least for gcc -- one could
> append '-m64' to the compiler flags in the ABI=64 check such that the
> generated test program will fail on 32-bit systems.

Just for the record:

GCC on ia64 (Itanium) doesn't support '-m64', although it defaults to
64-bit builds / ABI=64, or more precisely doesn't support anything
else on most operating systems, including Linux.


-leif

Jason

unread,
Dec 3, 2011, 5:37:35 PM12/3/11
to mpir-...@googlegroups.com, leif

This is the way MPIR/GMP was ment to work , if you set CFLAGS or most other options then you have to be prepared to set a lot of the other options manually ,
ABI=32 or 64 or whatever is the proper way to set the ABI , the configure mechanism is too complicated already , for it to know all the flags and compiler options
which might change the ABI
I'm thinking of changing the way the default ABI is chosen , because currently the best is chosen which is not what other package choose , they choose the default OS
ABI , leading to mismatches in builds

Jason

Reply all
Reply to author
Forward
0 new messages