gcc-multilib is useful for cross-compiling, that is, compiling a program to run on a different processor architecture. For example, you would need gcc-multilib if you are running on 64-bit Ubuntu and want to compile a program to run on 32-bit Ubuntu (or on ARM etc. you get the idea).

Answer from AlexP on askubuntu.com
🌐
GNU
gcc.gnu.org › install › configure.html
Installing GCC: Configuration - GNU Project
January 10, 2026 - Specify a file containing a list of multilib directories to build. Each line in the file should contain a single multilib directory name, as printed by gcc --print-multi-lib. Only the listed directories will be built and installed. This option is useful for reducing build time and binary size ...
🌐
Stack Overflow
stackoverflow.com › questions › 23042854 › how-to-build-a-gcc-multilib-tool-chain
x86 64 - How to build a gcc multilib tool chain? - Stack Overflow
You probably need libc6-dev-i386 and Trusty does indeed have a multilib gcc: launchpad.net/ubuntu/trusty/+package/gcc-multilib ... Yeah I know, I just wanted to build a multilib toolchain myself.
Discussions

Multilib and Multiarch - Unix & Linux Stack Exchange
Multilib required to pass -m32, ... must use cross-compilation. Right ? ... Yes, that’s what I wrote, pretty much ;-). Note that you can build either way, and then run either way — a binary built with multilib can be run in a multiarch setup, and vice-versa. ... One more query :) Do I have to compile GCC, GLIBC and ... More on unix.stackexchange.com
🌐 unix.stackexchange.com
linux - Enabling gcc-multilib manually after successful gcc installation on Debian system? - Stack Overflow
Find centralized, trusted content ... you use most. Learn more about Collectives ... Bring the best of human thought and AI automation together at your work. Explore Stack Internal ... I installed gcc-4.7.2 on my i686 Debian system successfully but i don't know how to enable gcc-multilib after ... More on stackoverflow.com
🌐 stackoverflow.com
macos - What does gcc without multilib mean? - Stack Overflow
I was trying to use the omh.h header file and I realized it was missing. I tried reinstalling gcc on my mac using brew. This is the message I got at the end of the installation. .. GCC has been built with multilib support. More on stackoverflow.com
🌐 stackoverflow.com
c++ - Building GCC as an ARM cross compiler with multilib support - Stack Overflow
Find centralized, trusted content ... you use most. Learn more about Collectives ... Bring the best of human thought and AI automation together at your work. Explore Stack Internal ... I want to build GCC from source as a cross compiler for ARM bare-metal targets. Specifically, I need support for the architectures armv4t and armv5te with softfp for both of them since they lack a proper FPU. ... --with-cpu=arm946e-s --with-mode=arm --with-float=soft --enable-interwork --enable-multilib ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
Airs
airs.com › ian › configure › configure_8.html
The GNU configure and build system - Multilibs - AIRS
This default is set in the top level `configure.in' file, by adding `--enable-multilib' to the list of arguments passed to configure when it is run for the target libraries (see section Host and Target Libraries). Each target library uses the shell script `config-ml.in', written by Doug Evans, to prepare to build target libraries.
Top answer
1 of 2
31

gcc-multilib is useful for cross-compiling, that is, compiling a program to run on a different processor architecture. For example, you would need gcc-multilib if you are running on 64-bit Ubuntu and want to compile a program to run on 32-bit Ubuntu (or on ARM etc. you get the idea).

2 of 2
9

Is this actually Apple's "fat binaries" or "universal binaries" model ported to Linux?

No.

Multilib is a mechanism to support building and running code for different ABIs for the same CPU family on a given system. Most commonly it was/is used to support 32-bit code on 64-bit systems and 64-bit code on 32-bit systems with a 64-bit kernel. It was also used at one stage to provide support for soft-float arm binaries on hard-float arm systems.

It has been around for a long time. Since at least Debian lenny, but it never had specific support in the packaging tools making library support awkward. Also on arm upstream treats the 64-bit and 32-bit architectures as completely separate architectures rather than variants of the same architecture, so you can't use multilib there.

