View Full Version : 32-bit linux source repository

March 13th, 2012, 02:52 AM
What repository do I need to retrieve 32 bit linux includes and libs? I want to compile my software code for 32 bit x86 architecture although I have 64-bit Ubuntu laptop.

March 13th, 2012, 05:56 AM
First, cross-compiling is not trivial, and you sould only do it if you can't do otherwise. In your case, you can very well make a 32-bit VirtualBox, and it will work very well.

If you really want to cross-compile, the first thing you will need is gcc-multilib, which contains 32-bit versions of all the compiling toolchain. Then there are libraries. There's a lot of them in tha package ia32-libs, and a few libraries have separate 32-bit package (look for packages beginning with lib32). In general, though, if your program uses a lot of third-party libraries, you will have to install some of them manually. It's not complicated, basically you download the 32-bit package for a library from http://packages.ubuntu.com, you extract it with dpkg -x, and you copy the library files into /usr/lib32. It's still a lot of hassle, though, so really, just make a 32-bit VBox. :)

March 14th, 2012, 09:23 AM
Ubuntu comes with multiarch enabled by default these days (since oneiric?) on amd64.
You should have something like

$ cat /etc/dpkg/dpkg.cfg.d/multiarch
foreign-architecture i386This means that i386 libs are available in synaptic or by appending :i386 on the command line. ie

$ sudo apt-get install libmath++-dev:i386Having said that I'd go with Bachstelze (http://ubuntuforums.org/member.php?u=51114) and use virtualisation instead. For one, multiarch libs won't always be installable, some will conflict and not install. You could have a chroot or a 32 bit toolchain but its just more work than is needed I'd say.
Simplest method, install virtualbox or virt-manager, virtualbox is probably the best desktop choice. Then install a i386 ubuntu and build in there. You get an easily maintained 32 bit system with one click :)

March 26th, 2012, 04:47 AM
Thank you. I will take your advice and the virtualbox route.