From: Olivier Houchard Date: Wed, 23 Dec 2020 00:23:41 +0000 (+0100) Subject: MINOR: atomic: don't use ; to separate instruction on aarch64. X-Git-Tag: v2.1.11~11 X-Git-Url: http://git.haproxy.org/?a=commitdiff_plain;h=4c3508ca5875129dabdec6e8d570317564fd9c35;p=haproxy-2.1.git MINOR: atomic: don't use ; to separate instruction on aarch64. The assembler on MacOS aarch64 interprets ; as the beginning of comments, so it is not suitable for separating instructions in inline asm. Use \n instead. This should be backported to 2.3, 2.2, 2.1, 2.0 and 1.9. (cherry picked from commit 63ee28185430cbf5bdce21f82484f7de70fe4654) Signed-off-by: Christopher Faulet (cherry picked from commit ffc781b1eda8d4a66e899d3a40a37094ad4f674f) Signed-off-by: Christopher Faulet (cherry picked from commit 7c6634adcfbfa3c92bd8a51a688762df0969d8ce) [cf: patch applied on common/hathreads.h because haproxy/atomic.h does not exist] Signed-off-by: Christopher Faulet --- diff --git a/include/common/hathreads.h b/include/common/hathreads.h index 72573d6..9f83528 100644 --- a/include/common/hathreads.h +++ b/include/common/hathreads.h @@ -1211,17 +1211,17 @@ static __inline int __ha_cas_dw(void *target, void *compare, void *set) uint64_t tmp1, tmp2; __asm__ __volatile__("1:" - "ldxp %0, %1, [%4];" - "mov %2, %0;" - "mov %3, %1;" - "eor %0, %0, %5;" - "eor %1, %1, %6;" - "orr %1, %0, %1;" - "mov %w0, #0;" - "cbnz %1, 2f;" - "stxp %w0, %7, %8, [%4];" - "cbnz %w0, 1b;" - "mov %w0, #1;" + "ldxp %0, %1, [%4]\n" + "mov %2, %0\n" + "mov %3, %1\n" + "eor %0, %0, %5\n" + "eor %1, %1, %6\n" + "orr %1, %0, %1\n" + "mov %w0, #0\n" + "cbnz %1, 2f\n" + "stxp %w0, %7, %8, [%4]\n" + "cbnz %w0, 1b\n" + "mov %w0, #1\n" "2:" : "=&r" (tmp1), "=&r" (tmp2), "=&r" (value[0]), "=&r" (value[1]) : "r" (target), "r" (((void **)(compare))[0]), "r" (((void **)(compare))[1]), "r" (((void **)(set))[0]), "r" (((void **)(set))[1])