From: Timothy Redaelli Date: Tue, 24 Nov 2020 15:14:14 +0000 (+0100) Subject: eal: fix shared lib mode detection X-Git-Url: http://git.droids-corp.org/?p=dpdk.git;a=commitdiff_plain;h=7781950f4d38eb7d9f473fedf517f6550c593b1d eal: fix shared lib mode detection Commit 06c7871dde01 ("eal: restrict default plugin path to shared lib mode") introduced a check that enabled shared lib mode when librte_eal.so can be loaded, but it can't work, at least, on Fedora/CentOS/RHEL since .so symlinks are not installed when you install dpdk package, but only when you install dpdk-devel package. This commit uses librte_eal.so.ABI_VERSION to check for shared lib, since it exists on any linux distributions. See Fedora Packaging Guidelines for more information: https://docs.fedoraproject.org/en-US/packaging-guidelines/#_devel_packages Fixes: 06c7871dde01 ("eal: restrict default plugin path to shared lib mode") Cc: stable@dpdk.org Signed-off-by: Timothy Redaelli Acked-by: Bruce Richardson Acked-by: David Marchand Acked-by: Maxime Coquelin Tested-by: Ali Alnubani --- diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c index fc6f0cea93..ac3884a371 100644 --- a/lib/librte_eal/common/eal_common_options.c +++ b/lib/librte_eal/common/eal_common_options.c @@ -503,7 +503,7 @@ eal_plugins_init(void) * (Using dlopen with NOLOAD flag on EAL, will return NULL if the EAL * shared library is not already loaded i.e. it's statically linked.) */ - if (dlopen("librte_eal.so", RTLD_LAZY | RTLD_NOLOAD) != NULL && + if (dlopen("librte_eal.so."ABI_VERSION, RTLD_LAZY | RTLD_NOLOAD) != NULL && *default_solib_dir != '\0' && stat(default_solib_dir, &sb) == 0 && S_ISDIR(sb.st_mode)) diff --git a/lib/librte_eal/common/meson.build b/lib/librte_eal/common/meson.build index 9f32262450..39abf7a0a4 100644 --- a/lib/librte_eal/common/meson.build +++ b/lib/librte_eal/common/meson.build @@ -3,6 +3,8 @@ includes += include_directories('.') +cflags += [ '-DABI_VERSION="@0@"'.format(abi_version) ] + if is_windows sources += files( 'eal_common_bus.c',