# 32-bit package guidelines

From ArchWiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Legacy 32-bit software can be built and installed on machines of another native architecture, such as x86_64. This article explains the production and conventions of such packages.

## Package naming

- Prefix 32-bit versions of native packages with lib32-.

- Suffix packages that utilize the x32 ABI with -x32.

- Package decriptions should distinguish these from native counterparts, ie `pkgdesc+=" (32-bit)"`.

## Variables and parameters

### lib32

Specify these bash variables in a PKGBUILD to tell the compiler to output 32-bit code:

    export CFLAGS+=" -m32"
    export CXXFLAGS+=" -m32"
    export LDFLAGS+=" -m32"
    export PKG_CONFIG_PATH='/usr/lib32/pkgconfig'

#### File placement

Ensure lib32 package files do not conflict with native package files and include all necessary files, such as architecture-specific includes. For example, if a package builds using GNU Autoconf, specify the following to `configure`:

    --program-suffix="-32" \
    --lib{exec,}dir=/usr/lib32 \
    --includedir=/usr/include/"$pkgbase"32 \
    --build=i686-pc-linux-gnu

### x32

This article or section needs expansion.

Reason: Add any information on how x32 packages could be built here. (Discuss in Talk:32-bit package guidelines#-x32?)
Category:

- Arch package guidelines

Hidden category:

- Pages or sections flagged with Template:Expansion