When using gnat to make an ada application, sizeof(pointer) returns 64 bits when it should be 32.

Solution Unverified - Updated -

Issue

  • When using gnat to make an ada application, sizeof(pointer) returns 64 bits when it should be 32. In addition, this must be made manually by linking in the 32-bit libraries as the default goes directly to the 64-bit libs.
  • The 32bit -m32 should compile with gnatmake, the code complies and binds, but the link fails:
bash-4.1$ gnatmake -m32 sizes.adb 
gnatbind -x sizes.ali
gnatlink sizes.ali -m32
/usr/bin/ld: powerpc:common64 architecture of input file `/usr/lib/gcc/ppc64-redhat-linux/4.4.6/adalib/libgnat.a(a-filico.o)' is incompatible with powerpc:common output
<snipped out many more of the same error>
/usr/lib/gcc/ppc64-redhat-linux/4.4.6/adalib/libgnat.a(s-secsta.o):(.text+0x720): undefined reference to `__divti3'
collect2: ld returned 1 exit status
gnatlink: error when calling /usr/bin/gcc
gnatmake: *** link failed.

Environment

  • Red Hat Enterprise Linux
  • gcc-gnat-4.4.6.3
  • IBM Power 4

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.