Rather than use weak symbols, expose stubs symbols when needed.

Signed-off-by: David Marchand <david.march...@redhat.com>
---
 drivers/net/enic/enic_main.c | 8 +++-----
 drivers/net/enic/meson.build | 1 +
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index b755b15d92..5ee2ae555d 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -509,15 +509,13 @@ static void enic_prep_wq_for_simple_tx(struct enic *enic, 
uint16_t queue_idx)
        }
 }
 
-/*
- * The 'strong' version is in enic_rxtx_vec_avx2.c. This weak version is used
- * used when that file is not compiled.
- */
-__rte_weak bool
+#ifndef ENIC_RXTX_VEC
+bool
 enic_use_vector_rx_handler(__rte_unused struct rte_eth_dev *eth_dev)
 {
        return false;
 }
+#endif /* ENIC_RXTX_VEC */
 
 void enic_pick_rx_handler(struct rte_eth_dev *eth_dev)
 {
diff --git a/drivers/net/enic/meson.build b/drivers/net/enic/meson.build
index 00f8348348..1e26338350 100644
--- a/drivers/net/enic/meson.build
+++ b/drivers/net/enic/meson.build
@@ -33,6 +33,7 @@ includes += include_directories('base')
 # may not. This is to support users who build for the min supported machine
 # and need to run the binary on newer CPUs too.
 if dpdk_conf.has('RTE_ARCH_X86_64')
+    cflags += '-DENIC_RXTX_VEC'
     enic_avx2_lib = static_library('enic_avx2_lib',
             'enic_rxtx_vec_avx2.c',
             dependencies: [static_rte_ethdev, static_rte_bus_pci],
-- 
2.48.1

Reply via email to