Skip to main content

Running a binary built with -O4 or higher on a machine other than the build machine may lead to an illegal instruction


Technote (troubleshooting)


Problem(Abstract)

Attempts to run a binary built with -O4 (or higher) using XL C/C++ compiler may fail with an illegal instruction at run time on a machine other than the build machine.

Cause

The compiler automatically uses the -qarch=auto suboption when you compile at -O4 or -O5, and it assumes that your compilation machine and your target execution machine are the same.

Resolving the problem

If you compile on a POWER5-based system and specify -O4, the default setting for -qarch is set to PWR5.

If the compilation machine is newer than the target machine, the generated binary may contain instruction sets that are not present on the target machine, which will result in an illegal instruction at run time.

You can override this behavior by specifying the -qarch option after the -O4 or -O5 compiler option.


Cross reference information
Segment Product Component Platform Version Edition
Software Development XL C for AIX Compiler AIX All Versions Not Applicable
Software Development XL Fortran for AIX Compiler AIX All Versions Not Applicable

Rate this page:

(0 users)Average rating

Copyright and trademark information

IBM, the IBM logo and ibm.com are trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at www.ibm.com/legal/copytrade.shtml.

Rate this page:


(0 users)Average rating

Add comments

Document information

XL C/C++ for AIX

Compiler


Software version:
9.0, 10.1, 11.1


Operating system(s):
AIX


Reference #:
1590589


Modified date:
2012-12-18

Translate my page

Content navigation