4

I'm trying to compile strace 4.19 on 64-bit Kubuntu 14.04, and the compilation fails with the following error:

/usr/include/linux/errno.h:1:23: fatal error: asm/errno.h: No such file or directory

I was able to reproduce the problem to that of compilation of the test C source:

#include <errno.h>

It compiles fine with -m32 and -m64 GCC options, but fails with the error mentioned above for -mx32:

$ gcc -c -x c -mx32 - <<< '#include <errno.h>'
In file included from /usr/include/bits/errno.h:24:0,
                 from /usr/include/errno.h:35,
                 from <stdin>:1:
/usr/include/linux/errno.h:1:23: fatal error: asm/errno.h: No such file or directory
compilation terminated.

I assume I'm missing some package which does provide asm/errno.h for x32 ABI. What is this package?

Another question I viewed doesn't solve this: I've tried what the accepted answer suggested, and it didn't change anything at all. Besides, it isn't even applicable to pure GCC without any autotools build. And the other answer is just a dirty hack, which I don't know how will break the strace build. Also, that other question doesn't mention x32, which is the core of this question.

10
  • It's referenced and included by lots of packages, but I think the one that you probably want is sudo apt-get install build-essential Sep 25, 2017 at 16:13
  • @CharlesGreen it's already the newest version. Please note that -m32 and -m64 compile successfully.
    – Ruslan
    Sep 25, 2017 at 16:14
  • 2
    Possible duplicate of asm/errno.h: No such file or directory Sep 25, 2017 at 16:17
  • 1
    Maybe linux-libc-dev:i386 and or libc6-dev:i386 (later will install former, former is most likely..
    – doug
    Sep 26, 2017 at 11:33
  • 1
    Try installing gcc-multilib
    – doug
    Sep 27, 2017 at 13:00

1 Answer 1

2

To resolve this issue support for the x32 ABI in gcc must be enabled.

The gcc-multilib package will provide that via a /usr/include/linux/asm symlink. For reference this was seen in a debian bug where the above info was provided. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=871946

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .