GCC should support or run with multilib to eliminate this error.

Answer from Sunil Bojanapally on Stack Overflow
🌐
Stack Exchange
unix.stackexchange.com › questions › 167751 › how-to-determine-the-wordsize-in-linux-kernel-programming
How to determine the wordsize in Linux kernel programming? - Unix & Linux Stack Exchange
The asm/types.h should have BITS_PER_LONG set, which should be the word size to Robert Love's Linux Kernel Development (sixth result in the search). ... Find the answer to your question by asking. Ask question ... See similar questions with these tags. ... Proportional odds logistic regression for ordered category outcome - how to convert odds ratios to probabilities in this case?
Discussions

ERROR: Fatal error wordsize.h no such file or directory along with other warnings when building Linux kernel
Image link: https://postimg.cc/c67X1qC1/2cb2ebe0 Image link: https://postimg.cc/BjC027mJ/27391bec More on reddit.com
🌐 r/kisslinux
3
1
June 30, 2021
Missing `bits/wordsize.h` while compiling
An application I use, uses python and netifaces. This fails compiling with the following message on the org.gnome.Platform and Sdk 3.20: Running setup.py install for netifaces Complete output from ... More on github.com
🌐 github.com
3
July 30, 2016
c - fatal error: 'bits/types.h' file not found - Stack Overflow
When I try to compile a C program on MAC I get the following error message: /usr/local/include/stdio.h:35:11: fatal error: 'bits/types.h' file not found #include Does anyone ... More on stackoverflow.com
🌐 stackoverflow.com
May 23, 2017
c - "fatal error: bits/libc-header-start.h: No such file or directory" while compiling HTK - Stack Overflow
I'm getting the following issue when trying to run make on the HTK library: (cd HTKLib && make HTKLib.a) \ || case "" in *k*) fail=yes;; *) exit 1;; esac; make[1]: Entering directory '/h... More on stackoverflow.com
🌐 stackoverflow.com
🌐
GitHub
github.com › Zygo › bees › issues › 140
cannot compile bees due to missing bits/wordsize.h · Issue #140 · Zygo/bees
January 12, 2020 - $ make fatal: not a git repository (or any parent up to mount point /var/home) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set). make PREFIX=/usr LIBEXEC_PREFIX=/usr/lib/bees ETC_PREFIX=/etc TAG="UNKNOWN" -C lib make[1]: Entering directory '/var/home/user/bin/bees-0.6.2/lib' g++ -Wall -Wextra -Werror -I../include -fpic -D_FILE_OFFSET_BITS=64 -std=c++11 -Wold-style-cast -M -MF .depends/chatter.dep -MT chatter.o chatter.cc In file included from /usr/include/c++/9/functional:48, from ../include/crucible/chatter.h:4, from chatter.cc:1: /usr/include/c++/9/x86_64-redhat-linux/bits/c++config.h:3:10: fatal error: bits/wordsize.h: No such file or directory 3 | #include <bits/wordsize.h> | ^~~~~~~~~~~~~~~~~ compilation terminated.
Author   omichalek
🌐
Ubuntu
bugs.launchpad.net › bugs › 2067082
Bug #2067082 “bits/wordsize.h: No such file or directory” : Bugs : glibc package : Ubuntu
Compilation fails due to assuming "usr/include/" contains a folder "bits/", which in my case should contain the files "wordsize.h" and "timesize.h".
🌐
GitHub
github.com › flatpak › flatpak › issues › 220
Missing `bits/wordsize.h` while compiling · Issue #220 · flatpak/flatpak
July 30, 2016 - Running setup.py install for netifaces Complete output from command /usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-q4nhh9e0/netifaces/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-92nrgnit-record/install-record.txt --single-version-externally-managed --compile --user: running install running build running build_ext checking for getifaddrs...not found. checking for getnameinfo...not found. checking for socket IOCTLs...not found. checking for optional header files...none foun
Author   gbraad
🌐
Narkive
lfs-support.linuxfromscratch.narkive.com › 8bXoKFuV › make-error-gcc
make error gcc - lfs-support@linuxfromscratch.org - narkive
=== /usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory make[5]: *** [_muldi3.o] Error 1 make[5]: Leaving directory -- Kind Regards, Rajinder Yadav Upon further investigation, I only have the following 2 stub files $ cd /usr/include/gnu $ ls · Post by Rajinder Yadav libc-version.h lib-names.h stubs-64.h stubs.h doing a cat of stubs.h I notice bits/wordsize.h is included, so I check it out $ cat stubs.h ==========OUTPUT ======== /* This file selects the right generated file of `__stub_FUNCTION' macros based on the architecture being compiled for.
🌐
Gentoo
bugs.gentoo.org › 715476
715476 – dev-lang/teyjus-2.1-r2 : ../.../standardlib.h: fatal error: bits/wordsize.h: No such file or directory
August 9, 2022 - Gentoo's Bugzilla – Bug 715476 dev-lang/teyjus-2.1-r2 : ../.../standardlib.h: fatal error: bits/wordsize.h: No such file or directory Last modified: 2022-08-09 06:51:12 UTC node [vulture]
Find elsewhere
🌐
Arch Linux Forums
bbs.archlinux.org › viewtopic.php
foolish glibc error * / Programming & Scripting / Arch Linux Forums
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory I found this in stubs.h: /* This file selects the right generated file of `__stub_FUNCTION' macros based on the architecture being compiled for. */ #include <bits/wordsize.h> #if __WORDSIZE == 32 # include <gnu/stubs-32.h> #elif __WORDSIZE == 64 # include <gnu/stubs-64.h> #else # error "unexpected value for __WORDSIZE macro" #endif
🌐
Gentoo
bugs.gentoo.org › 712842
712842 – sys-fabric/opensm-3.3.24 : ../.../cl_debug_osd.h: fatal error: bits/wordsize.h: No such file or directory
February 9, 2022 - Gentoo's Bugzilla – Bug 712842 sys-fabric/opensm-3.3.24 : ../.../cl_debug_osd.h: fatal error: bits/wordsize.h: No such file or directory Last modified: 2022-02-09 07:03:31 UTC node [vulture]
🌐
Gentoo
bugs.gentoo.org › 829176
829176 – sys-cluster/galera-26.4.17 - galerautils/.../gu_arch.h: fatal error: bits/wordsize.h: No such file or directory
March 26, 2024 - Gentoo's Bugzilla – Bug 829176 sys-cluster/galera-26.4.17 - galerautils/.../gu_arch.h: fatal error: bits/wordsize.h: No such file or directory Last modified: 2025-09-26 08:33:33 UTC node [vulture]
🌐
The Mail Archive
mail-archive.com › ubuntu-bugs@lists.ubuntu.com › msg6064664.html
[Bug 2067082] [NEW] bits/wordsize.h: No such file or directory
May 24, 2024 - ccache cc -c -o dlls/winecrt0/... from /home/test/wine-git/dlls/winecrt0/dll_entry.c:29: /usr/include/features-time64.h:20:10: fatal error: bits/wordsize.h: No such file or directory 20 | #include <bits/wordsize.h> | ^~~~~~~~~~~~~~~~~ compilation terminated....
🌐
Google Groups
groups.google.com › g › linux.debian.bugs.dist › c › WbCKWyUzq9k
Bug#1027966: building of cross-toolchain-base broken, wrong assumption of dpkg-buildinfo
January 5, 2023 - Package: dpkg-dev Version: 1.21.16 ... from /usr/include/unistd.h:25, from <stdin>:1: /usr/include/features-time64.h:20:10: fatal error: bits/wordsize.h: No such file or directory 20 | #include <bits/wordsize.h> | ^~~~~~~~~~~~~~~~~ compilation terminated....
🌐
Texas Instruments E2E
e2e.ti.com › support › processors-group › processors › f › processors-forum › 799376 › linux-tmdx654idkevm-error-while-cross-compilation
Linux/TMDX654IDKEVM: Error while Cross-Compilation - Processors forum - Processors - TI E2E support forums
May 7, 2019 - Looking into the "wordsize.h" file I can see that it has the following processor directives: #if __MHWORDSIZE == 32 #ifdef _MIPS_SIM #if _MIPS_SIM == _ABIO32 #include <bits/wordsize-32.h> #elif _MIPS_SIM == _ABIN32 #include <bits/wordsize-n32.h> #else #error "Unknown _MIPS_SIM" #endif #else /* _MIPS_SIM is not defined */ #include <bits/wordsize-32.h> #endif #elif __MHWORDSIZE == 64 #include <bits/wordsize-64.h> #else #error "Unknown __WORDSIZE detected" #endif /* matches #if __WORDSIZE == 32 */
Top answer
1 of 3
164

