Skip to content
Snippets Groups Projects
Commit 02a28f1d authored by Brad King's avatar Brad King
Browse files

libuv: Restore compilation with XLClang 16.1 on AIX

libuv upstream commit `4a972bf0` (aix: Fix broken cmpxchgi() XL C++
specialization., 2019-09-06, v1.32.0~5) broke compilation with this
compiler.  According to

    https://www.ibm.com/support/knowledgecenter/SSGH3R_16.1.0/com.ibm.xlcpp161.aix.doc/migrate/migrate_to_xlclang.html

XLClang 16.1 for AIX does not support `__sync_val_compare_and_swap`.
The documentation suggests using C++11 atomic operations instead, but
this is C code.  For now fall back to the non-atomic equivalent used
before so we can at least compile.  Add a FIXME comment for this.
parent 82a06d5c
No related branches found
No related tags found
No related merge requests found
......@@ -36,6 +36,12 @@ UV_UNUSED(static int cmpxchgi(int* ptr, int oldval, int newval)) {
: "r" (newval), "0" (oldval)
: "memory");
return out;
#elif defined(_AIX) && defined(__ibmxl__)
/* FIXME: This is not actually atomic but XLClang 16.1 for AIX
does not provide __sync_val_compare_and_swap or an equivalent.
Its documentation suggests using C++11 atomics but this is C. */
__compare_and_swap((volatile int*)ptr, &oldval, newval);
return oldval;
#elif defined(__MVS__)
unsigned int op4;
if (__plo_CSST(ptr, (unsigned int*) &oldval, newval,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment