24.05.2014 Views

AIX Version 4.3 Differences Guide

AIX Version 4.3 Differences Guide

AIX Version 4.3 Differences Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

UNIX98 interface will add very little extra work. This does not mean that they<br />

have to change everything to UNIX98 conformance, just sbrk() in this case.<br />

The sbrk() function prototype in was changed to pass a long for all<br />

64-bit compilations; that is, if __64BIT__ is set. For 32-bit compilations, the sbrk()<br />

prototype will be conditionally compiled to generate the appropriate UNIX95 or<br />

UNIX98 prototype since the data-width between int and long does not change for<br />

32-bit. Code that wants to run 64-bit must either make sure it passes a long, or if<br />

it obeys UNIX98, it is required to include . The standards require<br />

header file inclusion. The prototype for sbrk(), which defines it as taking a long, is<br />

as follows:<br />

void *<br />

sbrk(intptr_t increment)<br />

intptr_t is a new type. Defined in , it maps to a long.<br />

3.3 Application Development<br />

Section 3.2, “64-Bit Core Design” on page 33, explained the design issues of <strong>AIX</strong><br />

<strong>4.3</strong> with respect to 64-bit application support. The changes in the core design of<br />

<strong>AIX</strong> have impacts on various components of the software development<br />

environment. This section describes what decisions have been made to provide a<br />

migration path from 32-bit to 64-bit applications. It shows the modifications that<br />

have been made to the most important tools in the software development area,<br />

such as the compiler, linker, and archiver.<br />

3.3.1 C Compiler<br />

This section discusses the implementation of 64-bit capabilities in the C for <strong>AIX</strong><br />

compiler. The C compiler provides supporting functions that can enable the<br />

usability of 64-bit C syntax and semantics.<br />

Each program compiled for execution on <strong>AIX</strong> is intended for execution in one<br />

particular target execution mode: 32-bit mode or 64-bit mode. The default<br />

compilation and assembly mode is 32-bit. This is the ILP32 model. The change<br />

from the default 32-bit to 64-bit mode is under user control. In the compiler, the<br />

option -q64 is used to change the compilation mode.<br />

The default execution mode is not directly controllable by the user processes but<br />

can be examined indirectly (for code dynamically targeted to multiple<br />

environments) through the pointer or long type size. The compiler provides<br />

porting assistance options wherever there are statements that can be<br />

ambiguously interpreted for the LP64 environment.<br />

When running 32-bit processes on 64-bit platforms, the execution is transparent<br />

and identical to executing on a 32-bit platform with no loss of performance. When<br />

trying to run 64-bit processes on 32-bit platforms, the execution will fail in an<br />

obvious manner.<br />

The 64-bit implementation in the C front end does not change the default<br />

behavior of the compiler. The compiler only changes the behavior of code when<br />

compiled in 64-bit mode. Code that was compiled in 32-bit mode that has no<br />

requirements for large address spaces (pointers) or large object sizes (arrays and<br />

dynamic heaps) will not need to be recompiled to work in 32-bit mode on a 64-bit<br />

56 <strong>AIX</strong> <strong>Version</strong> <strong>4.3</strong> <strong>Differences</strong> <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!