[2/3] crypto/ipsec_mb: fix build failures due to incompatible lib

Message ID 20230831121058.725577-3-bruce.richardson@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series enable PPC in test-meson-builds on ubuntu |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Bruce Richardson Aug. 31, 2023, 12:10 p.m. UTC
  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

Power, Ciara Aug. 31, 2023, 1:18 p.m. UTC | #1
> -----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>
  

Patch

diff --git a/drivers/crypto/ipsec_mb/meson.build b/drivers/crypto/ipsec_mb/meson.build
index 3057e6fd10..87bf965554 100644
--- a/drivers/crypto/ipsec_mb/meson.build
+++ b/drivers/crypto/ipsec_mb/meson.build
@@ -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