The -m32 is telling gcc to compile for a 32-bit platform. On a 64-bit platform, gcc normally only comes with 64-bit libraries. You have two options:

  1. Install 32-bit headers and libraries. Here's how you'd do this on Ubuntu.

    Run this command:

    sudo apt-get install gcc-multilib
    
  2. Compile for 64-bit instead. Modify this line in the file named configure:

     CFLAGS="-m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH=\"$host_cpu\"' $CFLAGS"
    

    Delete -m32, giving you:

     CFLAGS="-ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH=\"$host_cpu\"' $CFLAGS"
    

    Run ./configure, then make clean, then make

    However, I would recommend against this approach. The library authors went out of their way to make this build for 32 bits on a 64 bit system, and I can't guarantee that it will work correctly if you do this. (It does compile, though.)

2 of 3
19

Below is one way to debug and fix this issue. Since most linux installations differ in one way or another, YMMV.

  1. Find which package installed libc-header-start.h.
$ dpkg -S libc-header-start.h
libc6-dev:amd64: /usr/include/x86_64-linux-gnu/bits/libc-header-start.h

On a working system, /usr/include/bits is a symlink to /usr/include/x86_64-linux-gnu/bits. Running dpkg search gives us:

$ dpkg -S /usr/include/bits
libc6-dev-i386: /usr/include/bits

