asm/errno.h: No such file or directory

70,150

Solution 1

I think the package you want is linux-libc-dev . I encountered this when building 32-on-64; so I needed linux-libc-dev:i386 .

Solution 2

This worked for me:

ln -s /usr/include/asm-generic /usr/include/asm

Solution 3

This worked for me:

sudo ln -s /usr/include/asm-generic /usr/include/asm

The reason being that what GCC expects to be called /usr/include/asm is renamed to /usr/include/asm-generic in some distros.

Solution 4

This solved it for me on Debian 10, even though I was compiling with an LLVM-based compiler:

sudo apt install gcc-multilib

Solution 5

This fixed it for me.

sudo apt-get install linux-libc-dev:i386
Share:
70,150

Related videos on Youtube

mahmood
Author by

mahmood

Updated on November 16, 2020

Comments

  • mahmood
    mahmood about 2 years

    While building gcc, I get this error:

    In file included from /usr/include/bits/errno.h:25,
                 from /usr/include/errno.h:36,
                 from ../.././gcc/tsystem.h:96,
                 from ../.././gcc/crtstuff.c:68:
    /usr/include/linux/errno.h:4:23: error: asm/errno.h: No such file or directory
    make[2]: *** [crtbegin.o] Error 1
    make[2]: Leaving directory `/opt/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc'
    

    I am building gcc 4.1 from source. I think I have to install build-essential. However installing that package in ubuntu 12.04 will automatically download and install gcc 4.6 and I don't want that.

    Is there any other way?

  • Aurelien
    Aurelien over 7 years
    Indeed, it looks similar to what you would get if you do apt-get install gcc-multilib (apt-file search /usr/include/asm shows this package) and on my system, having that installed, /usr/include/asm is a symbolic link. Not sure whether this package depends on build-essential or not though.
  • Peter Cordes
    Peter Cordes over 6 years
    With both installed on Ubuntu 15.10, diff -ur /usr/include/x86_64-linux-gnu/asm/ /usr/include/i386-linux-gnu/asm/ shows no differences. Some other files outside those directories are provided by both packages, but apparently this is ok, and you only have multiple copies of those 62 files totalling ~340k. dpkg -L linux-libc-dev | diff -ur - <(dpkg -L linux-libc-dev:i386) shows that both packages provide the same files outside the arch-specific include directory.
  • Peter Cordes
    Peter Cordes over 6 years
    So if you're going to symlink instead of keeping the package manager happy by installing linux-libc-dev:i386 on a 64bit system, use ln -s x86_64-linux-gnu /usr/include/i386-linux-gnu to make a relative symlink.
  • Trevor Hickey
    Trevor Hickey almost 6 years
    Thanks. I guess nobody cares enough to fix it. Do they not run their own installers across distros?
  • Owl
    Owl about 4 years
    E: Unable to locate package linux-libc-dev:386
  • Owl
    Owl about 4 years
    Yes, I can confirm this works for me running n0000bunt00.
  • Nick Desaulniers
    Nick Desaulniers over 2 years
    Thanks! I hit this when building LLVM's compiler-rt. I was missing linux-libc-dev:i386.

Related