In terms of running code on Debian and Ubuntu systems, multilib has been mostly replaced by multiarch, which is a more general mechanism allowing installation of packages from potentially any combination of architectures on the same system (though actually running those binaries may require installing emulation layers).

In terms of building code Debian/Ubuntu now offer proper cross-compiler packages, which are more flexible than multilib in that they in principle allow you to build for anything on anything (though in practice Debian doesn't offer the full set of combinations).

So I think multilib is mostly legacy at this time, it sticks around though because important packages still nedd it to build.

🌐
Linux From Scratch
linuxfromscratch.org › ~thomas › multilib › chapter08 › gcc.html
8.31. GCC-15.2.0
Prepare GCC for compilation: mlist=m64,m32,mx32 ../configure --prefix=/usr \ LD=ld \ --enable-languages=c,c++ \ --enable-default-pie \ --enable-default-ssp \ --enable-host-pie \ --enable-multilib \ --with-multilib-list=$mlist \ --disable-bootstrap \ --disable-fixincludes \ --with-system-zlib · We only enable C and C++ here to save the build time as no packages in LFS and BLFS require GCC to compile other languages.
🌐
Debian
packages.debian.org › stretch › gcc-multilib
Details of package gcc-multilib in stretch
JavaScript is disabled in your browser · Please enable JavaScript to proceed · A required part of this site couldn’t load. This may be due to a browser extension, network issues, or browser settings. Please check your connection, disable any ad blockers, or try using a different browser
Find elsewhere
🌐
Linux From Scratch
linuxfromscratch.org › ~thomas › multilib-systemd › chapter08 › gcc.html
8.30. GCC-15.1.0
mlist=m64,m32,mx32 ../configure --prefix=/usr \ LD=ld \ --enable-languages=c,c++ \ --enable-default-pie \ --enable-default-ssp \ --enable-host-pie \ --enable-multilib \ --with-multilib-list=$mlist \ --disable-bootstrap \ --disable-fixincludes \ --with-system-zlib · GCC supports seven different computer languages, but the prerequisites for most of them have not yet been installed. See the BLFS Book GCC page for instructions on how to build all of GCC's supported languages. ... This parameter makes the configure script use the ld program installed by the Binutils package built earlier in this chapter, rather than the cross-built version which would otherwise be used.
🌐
OSDev.org
forum.osdev.org › board index › operating system development › os development
building multilib libgcc? - OSDev.org
November 7, 2016 - I'd very much prefer not to build 2 different cross-compilers just to build the OS, especially since i want it to become self-hosting so it's a bit silly to build a second compiler under the OS just for the purpose of compiling the OS itself. I'm trying the following configure command: ... ../glidix-gcc/configure --target=x86_64-glidix --prefix=/glidix/usr --with-sysroot=/glidix --enable-languages=c,c++ --disable-nls --enable-multilib --enable-multiarch --with-multilib-list=m32,m64 --with-arch-32=i686 It does not complain, builds fully (using just "make"; no "make all-gcc" and other trickery) and installs in the sysroot.
🌐
GitHub
gist.github.com › lirenlin › 8848142
gcc multilib · GitHub
Save lirenlin/8848142 to your computer and use it in GitHub Desktop. Download ZIP · gcc multilib · Raw · gistfile1.txt · This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
🌐
Reddit
reddit.com › r/archlinux › switching from gcc to gcc-multilib
r/archlinux on Reddit: Switching from gcc to gcc-multilib
April 16, 2018 -

I don't get how I'm supposed to do this. When installing over yaourt the compilation fails and (frustratingly) doesn't cache anything meaning I have to redo the 2hr+ process where my CPU is consistently hotter than 75C to get to the failure point.

Over pacman I try to remove gcc just for every dependency and their mother to complain that it needs gcc.

This is frustrating, is there a source download where I could compile and install it manually so I'm not at the mercy of yaourt or pacman?

For the record all I am trying to do is build the PCSX2 project from source with a different Video plugin as the standard GSL plugin has issues with hardware rendering on Intel HD Cards (because Intel sucks at driver support). This single issues is making me want to dust off my Windows Desktop but I'd prefer to have a decent emulator setup on my Linux laptop.

Here's the output of pacman -Qs gcc, I have the libs from multilib which I think I have to first remove before I can switch over since I remember reading gcc vs multilib is all or nothing.

local/gcc 7.3.1+20180312-2 (base-devel)

The GNU Compiler Collection - C and C++ frontends

local/gcc-ada 7.3.1+20180312-2

Ada front-end for GCC (GNAT)

local/gcc-libs 7.3.1+20180312-2 (base)

Runtime libraries shipped by GCC

local/lib32-gcc-libs 7.3.1+20180312-2 (multilib-devel)

32-bit runtime libraries shipped by GCC

I haven't updated in a week don't yell at me if my packages are out of date.

🌐
Raspberry Pi Forums
forums.raspberrypi.com › board index › using the raspberry pi › troubleshooting
Cannot install gcc-multilib - Raspberry Pi Forums
How I learned this and what to do from here : If you found this page googling like I did, you can find the various gcc multilib packages that are supported here, https://packages.debian.org/search?suit ... B+multilib From there you'll need your debian version. You can use cat /etc/os_release I am on version 10 (Buster) so I will use that as an example https://packages.debian.org/buster/g++-multilib However if you look at that list you won't see an arm64 build.
🌐
Linux From Scratch
linuxfromscratch.org › ~thomas › multilib › chapter05 › gcc-pass1.html
5.3. GCC-15.2.0 - Pass 1
mlist=m64,m32,mx32 ../configure \ --target=$LFS_TGT \ --prefix=$LFS/tools \ --with-glibc-version=2.43 \ --with-sysroot=$LFS \ --with-newlib \ --without-headers \ --enable-default-pie \ --enable-default-ssp \ --enable-initfini-array \ --disable-nls \ --disable-shared \ --enable-multilib \ --with-multilib-list=$mlist \ --disable-decimal-float \ --disable-threads \ --disable-libatomic \ --disable-libgomp \ --disable-libquadmath \ --disable-libssp \ --disable-libvtv \ --disable-libstdcxx \ --enable-languages=c,c++ ... This option specifies the version of Glibc which will be used on the target. It is not relevant to the libc of the host distro because everything compiled by pass1 GCC will run in the chroot environment, which is isolated from libc of the host distro.
🌐
Gentoo Wiki
wiki.gentoo.org › wiki › Sparc › Multilib
Sparc/Multilib - Gentoo wiki
December 19, 2024 - root #PKGDIR="`mktemp -d`" ... glibc, these two are available as binary packages: ... With a multilib glibc installed you can simply compile a biarch GCC using portage....
🌐
Arch Linux Forums
bbs.archlinux.org › viewtopic.php
Installing gcc-multilib after gcc installed. / Newbie Corner / Arch Linux Forums
June 1, 2015 - How very odd, when I did pacman -S gcc-multilib the first time it would just fail the removal of dependencies transaction, but now I've opened it up again to post you the log of it failing and its worked.
🌐
Ubuntu
launchpad.net › ubuntu › jammy › +package › gcc-multilib
gcc-multilib : Jammy (22.04) : Ubuntu - Launchpad
This is the GNU C compiler, a fairly portable optimizing compiler for C. . A dependency package on architectures with multilib support; the package contains dependencies for the non-default multilib architecture(s). gcc-defaults 1.193ubuntu1 source package in Ubuntu ... © 2004 Canonical Ltd. • Terms of use • Data privacy • Contact Launchpad Support • Blog • Careers • System status • 4fa2015 (Get the code!)
🌐
Debian
packages.debian.org › bookworm › gcc-multilib
Debian -- Details of package gcc-multilib in bookworm
dep: gcc-12-multilib (>= 12.2.0-1~) GNU C compiler (multilib support) dep: linux-libc-dev (>= 3.0.0-2) Linux support headers for userspace development · This page is also available in the following languages (How to set the default document language): Български (Bəlgarski) dansk Deutsch suomi français magyar Italiano 日本語 (Nihongo) Nederlands polski Português (br) Русский (Russkij) slovensky svenska Türkçe українська (ukrajins'ka) 中文 (Zhongwen,简) 中文 (Zhongwen,繁) See our contact page to get in touch.