Why is there a /usr/lib
and a /usr/lib32
directory but only a /usr/bin
and no /usr/bin32
directory on a AMD64 64-bit-install of Ubuntu? If or when Debian/Ubuntu start supporting multi-target-architecture binaries in their ELF's will this directory branching become unnecessary?
-
Why does it matter ? If you need to link against a library, you need the corresponding arch, but if you call an external program, as long as it runs on your system, why would its architecture make a difference worth reflecting on the filesystem ? – b0fh Jul 03 '12 at 07:05
2 Answers
The idea is that you might want to install both 32-bit and 64-bit versions of the same library on your system, to accomodate binaries using either architecture, wherewas there is little point in having the same binary in two different architectures.
Some applications are very pointer-intensive, in which case running a 32-bit version for a small dataset could be more efficient as you'll save memory and reduce cache misses. That will only work up to 3GB of address space for i386 (or 2GB, depending on kernel compile time options).
If you run into a situation where a 32-bit binary makes more sense, you can recompile said binary yourself. However this is too much of a corner case for distributions to handle. If you feel this decision is wrong, you can always create a feature request.
Another sapproach is to install a 32-bit version of the whole distribution, and run it with a 64-bit kernel. This will work fine, each process will have access to 4GB of memory (instead of 3GB or less as mentioned earlier), the system can use more than 4GB of RAM, and the kernel doesn't need any of the tricks that 32-bit kernels use (eg PAE).
- 2,607
- 17
- 28
Debian already has multi-arch releases:
http://cdimage.debian.org/debian-cd/6.0.5/multi-arch/iso-cd/
You can install it and see how it's done.
- 6,193
- 23
- 28
-
Unfortunately, not exactly what OP is looking for. http://wiki.debian.org/Multiarch/ mentions that they only "co-installation of libraries and headers for different architectures, but not (yet) binaries". – Pierre Carrier Jul 05 '12 at 22:52