Missing Headers?

I’m working on a C/C++/asm project that was written for x86-64 and I’m translating it to ARMv8a. When compiling part of the project I get an error:

/usr/src/linux-headers-3.18.0-linaro-hikey/include/linux/linkage.h fatal error: asm/linkage.h No such file or directory

I found that this is one of many missing headers referenced by user kernel headers. I included the /usr/src/linux-headers-3.18.0-linaro-hikey/ path since there are some headers missing from /usr/include/.

Things I’ve tried:

Running “make headers_install” from /usr/src/linux-headers-3.18.0-linaro-hikey/
Moving all headers from /usr/src/linux-headers-3.18.0-linaro-hikey/ to /usr/include/ and removing the -I to include /usr/src/linux-headers-3.18.0-linaro-hikey/
Editing the headers to not include other headers that are empty or missing.

Between each of the things I’ve tried I undid the steps of the previous attempts.

I’ve hit a brick wall and not sure where to go from here. I can compile on another system and move it to this board but that’s not going to help much for debugging. That may also introduce other problems.

Thoughts?

User code shouldn’t be trying to access anything in /usr/include/asm/* — your toolchain may be incomplete. I’m assuming from what you’re saying, that you’re building native on the board?

It’s only when you try to build kernel modules that you’ll have to get at the files in /usr/src/linux-headers-*

(Oh, and linkage.h is a kernel-internal header, and isn’t exported as part of the API).

Good to know. Thank you.

The reason I was trying to get at things in /usr/src/linux-headers* is that sys/io.h is there but not in /usr/include/. I think there’s a few other sys/*.h files missing from there.