]> git.droids-corp.org - dpdk.git/commitdiff
build: add global libatomic dependency for 32-bit clang
authorPavan Nikhilesh <pbhagavatula@marvell.com>
Sun, 19 Apr 2020 10:01:01 +0000 (15:31 +0530)
committerDavid Marchand <david.marchand@redhat.com>
Tue, 21 Apr 2020 09:34:09 +0000 (11:34 +0200)
Add libatomic as a global dependency when compiling for 32-bit using
clang. As we need libatomic for 64-bit atomic ops.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
config/meson.build
drivers/event/octeontx/meson.build
drivers/event/octeontx2/meson.build
drivers/event/opdl/meson.build
examples/l2fwd-event/meson.build
lib/librte_distributor/meson.build
lib/librte_rcu/meson.build

index 58421342b10dcf36330cc1aebabbe6975a8ecfae..224d29e1ce1546037d80a18f9fa9f9c14c9b481e 100644 (file)
@@ -173,6 +173,13 @@ if pcap_dep.found() and cc.has_header('pcap.h', dependencies: pcap_dep)
        dpdk_extra_ldflags += '-lpcap'
 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
+       atomic_dep = cc.find_library('atomic', required: true)
+       add_project_link_arguments('-latomic', language: 'c')
+       dpdk_extra_ldflags += '-latomic'
+endif
+
 # add -include rte_config to cflags
 add_project_arguments('-include', 'rte_config.h', language: 'c')
 
index 73118a485419739488de3ea7ce33ec86f744ed0a..2b74bb62dea9d06e773ce598a70c7a07ae37298e 100644 (file)
@@ -11,8 +11,3 @@ 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
index 4b938416b90b973fbb5b24ddcd7c03b1165f32fb..0ade51cec7e886ec478e2b1676c9c773ce681bfa 100644 (file)
@@ -18,11 +18,6 @@ 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
index 1fe034ea12cc3d2a687a3656b8c2ada825cf7806..cc6029c6f077b766ba87a0030e7cc52d44eb4857 100644 (file)
@@ -9,8 +9,3 @@ 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
index c4664c3a3c3a5718a7696d69e16fe012756e52a1..4e9a069d6aa4c244d063c20d9ba0d5e2d9695494 100644 (file)
@@ -16,8 +16,3 @@ sources = files(
        'l2fwd_event_internal_port.c',
        'l2fwd_event_generic.c'
 )
-
-# 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
index 266af64348e13140e1584a96f781af631dc47374..bd12ddb2f1fe05902ec42cf3941d6e2e694b9a8c 100644 (file)
@@ -9,8 +9,3 @@ else
 endif
 headers = files('rte_distributor.h')
 deps += ['mbuf']
-
-# 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
index 5929bd3a7046cbed4f958ca95b2905dcb1260faa..c009ae4b737171b0661505c30664e93bfad7af29 100644 (file)
@@ -3,8 +3,3 @@
 
 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