IA64 & HAVE_ABI_64 question

Torbjorn Granlund tg at gmplib.org
Thu May 6 19:53:29 CEST 2010


Steve Ellcey <sje at cup.hp.com> writes:

  I am looking at a bug involving building GCC in 64 bit mode on HP-UX Itanium.
  The compiler is dying in the GMP library and it looks like it is dying in
  the GMP __gmpn_copyi routine.  I looked at mpn/ia64/copyi.asm and at the
  beginning of this code is some ifdefe'd code under an HAVE_ABI_32 bit
  ifdef.  This code is needed when compiling GMP in 32 bit mode on HP-UX but
  should not be used when compiling in 64 bit mode on HP-UX.

Correct.

  But when I use gdb to disassemble __gmpn_copyi I see the ifdef'ed code
  (the addp4's).  So I think the bug is that I am compiling GMP in 64
  bit mode but HAVE_ABI_32 is defined.
  
This sound like one of two things:

(1) You forgotten to distclean between builds
(2) A problem with configure with unknown root cause

  My problem is that I cannot find in the GMP sources or in my make output
  or in any generated header file where HAVE_ABI_32 (or any other HAVE_ABI
  value) is being set.  I see where ABI is set by configure:
  
  obj/config.log:ABI=64
  
  but I don't see where this is used to define HAVE_ABI_64.  And, of course,
  since I am defining ABI to be 64 why does HAVE_ABI_32 appear to to getting
  set during the build?
  
This is not how it is meant to work.  Only under "configure ABI=32" is
HAVE_ABI_32 supposed to be defined.

  Following up on my own email, I have discovered that if I configure and build
  with CC='gcc -mlp64', I get the right behaviour (ABI set to 64) and 
  if I build with CC='cc +DD64', I get the wrong behaviour (ABI set to 32).

Curious.

  checking ABI=32
  checking compiler /usr/bin/cc +DD64  ... yes
  checking compiler /usr/bin/cc +DD64   has long long... yes
  checking compiler /usr/bin/cc +DD64   +O3... yes
  (lines deleted)

I suspect you have something in your environment causing this behaviour.
The relevant parts of configure look alright to me.  But both the
"/usr/bin/cc" part and "+DD64" part looks fishy, and do not appear in
configure.in where ABI=32 should be able to find it.

Perhaps configure should be more resilient against environment/argument
clashes, and I am indeed a bit surprised that it doesn't fail later.
Alas, I cannot test this since I have no HP-UX access.

-- 
Torbjörn


More information about the gmp-discuss mailing list