[v2,5/5] build: add libatomic dependency for 32-bit clang compile

Message ID 20190528110748.10772-6-bruce.richardson@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series fix 32-bit meson builds |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Bruce Richardson May 28, 2019, 11:07 a.m. UTC
  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: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/event/octeontx/meson.build | 5 +++++
 drivers/event/opdl/meson.build     | 5 +++++
 lib/librte_rcu/meson.build         | 5 +++++
 3 files changed, 15 insertions(+)
  

Comments

Luca Boccassi May 28, 2019, 11:46 a.m. UTC | #1
On Tue, 2019-05-28 at 12:07 +0100, Bruce Richardson wrote:
> 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: Bruce Richardson <
> bruce.richardson@intel.com
> >
> ---
>  drivers/event/octeontx/meson.build | 5 +++++
>  drivers/event/opdl/meson.build     | 5 +++++
>  lib/librte_rcu/meson.build         | 5 +++++
>  3 files changed, 15 insertions(+)
> 
> diff --git a/drivers/event/octeontx/meson.build
> b/drivers/event/octeontx/meson.build
> index 2b74bb6..3f83be6 100644
> --- a/drivers/event/octeontx/meson.build
> +++ b/drivers/event/octeontx/meson.build
> @@ -11,3 +11,8 @@ sources = files('ssovf_worker.c',
>  )
>  
>  deps += ['common_octeontx', 'mempool_octeontx', 'bus_vdev',
> 'pmd_octeontx']
> +
> +# 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
> diff --git a/drivers/event/opdl/meson.build
> b/drivers/event/opdl/meson.build
> index cc6029c..e1cfb2d 100644
> --- a/drivers/event/opdl/meson.build
> +++ b/drivers/event/opdl/meson.build
> @@ -9,3 +9,8 @@ sources = files(
>  	'opdl_test.c',
>  )
>  deps += ['bus_vdev']
> +
> +# 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
> diff --git a/lib/librte_rcu/meson.build b/lib/librte_rcu/meson.build
> index 0c2d5a2..43edb87 100644
> --- a/lib/librte_rcu/meson.build
> +++ b/lib/librte_rcu/meson.build
> @@ -5,3 +5,8 @@ allow_experimental_apis = true
>  
>  sources = files('rte_rcu_qsbr.c')
>  headers = files('rte_rcu_qsbr.h')
> +
> +# 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

Acked-by: Luca Boccassi <bluca@debian.org>
  

Patch

diff --git a/drivers/event/octeontx/meson.build b/drivers/event/octeontx/meson.build
index 2b74bb6..3f83be6 100644
--- a/drivers/event/octeontx/meson.build
+++ b/drivers/event/octeontx/meson.build
@@ -11,3 +11,8 @@  sources = files('ssovf_worker.c',
 )
 
 deps += ['common_octeontx', 'mempool_octeontx', 'bus_vdev', 'pmd_octeontx']
+
+# 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
diff --git a/drivers/event/opdl/meson.build b/drivers/event/opdl/meson.build
index cc6029c..e1cfb2d 100644
--- a/drivers/event/opdl/meson.build
+++ b/drivers/event/opdl/meson.build
@@ -9,3 +9,8 @@  sources = files(
 	'opdl_test.c',
 )
 deps += ['bus_vdev']
+
+# 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
diff --git a/lib/librte_rcu/meson.build b/lib/librte_rcu/meson.build
index 0c2d5a2..43edb87 100644
--- a/lib/librte_rcu/meson.build
+++ b/lib/librte_rcu/meson.build
@@ -5,3 +5,8 @@  allow_experimental_apis = true
 
 sources = files('rte_rcu_qsbr.c')
 headers = files('rte_rcu_qsbr.h')
+
+# 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