Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1 | .. SPDX-License-Identifier: CC-BY-SA-2.0-UK |
| 2 | |
| 3 | Using x32 psABI |
| 4 | *************** |
| 5 | |
| 6 | x32 processor-specific Application Binary Interface (`x32 |
| 7 | psABI <https://software.intel.com/en-us/node/628948>`__) is a native |
| 8 | 32-bit processor-specific ABI for Intel 64 (x86-64) architectures. An |
| 9 | ABI defines the calling conventions between functions in a processing |
| 10 | environment. The interface determines what registers are used and what |
| 11 | the sizes are for various C data types. |
| 12 | |
| 13 | Some processing environments prefer using 32-bit applications even when |
| 14 | running on Intel 64-bit platforms. Consider the i386 psABI, which is a |
| 15 | very old 32-bit ABI for Intel 64-bit platforms. The i386 psABI does not |
| 16 | provide efficient use and access of the Intel 64-bit processor |
| 17 | resources, leaving the system underutilized. Now consider the x86_64 |
| 18 | psABI. This ABI is newer and uses 64-bits for data sizes and program |
| 19 | pointers. The extra bits increase the footprint size of the programs, |
| 20 | libraries, and also increases the memory and file system size |
| 21 | requirements. Executing under the x32 psABI enables user programs to |
| 22 | utilize CPU and system resources more efficiently while keeping the |
| 23 | memory footprint of the applications low. Extra bits are used for |
| 24 | registers but not for addressing mechanisms. |
| 25 | |
| 26 | The Yocto Project supports the final specifications of x32 psABI as |
| 27 | follows: |
| 28 | |
| 29 | - You can create packages and images in x32 psABI format on x86_64 |
| 30 | architecture targets. |
| 31 | |
| 32 | - You can successfully build recipes with the x32 toolchain. |
| 33 | |
| 34 | - You can create and boot ``core-image-minimal`` and |
| 35 | ``core-image-sato`` images. |
| 36 | |
| 37 | - There is RPM Package Manager (RPM) support for x32 binaries. |
| 38 | |
| 39 | - There is support for large images. |
| 40 | |
| 41 | To use the x32 psABI, you need to edit your ``conf/local.conf`` |
| 42 | configuration file as follows:: |
| 43 | |
| 44 | MACHINE = "qemux86-64" |
| 45 | DEFAULTTUNE = "x86-64-x32" |
| 46 | baselib = "${@d.getVar('BASE_LIB:tune-' + (d.getVar('DEFAULTTUNE') \ |
| 47 | or 'INVALID')) or 'lib'}" |
| 48 | |
| 49 | Once you have set |
| 50 | up your configuration file, use BitBake to build an image that supports |
| 51 | the x32 psABI. Here is an example:: |
| 52 | |
| 53 | $ bitbake core-image-sato |
| 54 | |