Multilib

from Wikipedia, the free encyclopedia

Multilib , short for multiple libraries , or multilib environment describes a special configuration of an operating system with the help of which programs for mostly two closely related computer architectures can be executed on one computer without the use of special software such as a virtual machine . A basic requirement for this is that the hardware is compatible with both instruction set architectures . The best known example of this compatibility is the x64 microarchitecture (AMD64, x86-64), which is backwards compatible with the 32-bit x86 architecture IA-32 . This in turn is backwards compatible with the 16-bit x86 architecture (x86).

The term is often used in connection with Linux and open source .

A multilib environment is usually more resource-efficient than a virtual machine. Because the virtual machine can be implemented entirely in software, it offers the option of displaying computer architectures on a computer that are incompatible with the existing hardware.

use

Linux

On Linux distributions intended for use on an x64 architecture, multilib is a possible avenue for binary compatibility. In order to be able to use both 64-bit and 32-bit programs that are intended for an IA-32 architecture, in addition to the 64-bit program libraries for the 64-bit programs, 32-bit libraries required for 32-bit programs. When setting up the multilib environment and installing the 32-bit programs, it must be ensured that no 64-bit components are overwritten when they are installed, which is regulated in the File System Hierarchy Standard (FHS for short). Then 32-bit libraries end up in /lib32and /usr/lib32, 64-bit libraries in /lib64and /usr/lib64. However, this is optional so the native libraries may be stored in /liband /usr/lib.

However, since some already existing 32-bit programs on the x86 architecture expect the program libraries in /liband /usr/lib, some Linux distributions either set a symbolic link from /lib32or to /usr/lib32it, or use the same /liband /usr/libfor the 32-bit libraries (and /lib64as well as /usr/lib64for the native x64 libraries).

Android

On Android , Multilib is also used to provide apps that work equally on 32-bit and 64-bit.

Toolchain

For developers, Multilib means the use of a corresponding toolchain that uses a compiler that supports Multilib. Prominent examples are GCC or LLVM .

Demarcation

In the case of the toolchain, Multilib is based on existing Multiarch concepts, but, in contrast, requires the same instruction set architecture ( English Instruction Set Architecture , or ISA for short). The result is binary code that can only run on one architecture. The operating system then provides the correct program libraries for the executable file to work.

Multiarch, on the other hand, means that a program is compiled for a different instruction set architecture ( cross-compiler ). However, Multilib was initially called MultiArch, for example under Ubuntu .

An executable file (a program) that can run on more than one instruction set architecture because the binary file itself contains the relevant, already compiled code for it, is called Fat Binary or, in macOS from Apple , Universal Binary .

See also

  • WOW64 , a comparable technology under Windows

Web links

Individual evidence

  1. Tammy Fox: Red Hat Enterprise Linux Administration Unleashed . Pearson Education, 2007, ISBN 978-0-13-271539-3 (English, multilib in the Google Book Search): “To run both 32-bit and 64-bit applications, both sets of libraries must be installed. Having both the 64-bit and 32-bit versions of a library installed at the same time is known as multilib . "
  2. LSB Workgroup: Filesystem Hierarchy Standard, Version 3.0. The Linux Foundation, 2015, accessed on February 9, 2020 (English): “3.10. /lib<qual>: Alternate format essential shared libraries (optional) ... There may be one or more variants of the /libdirectory on systems which support more than one binary format requiring separate libraries. "
  3. Project: layout AMD64 / multilib. In: Gentoo Wiki. Retrieved on February 9, 2020 (English): “Why lib and not lib32? - Using lib is beneficial to compatibility with prebuilt x86 software, eg old games. All that software is naturally built to use lib as libdir, and using the same directory on multilib amd64 systems improves compatibility and reduces the need for custom hacks to keep things working. "
  4. Understanding 64-bit builds. In: Android Open Source Project. Retrieved February 9, 2020 .
  5. toolchain. In: Ubuntu Wiki. Retrieved February 9, 2020 .
  6. Multiarch Library PathOverview. In: Debian Wiki. Retrieved February 9, 2020 : "The multilib mechanism provides a way to support multiple incompatible ABI versions on the same ISA."
  7. MultiArch. In: Ubuntu Community Help Wiki. Retrieved February 9, 2020 .