eal/arm: fix clang build of native target
authorRuifeng Wang <ruifeng.wang@arm.com>
Thu, 12 Nov 2020 10:31:57 +0000 (18:31 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 13 Nov 2020 09:30:48 +0000 (10:30 +0100)
commit8fce34cd0a6a55c965c222ab4de37615dea63621
treedfa6be7418300840bc01e03945927abec3a21252
parent2d0a972cd66bad6564c6d050e0f341a44a237dc9
eal/arm: fix clang build of native target

When doing Clang build with '-mcpu=native' on N1 platform, build failed
with:
../lib/librte_eal/arm/include/rte_atomic_64.h:76:39:
error: instruction requires: lse
__ATOMIC128_CAS_OP(__cas_128_release, "caspl")

This is because native detection for Neoverse N1 was added in Clang-11.
Prior version of Clang's assembler doesn't know LSE support on hardware.
Fixed this for Clang earlier than version 11 by specifying architecture
for assembler.
Referred to [1] for this fix.

Fixes: 7e2c3e17fe2c ("eal/arm64: add 128-bit atomic compare exchange")
Cc: stable@dpdk.org
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e0d5896bd356cd577f9710a02d7a474cdf58426b

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
lib/librte_eal/arm/include/rte_atomic_64.h