summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Richardson <bruce.richardson@intel.com>2019-04-10 14:45:17 +0100
committerThomas Monjalon <thomas@monjalon.net>2019-06-05 16:28:20 +0200
commit9bd75b508e11fcb38589c90ae435734d6343ad78 (patch)
treed8efeac5571857e521d1ba9f81c3b20dcaead9b6
parente53ce4e4137974f46743e74bd9ab912e0166c8b1 (diff)
downloaddpdk-next-eventdev-9bd75b508e11fcb38589c90ae435734d6343ad78.zip
dpdk-next-eventdev-9bd75b508e11fcb38589c90ae435734d6343ad78.tar.gz
dpdk-next-eventdev-9bd75b508e11fcb38589c90ae435734d6343ad78.tar.xz
bpf: remove use of weak functions
Weak functions don't work well with static libraries and require the use of "whole-archive" flag to ensure that the correct function is used when linking. Since the weak function is only used as a placeholder within this library alone, we can replace it with a non-weak version protected using preprocessor ifdefs. Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Tested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
-rw-r--r--lib/librte_bpf/bpf_load.c4
-rw-r--r--lib/librte_bpf/meson.build1
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/librte_bpf/bpf_load.c b/lib/librte_bpf/bpf_load.c
index d9d163b..194103e 100644
--- a/lib/librte_bpf/bpf_load.c
+++ b/lib/librte_bpf/bpf_load.c
@@ -131,7 +131,8 @@ rte_bpf_load(const struct rte_bpf_prm *prm)
return bpf;
}
-__rte_experimental __rte_weak struct rte_bpf *
+#ifndef RTE_LIBRTE_BPF_ELF
+__rte_experimental struct rte_bpf *
rte_bpf_elf_load(const struct rte_bpf_prm *prm, const char *fname,
const char *sname)
{
@@ -146,3 +147,4 @@ rte_bpf_elf_load(const struct rte_bpf_prm *prm, const char *fname,
rte_errno = ENOTSUP;
return NULL;
}
+#endif
diff --git a/lib/librte_bpf/meson.build b/lib/librte_bpf/meson.build
index 8a79878..11c1fb5 100644
--- a/lib/librte_bpf/meson.build
+++ b/lib/librte_bpf/meson.build
@@ -20,6 +20,7 @@ deps += ['mbuf', 'net', 'ethdev']
dep = dependency('libelf', required: false)
if dep.found()
+ dpdk_conf.set('RTE_LIBRTE_BPF_ELF', 1)
sources += files('bpf_load_elf.c')
ext_deps += dep
endif