How to build 32-bit builds on 64-bit Ubuntu

Magnus Ihse Bursie magnus.ihse.bursie at oracle.com
Mon Oct 29 08:59:42 PDT 2012


I was asked to document how to build 32-bit builds on 64-bit Ubuntu.

You need to install three packages:
sudo apt-get install libc6-dev-i386 lib32stdc++6 ia32-libs

However, these are broken, and do not place proper symlinks. (This is a 
bug that should probably be reported upstream to Ubuntu, if anyone 
bothers...). Therefore, you also need to do:
sudo ln -s /usr/lib32/libstdc++.so.6 /usr/lib32/libstdc++.so
sudo ln -s /usr/lib32/libasound.so.2 /usr/lib32/libasound.so

Then you can do "sh configure --with-target-bits=32" and be happy! :-)

One important note, however. There is no Ubuntu package (as far as I 
could find) containing a static (.a) version of libstdc++, so this will 
create a configuration with dynamic linking. For community builds, this 
is fine (probably more than fine -- the expected behavior), but it's not 
good for official Oracle builds. We'll have to find another solution 
internally.

/Magnus



More information about the build-infra-dev mailing list