Correct robust mutex / PI futex kernel assumptions (bug 9894)
David Miller
davem@davemloft.net
Tue Mar 25 15:12:00 GMT 2014
From: "Joseph S. Myers" <joseph@codesourcery.com>
Date: Tue, 25 Mar 2014 12:19:12 +0000
> On Tue, 25 Mar 2014, David Miller wrote:
>
>> > and futex_32.h just uses the asm-generic version, which just returns
>> > -ENOSYS. Are you saying that if glibc is built for 32-bit plus V9/V8plus,
>> > then the kernel that glibc binary runs under must have been built with
>> > defined(__sparc__) && defined(__arch64__) true? If so, what is the
>> > relevant cpp condition in userspace for "glibc can assume a kernel with
>> > functional futex_atomic_cmpxchg_inatomic"?
>>
>> A 32-bit binary compiled for v9 can only execute on 64-bit kernels.
>
> Thanks for the explanation. What's the right preprocessor conditional for
> requiring a 64-bit kernel (to replace the "defined __arch64__" in my
> patch)?
There isn't. You really have to base it upon the config triplet, by
placing the header file in question under a sparc32/v9 subdirectory.
You could include atomic.h and do tests on __sparc32_atomic_do_lock like
lowlevellock.h does, but that's really ugly.
More information about the Libc-alpha
mailing list