+12
−18
Loading
Our pkg-config documentation has a couple of bugs: 1) It recommends using separate variables for results from spdk_nvme and spdk_env_dpdk. But both of these generate '-lspdk_util' and on a static build that ends up with multiple definition link errors. 2) DPDK by default builds both static and shared libraries. The linker will prefer shared instead of static if it finds both. But the DPDK build directory is not part of LD_LIBRARY_PATH by default. So fix the docs with the following two changes: 1) Recommend just one pkg-config invocation, passing spdk_nvme and spdk_env_dpdk together. 2) Wrap the libraries in the LDFLAGS with -Wl,-Bstatic and -Wl,-Bdynamic. This will signal the linker to prefer static instead of shared libraries if it finds both, just for those libraries between the two added directives. While here, also add a missing --static argument to the example for spdk_syslibs. Fixes issue #3177. Signed-off-by:Jim Harris <jim.harris@samsung.com> Change-Id: Ibf1f2f06560e77738cfa040c38346ec0867d5b4b Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/20558 Reviewed-by:
Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-by:
Konrad Sztyber <konrad.sztyber@intel.com> Tested-by:
SPDK CI Jenkins <sys_sgci@intel.com>