Thread (7 messages) 7 messages, 4 authors, 2018-04-22

Re: [PATCH] x86: ipc: fix x32 version of shmid64_ds and msqid64_ds

From: H.J. Lu <hidden>
Date: 2018-04-22 12:38:50
Also in: linux-api, linux-arch, linux-mips, linux-s390, lkml, sparclinux, stable

On Fri, Apr 20, 2018 at 7:38 AM, Arnd Bergmann [off-list ref] wrote:
On Fri, Apr 20, 2018 at 3:53 PM, Jeffrey Walton [off-list ref] wrote:
quoted
quoted
+#if !defined(__x86_64__) || !defined(__ilp32__)
 #include <asm-generic/msgbuf.h>
+#else
I understand there's some progress having Clang compile the kernel.
Clang treats __ILP32__ and friends differently than GCC. I believe
ILP32 shows up just about everywhere there are 32-bit ints, longs and
pointers. You might find it on Aarch64 or you might find it on MIPS64
when using Clang.

I think that means this may be a little suspicious:

    > +#if !defined(__x86_64__) || !defined(__ilp32__)

I kind of felt LLVM was wandering away from the x32 ABI, but the LLVM
devs insisted they were within their purview. Also see
https://lists.llvm.org/pipermail/cfe-dev/2015-December/046300.html.

Sorry about the top-post. I just wanted to pick out that one piece.
It seems I made a typo and it needs to be __ILP32__ rather than
__ilp32__ (corrected that locally, will resend once we have resolved
this).

Aside from that, the #if check seems to be correct to me: this
is an x86-specific header, so it won't ever be seen on other
architectures. On x86-32, __x86_64__ isn't set, so we don't care
about whether __ilp32__ is set or not, and on x86-64 (lp64),
__ilp32__ is never set, so we still get the asm-generic header.
Glibc has correct header files for system calls.  I have a very old
program to check if Linux kernel header files are correct for user
space:

https://github.com/hjl-tools/linux-header

It needs update to check uapi.

-- 
H.J.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help