petdance/scratch — Issue #409: Can't find asm/errno.h
Author: petdance
Created: 2011-11-01 05:42:16+00:00
State: open
Labels: bug, build, Pri-normal, Sev-medium

I just upgraded my laptop to Ubuntu 11.04, and immediately there is a problem building Parrot.
{{{
In file included from src/datatypes.c:23:
In file included from ./include/parrot/parrot.h:35:
In file included from /usr/include/errno.h:36:
In file included from /usr/include/bits/errno.h:25:
/usr/include/linux/errno.h:4:10: fatal error: 'asm/errno.h' file not found
}}}

errno.h used to be in /usr/include/asm/errno.h, but as of Ubuntu 11.04 it appears in these locations:

{{{
> locate errno.h
/opt/intel/Compiler/11.1/064/Documentation/en_US/compiler_c/main_cls/copts/common_options/option_fmath_errno.htm
/opt/intel/Compiler/11.1/064/Documentation/ja_JP/compiler_c/main_cls/copts/common_options/option_fmath_errno.htm
/usr/include/errno.h
/usr/include/asm-generic/errno.h
/usr/include/bits/errno.h
/usr/include/linux/errno.h
/usr/include/sys/errno.h
/usr/lib/syslinux/com32/include/errno.h
}}}

So it looks like it's in /usr/include/errno.h ("#include ") or in /usr/include/asm-generic/errno.h ("#include "). What's weird is that the two files are not the same, and don't define the same constants. It looks like Parrot will build with /usr/include/asm-generic/errno.h, but fails with a symbol undefined error with /usr/include/errno.h. I don't know if this is a "bug" as far as Ubuntu is concerned or not. It certainly seems undesired to me.

I can, as a temporary fix, use a symlink to put the files in the correct places. However, For completeness, I wonder if we should do any of the following:

- Try to avoid using asm/errno.h in our code, if possible
- Add a configure probe to search for the correct errno.h
- Yell at Ubuntu until they fix this.

Any of these are fine, I just want to get some opinions about it. If more people upgrade ubuntu and run into these problems, we will be getting more reports about it.

Originally http://trac.parrot.org/parrot/ticket/2109