event/octeontx2: add libatomic dependency for 32-bit clang

Message ID 20190704085935.3328-1-pbhagavatula@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series event/octeontx2: add libatomic dependency for 32-bit clang |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/intel-Performance-Testing success Performance Testing PASS
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/Intel-compilation fail apply issues

Commit Message

Pavan Nikhilesh Bhagavatula July 4, 2019, 8:59 a.m. UTC
  From: Pavan Nikhilesh <pbhagavatula@marvell.com>

When compiling with clang on 32-bit platforms, we are missing
copies of 64-bit atomic functions. We can solve this by linking
against libatomic for the drivers and libs which need those
atomic ops.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 drivers/event/octeontx2/meson.build | 5 +++++
 1 file changed, 5 insertions(+)
  

Comments

Thomas Monjalon July 4, 2019, 2:49 p.m. UTC | #1
04/07/2019 10:59, pbhagavatula@marvell.com:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> 
> When compiling with clang on 32-bit platforms, we are missing
> copies of 64-bit atomic functions. We can solve this by linking
> against libatomic for the drivers and libs which need those
> atomic ops.
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

Applied, thanks
  

Patch

diff --git a/drivers/event/octeontx2/meson.build b/drivers/event/octeontx2/meson.build
index bdb5beed6..ecd8fd84d 100644
--- a/drivers/event/octeontx2/meson.build
+++ b/drivers/event/octeontx2/meson.build
@@ -20,6 +20,11 @@  if not dpdk_conf.get('RTE_ARCH_64')
 	extra_flags += ['-Wno-int-to-pointer-cast', '-Wno-pointer-to-int-cast']
 endif
 
+# for clang 32-bit compiles we need libatomic for 64-bit atomic ops
+if cc.get_id() == 'clang' and dpdk_conf.get('RTE_ARCH_64') == false
+	ext_deps += cc.find_library('atomic')
+endif
+
 foreach flag: extra_flags
 	if cc.has_argument(flag)
 		cflags += flag