[PATCH] tst-atomic.c: Mark as UNSUPPORTED when compiled with Clang

Florian Weimer fweimer@redhat.com
Thu Dec 19 10:58:12 GMT 2024


* H. J. Lu:

>> This is also a bug in how clang implements inline-asm and should be
>> filed upstream as a bug.  If clang folks think this is not a bug, then
>> clang does not implement GCC semantics for inline-asm and clang should
>> not mention it implements GCC inline-asm.
>>
>> On another note you might be able to get around it via a small change
>> to the x86 headers:
>>        __asm __volatile (lock "xaddq %q0, %1"                                 \
>>                          : "=r" (__result), "=m" (*(int64_t*)mem)
>>                  \
>>                          : "0" ((int64_t) cast_to_integer (__addval)),     \
>>                            "m" (*(int64_t*)mem),
>>                  \
>>                            "i" (offsetof (tcbhead_t, multiple_threads)));     \
>
> It still doesn't work.

Perhaps use compiler builtins on Clang then?

Thanks,
Florian



More information about the Libc-alpha mailing list