common/qat: fix build errors with incompatible IPSec lib
PATCH 1/1 common/qat: fix build errors with incompatible IPSec lib
Since "find_library()" is used to find the libipsec_mb library, there is a chance that an incompatible library will be found e.g. when doing cross-builds. To fix this, we copy the logic from the crypto/ipsec_mb driver to actually do a link-check on the library before deciding it can be used.
--- drivers/common/qat/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/common/qat/meson.build +2 -1
@@ -43,7 +43,8 @@ else IMB_required_ver = '1.4.0' IMB_header = '#include<intel-ipsec-mb.h>' libipsecmb = cc.find_library('IPSec_MB', required: false) - if libipsecmb.found() + if libipsecmb.found() and meson.version().version_compare('>=0.60') and cc.links( + 'int main(void) {return 0;}', dependencies: libipsecmb) # version comes with quotes, so we split based on " and take the middle imb_ver = cc.get_define('IMB_VERSION_STR', prefix : IMB_header).split('"')[1]
Signature · 1 line
2.40.1
Quoted 36 lines
-----Original Message-----
From: Richardson, Bruce <[email protected]>
Sent: Wednesday, November 22, 2023 4:47 PM
To: [email protected]
Cc: Richardson, Bruce <[email protected]>; Dooley, Brian <[email protected]>; Ji, Kai <[email protected]>; De Lara Guarch, Pablo <[email protected]>; Power, Ciara <[email protected]>
Subject: [PATCH] common/qat: fix build errors with incompatible IPSec libSince "
find_library()" is used to find thelibipsec_mblibrary, there is a chance that an incompatible library will be found e.g. when doing cross-builds. To fix this, we copy the logic from thecrypto/ipsec_mbdriver to actually do a link- check on the library before deciding it can be used.Fixes ca0ba0e48129 ("crypto/qat: default to IPsec MB for computations")Signed-off-by Bruce Richardson <[email protected]>--- drivers/common/qat/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)(quoted diff) +0
-0b/drivers/common/qat/meson.build index
edc793ba95..5c36fbb270100644drivers/common/qat/meson.build +1
-1@@ -43,7 +43,8 @@ else IMB_required_ver = '1.4.0' IMB_header = '#include<intel-ipsec-mb.h>' libipsecmb = cc.find_library('IPSec_MB', required: false) - if libipsecmb.found() + if libipsecmb.found() and meson.version().version_compare('>=0.60') andcc.links(
+ 'int main(void) {return 0;}', dependencies: libipsecmb)
Quoted 5 lines
# version comes with quotes, so we split based on " and take the middle
imb_ver = cc.get_define('IMB_VERSION_STR',
prefix : IMB_header).split('"')[1]
--
2.40.1Thanks Bruce,
Thomas Monjalon
AppliedQuoted 10 lines
Quoted 9 lines
Since "
find_library()" is used to find thelibipsec_mblibrary, there is a chance that an incompatible library will be found e.g. when doing cross-builds. To fix this, we copy the logic from thecrypto/ipsec_mbdriver to actually do a link- check on the library before deciding it can be used.Fixes ca0ba0e48129 ("crypto/qat: default to IPsec MB for computations")Signed-off-by Bruce Richardson <[email protected]>Acked-by Ciara Power <[email protected]>
Applied, thanks.