[v2] drivers/crypto: fix build with make 4.3

Message ID 20200228132547.650594-1-thomas@monjalon.net (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series [v2] drivers/crypto: fix build with make 4.3 |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/travis-robot success Travis build: passed

Commit Message

Thomas Monjalon Feb. 28, 2020, 1:25 p.m. UTC
  In the check for the version of intel-ipsec-mb library,
there is a backslash in front of the #include.
This backslash is for escaping the hash sign parsed as
a number sign in make.

Since make-4.3, escaping is not required for the number sign.
As a consequence, it resolves now to '\#':

syntax error near unexpected token `|'
`grep -e "IMB_VERSION_STR" \#include <intel-ipsec-mb.h> | cut -d'"' -f2'
syntax error near unexpected token `|'
`grep -e "IMB_VERSION_NUM" \#include <intel-ipsec-mb.h> | cut -d' ' -f3'

The makefiles are fixed by using a variable for the hash sign,
as recommended in make-4.3 changelog:
	https://lists.gnu.org/archive/html/info-gnu/2020-01/msg00004.html

Fixes: 3067c8ce77ac ("crypto/aesni_mb: fix build with custom dependency path")
Fixes: 457b8e372975 ("crypto/aesni_gcm: check dependency version with make")
Fixes: bf6eb2c22fd1 ("crypto/kasumi: use IPsec library")
Fixes: 7c87e2d7b359 ("crypto/snow3g: use IPsec library")
Fixes: 61f7c988e39e ("crypto/zuc: use IPsec library")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---

v2:
- found the root cause in make-4.3
- use $H for compatibility with make < 4.3

Note the list of "Fixes" references are here to help backporting,
even if there was no bug before the recent release of make-4.3.

---
 drivers/crypto/aesni_gcm/Makefile | 3 ++-
 drivers/crypto/aesni_mb/Makefile  | 3 ++-
 drivers/crypto/kasumi/Makefile    | 3 ++-
 drivers/crypto/snow3g/Makefile    | 3 ++-
 drivers/crypto/zuc/Makefile       | 3 ++-
 5 files changed, 10 insertions(+), 5 deletions(-)
  

Comments

Thomas Monjalon March 12, 2020, 8:05 a.m. UTC | #1
28/02/2020 14:25, Thomas Monjalon:
> In the check for the version of intel-ipsec-mb library,
> there is a backslash in front of the #include.
> This backslash is for escaping the hash sign parsed as
> a number sign in make.
> 
> Since make-4.3, escaping is not required for the number sign.
> As a consequence, it resolves now to '\#':
> 
> syntax error near unexpected token `|'
> `grep -e "IMB_VERSION_STR" \#include <intel-ipsec-mb.h> | cut -d'"' -f2'
> syntax error near unexpected token `|'
> `grep -e "IMB_VERSION_NUM" \#include <intel-ipsec-mb.h> | cut -d' ' -f3'
> 
> The makefiles are fixed by using a variable for the hash sign,
> as recommended in make-4.3 changelog:
> 	https://lists.gnu.org/archive/html/info-gnu/2020-01/msg00004.html
> 
> Fixes: 3067c8ce77ac ("crypto/aesni_mb: fix build with custom dependency path")
> Fixes: 457b8e372975 ("crypto/aesni_gcm: check dependency version with make")
> Fixes: bf6eb2c22fd1 ("crypto/kasumi: use IPsec library")
> Fixes: 7c87e2d7b359 ("crypto/snow3g: use IPsec library")
> Fixes: 61f7c988e39e ("crypto/zuc: use IPsec library")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
> 
> v2:
> - found the root cause in make-4.3
> - use $H for compatibility with make < 4.3
> 
> Note the list of "Fixes" references are here to help backporting,
> even if there was no bug before the recent release of make-4.3.

I was expecting some reviews and a merge in the crypto tree.
Given it is blocking me to merge any other patch,
after waiting 2 weeks,
Applied in master branch.
  

Patch

diff --git a/drivers/crypto/aesni_gcm/Makefile b/drivers/crypto/aesni_gcm/Makefile
index d8190a2ff4..b443167d51 100644
--- a/drivers/crypto/aesni_gcm/Makefile
+++ b/drivers/crypto/aesni_gcm/Makefile
@@ -20,7 +20,8 @@  LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
 LDLIBS += -lrte_cryptodev
 LDLIBS += -lrte_bus_vdev
 
-IMB_HDR = $(shell echo '\#include <intel-ipsec-mb.h>' | \
+H := \#
+IMB_HDR = $(shell echo '$Hinclude <intel-ipsec-mb.h>' | \
 	$(CC) -E $(EXTRA_CFLAGS) - | grep 'intel-ipsec-mb.h' | \
 	head -n1 | cut -d'"' -f2)
 
diff --git a/drivers/crypto/aesni_mb/Makefile b/drivers/crypto/aesni_mb/Makefile
index f1530e74c4..aa2e428106 100644
--- a/drivers/crypto/aesni_mb/Makefile
+++ b/drivers/crypto/aesni_mb/Makefile
@@ -20,7 +20,8 @@  LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
 LDLIBS += -lrte_cryptodev
 LDLIBS += -lrte_bus_vdev
 
-IMB_HDR = $(shell echo '\#include <intel-ipsec-mb.h>' | \
+H := \#
+IMB_HDR = $(shell echo '$Hinclude <intel-ipsec-mb.h>' | \
 	$(CC) -E $(EXTRA_CFLAGS) - | grep 'intel-ipsec-mb.h' | \
 	head -n1 | cut -d'"' -f2)
 
diff --git a/drivers/crypto/kasumi/Makefile b/drivers/crypto/kasumi/Makefile
index c94d6bdcf9..ad19aad11c 100644
--- a/drivers/crypto/kasumi/Makefile
+++ b/drivers/crypto/kasumi/Makefile
@@ -20,7 +20,8 @@  LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
 LDLIBS += -lrte_cryptodev
 LDLIBS += -lrte_bus_vdev
 
-IMB_HDR = $(shell echo '\#include <intel-ipsec-mb.h>' | \
+H := \#
+IMB_HDR = $(shell echo '$Hinclude <intel-ipsec-mb.h>' | \
 	$(CC) -E $(EXTRA_CFLAGS) - | grep 'intel-ipsec-mb.h' | \
 	head -n1 | cut -d'"' -f2)
 
diff --git a/drivers/crypto/snow3g/Makefile b/drivers/crypto/snow3g/Makefile
index 438119c3d5..cbf1a77904 100644
--- a/drivers/crypto/snow3g/Makefile
+++ b/drivers/crypto/snow3g/Makefile
@@ -20,7 +20,8 @@  LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
 LDLIBS += -lrte_cryptodev
 LDLIBS += -lrte_bus_vdev
 
-IMB_HDR = $(shell echo '\#include <intel-ipsec-mb.h>' | \
+H := \#
+IMB_HDR = $(shell echo '$Hinclude <intel-ipsec-mb.h>' | \
 	$(CC) -E $(EXTRA_CFLAGS) - | grep 'intel-ipsec-mb.h' | \
 	head -n1 | cut -d'"' -f2)
 
diff --git a/drivers/crypto/zuc/Makefile b/drivers/crypto/zuc/Makefile
index b50883b2a7..1875344472 100644
--- a/drivers/crypto/zuc/Makefile
+++ b/drivers/crypto/zuc/Makefile
@@ -20,7 +20,8 @@  LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
 LDLIBS += -lrte_cryptodev
 LDLIBS += -lrte_bus_vdev
 
-IMB_HDR = $(shell echo '\#include <intel-ipsec-mb.h>' | \
+H := \#
+IMB_HDR = $(shell echo '$Hinclude <intel-ipsec-mb.h>' | \
 	$(CC) -E $(EXTRA_CFLAGS) - | grep 'intel-ipsec-mb.h' | \
 	head -n1 | cut -d'"' -f2)