Installing libc6-dev-i386 creates the symlink and the error is addressed.

However, subsequently I ran into a linker error with the linker not being able to find libgcc (-lgcc). Apparently Linux default linker needs libgcc in most cases. Further debugging the issue with linker verbosity enabled lead me to missing lib32gcc-10-dev package.

In short, unless a very controlled build environment is desired, just install gcc-multilib package when using -m32 (needed for gcc or clang). For C++, g++-multilib is also required.

🌐
LinuxQuestions.org
linuxquestions.org › questions › linux-from-scratch-13 › 6-12-gcc-4-1-2-make-error-662144
6.12. GCC-4.1.2 make error.
August 12, 2008 - Hello all, I'm currently stuck on: Linux From Scratch - Version 6.3, Chapter 6. Installing Basic System Software, 6.12. GCC-4.1.2 I received the
🌐
The Mail Archive
mail-archive.com › debian-bugs-dist@lists.debian.org › msg2034614.html
Bug#1104398: cross-toolchain-base-mipsen: FTBFS randomly: features-time64.h:20:10: fatal error: bits/wordsize.h: No such file or directory
> make[1]: *** [debian/rules:1141: stamp-dir/dc-libc6-dev_2.41-7_mips64el.deb] > Error 255 The full build log is available from: http://qa-logs.debian.net/2025/04/28/cross-toolchain-base-mipsen_32_unstable.log You can find other build logs (including successful ones) in: http://qa-logs.debian.net/2025/04/28/ All bugs filed during this archive rebuild are listed at: https://bugs.debian.org/cgi-bin/pkgreport.cgi?tag=ftbfs-20250428;users=lu...@debian.org or: https://udd.debian.org/bugs/?release=na&merged=ign&fnewerval=7&flastmodval=7&fusertag=only&fusertagtag=ftbfs-20250428&fusertaguser=lu...@debian.org&allbugs=1&cseverity=1&ctags=1&caffected=1#results A list of current common problems and possible solutions is available at http://wiki.debian.org/qa.debian.org/FTBFS .