Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

asm/errno.h: No such file or directory

Tags:

linux

gcc

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?

like image 911
mahmood Avatar asked Feb 10 '13 07:02

mahmood


4 Answers

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 .

like image 78
jrr Avatar answered Nov 12 '22 22:11

jrr


This worked for me:

ln -s /usr/include/asm-generic /usr/include/asm
like image 32
user2348442 Avatar answered Nov 12 '22 23:11

user2348442


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.

like image 25
nkigen Avatar answered Nov 12 '22 23:11

nkigen


This fixed it for me.

sudo apt-get install linux-libc-dev:i386
like image 6
Todd Carnes Avatar answered Nov 12 '22 22:11

Todd Carnes