Skip to contentSkip to conversation

sparse and multiarch include paths

DISCUSSION Josh Triplett 3 participants 4 messages Aug 24, 2011 – Aug 25, 2011 Sparse checker

lore
Share & tools
lore
#0 lore raw

When trying to use sparse on some low-level userspace code, I ran into the following error:

/usr/include/bits/socket.h:381:11: error: unable to open 'asm/socket.h'

It looks like that file lives in /usr/include/x86_64-linux-gnu/asm/socket.h , and gcc has /usr/include/x86_64-linux-gnu in its default include path. This relates to Debian's multiarch efforts, moving such headers to paths which include the architecture to allow simultaneous installation of the headers for multiple architectures. I don't know how gcc ends up with that directory in its include path, but sparse needs to follow suit to compile any code which includes these architecture-specific headers.

I've CCed the Debian GCC maintainers and multiarch developers, in the hopes of getting some additional details that might help resolve this problem.

- Josh Triplett

#1 lore raw

I've hit this as well. The ubuntu-packaged sparse seems to get this right; building from git sources gives busted paths -- suspect they have patches that need to come upstream?

-- Chris

Quoted 19 lines · Josh Triplett

When trying to use sparse on some low-level userspace code, I ran into the following error:

/usr/include/bits/socket.h:381:11: error: unable to open 'asm/socket.h'

It looks like that file lives in /usr/include/x86_64-linux-gnu/asm/socket.h , and gcc has /usr/include/x86_64-linux-gnu in its default include path.  This relates to Debian's multiarch efforts, moving such headers to paths which include the architecture to allow simultaneous installation of the headers for multiple architectures.  I don't know how gcc ends up with that directory in its include path, but sparse needs to follow suit to compile any code which includes these architecture-specific headers.

I've CCed the Debian GCC maintainers and multiarch developers, in the hopes of getting some additional details that might help resolve this problem.

Quoted 6 lines

- Josh Triplett
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 9 lines · Ludovic Brenta
Quoted 4 lines · Josh Triplett

When trying to use sparse on some low-level userspace code, I ran into the following error:

/usr/include/bits/socket.h:381:11: error: unable to open 'asm/socket.h'

See http://bugs.debian.org/638418

Hope this helps

Thanks! That does seem to explain the problem; I removed and reinstalled gcc-multilib, and now I have a /usr/include/asm symlink and sparse seems happy.

- Josh Triplett