Building in a 32-bit clean chroot

From ArchWiki
Revision as of 17:20, 25 March 2019 by Svito (talk | contribs) (flag archive: 32-bit packages not supported outside multilib)
Jump to navigation Jump to search

Gnome-colors-add-files-to-archive.pngThis article is being considered for archiving.Gnome-colors-add-files-to-archive.png

Reason: native 32-bit packages no longer supported outside multilib (Discuss in Talk:Building in a 32-bit clean chroot#)

Native 32-bit packages can be built in a clean chroot.

Setting up a chroot

First, create a directory in which the chroot will reside. For example, $HOME/chroot32.

$ mkdir ~/chroot32

Copy /etc/makepkg.conf into this directory and set 32-bit options in it:

CFLAGS="-march=i686 -mtune=generic -O2 -pipe"
CXXFLAGS="-march=i686 -mtune=generic -O2 -pipe"
Note: Comment out any [multilib] repositories in /etc/pacman.conf!

Then create the chroot:

$ mkarchroot -M ~/chroot32/makepkg.conf ~/chroot32/root base-devel

See DeveloperWiki:Building in a clean chroot#Setting up a chroot for more details.

Building in the chroot

Note: Make sure your PKGBUILD specifies arch=('i686').

Specify this chroot to makechrootpkg to build i686 packages:

$ makechrootpkg -c -r ~/chroot32/

See DeveloperWiki:Building in a clean chroot#Building in the chroot for more details.