[2/3] crypto/ipsec_mb: fix build failures due to incompatible lib
Checks
Commit Message
When cross-compiling for PowerPC on Ubuntu, the x86 IPSec_MB library was
getting found by the build system for use in the PPC build. This led to
failures at compile time due to the library not being linkable.
We can avoid these failures by checking the discovered library for
compatibility at configuration time. This needs a version check as it is
supported only from version 0.60 of meson onwards.
Fixes: c75542ae4200 ("crypto/ipsec_mb: introduce IPsec_mb framework")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
drivers/crypto/ipsec_mb/meson.build | 5 +++++
1 file changed, 5 insertions(+)
Comments
> -----Original Message-----
> From: Richardson, Bruce <bruce.richardson@intel.com>
> Sent: Thursday, August 31, 2023 1:11 PM
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>; stable@dpdk.org; Ji, Kai
> <kai.ji@intel.com>; De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>;
> Akhil Goyal <gakhil@marvell.com>; Power, Ciara <ciara.power@intel.com>;
> Ray Kinsella <mdr@ashroe.eu>; Fan Zhang <fanzhang.oss@gmail.com>
> Subject: [PATCH 2/3] crypto/ipsec_mb: fix build failures due to incompatible
> lib
>
> When cross-compiling for PowerPC on Ubuntu, the x86 IPSec_MB library was
> getting found by the build system for use in the PPC build. This led to failures
> at compile time due to the library not being linkable.
>
> We can avoid these failures by checking the discovered library for compatibility
> at configuration time. This needs a version check as it is supported only from
> version 0.60 of meson onwards.
>
> Fixes: c75542ae4200 ("crypto/ipsec_mb: introduce IPsec_mb framework")
> Cc: stable@dpdk.org
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
@@ -16,6 +16,11 @@ lib = cc.find_library('IPSec_MB', required: false)
if not lib.found()
build = false
reason = 'missing dependency, "libIPSec_MB"'
+# if the lib is found, check it's the right format
+elif meson.version().version_compare('>=0.60') and not cc.links(
+ 'int main(void) {return 0;}', dependencies: lib)
+ build = false
+ reason = 'incompatible dependency, "libIPSec_MB"'
else
ext_deps += lib