[dpdk-dev,v3] crypto/openssl: add openssl path for cross compile

Message ID 20170905090251.4229-1-akhil.goyal@nxp.com (mailing list archive)
State Rejected, archived
Delegated to: Pablo de Lara Guarch
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Akhil Goyal Sept. 5, 2017, 9:02 a.m. UTC
  OPENSSL_PATH should be defined in case openssl
driver is cross compiled

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
---
changes in v3:
make OPENSSL_PATH usage conditional if it is not set as suggested by Pablo
 doc/guides/cryptodevs/openssl.rst | 4 ++++
 drivers/crypto/openssl/Makefile   | 7 +++++++
 mk/rte.app.mk                     | 4 ++++
 3 files changed, 15 insertions(+)
  

Comments

De Lara Guarch, Pablo Sept. 6, 2017, 9:26 a.m. UTC | #1
> -----Original Message-----
> From: Akhil Goyal [mailto:akhil.goyal@nxp.com]
> Sent: Tuesday, September 5, 2017 10:03 AM
> To: dev@dpdk.org; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>
> Cc: hemant.agrawal@nxp.com; Doherty, Declan
> <declan.doherty@intel.com>; Akhil Goyal <akhil.goyal@nxp.com>
> Subject: [PATCH v3] crypto/openssl: add openssl path for cross compile
> 
> OPENSSL_PATH should be defined in case openssl driver is cross compiled
> 
> Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>

Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
  
De Lara Guarch, Pablo Sept. 6, 2017, 10:15 a.m. UTC | #2
> -----Original Message-----
> From: De Lara Guarch, Pablo
> Sent: Wednesday, September 6, 2017 10:27 AM
> To: 'Akhil Goyal' <akhil.goyal@nxp.com>; dev@dpdk.org
> Cc: hemant.agrawal@nxp.com; Doherty, Declan
> <declan.doherty@intel.com>
> Subject: RE: [PATCH v3] crypto/openssl: add openssl path for cross compile
> 
> 
> 
> > -----Original Message-----
> > From: Akhil Goyal [mailto:akhil.goyal@nxp.com]
> > Sent: Tuesday, September 5, 2017 10:03 AM
> > To: dev@dpdk.org; De Lara Guarch, Pablo
> > <pablo.de.lara.guarch@intel.com>
> > Cc: hemant.agrawal@nxp.com; Doherty, Declan
> > <declan.doherty@intel.com>; Akhil Goyal <akhil.goyal@nxp.com>
> > Subject: [PATCH v3] crypto/openssl: add openssl path for cross compile
> >
> > OPENSSL_PATH should be defined in case openssl driver is cross
> > compiled
> >
> > Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
> 
> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

Applied to dpdk-next-crypto.
Thanks,

Pablo
  
Thomas Monjalon Oct. 12, 2017, 1:06 p.m. UTC | #3
05/09/2017 11:02, Akhil Goyal:
> OPENSSL_PATH should be defined in case openssl
> driver is cross compiled

No: in case OpenSSL cannot be found automatically,
you should use EXTRA_CFLAGS and EXTRA_LDFLAGS.

It is the same for other standard dependencies like
libnuma, libpcap, libzip, etc.
  
Hemant Agrawal Oct. 12, 2017, 1:31 p.m. UTC | #4
On 10/12/2017 6:36 PM, Thomas Monjalon wrote:
> 05/09/2017 11:02, Akhil Goyal:
>> OPENSSL_PATH should be defined in case openssl
>> driver is cross compiled
>
> No: in case OpenSSL cannot be found automatically,
> you should use EXTRA_CFLAGS and EXTRA_LDFLAGS.
>
> It is the same for other standard dependencies like
> libnuma, libpcap, libzip, etc.
>
Pablo/Thomas,
	We are ok to drop this patch.

Regards,
Hemant
  
Thomas Monjalon Oct. 12, 2017, 1:34 p.m. UTC | #5
12/10/2017 15:31, Hemant Agrawal:
> On 10/12/2017 6:36 PM, Thomas Monjalon wrote:
> > 05/09/2017 11:02, Akhil Goyal:
> >> OPENSSL_PATH should be defined in case openssl
> >> driver is cross compiled
> >
> > No: in case OpenSSL cannot be found automatically,
> > you should use EXTRA_CFLAGS and EXTRA_LDFLAGS.
> >
> > It is the same for other standard dependencies like
> > libnuma, libpcap, libzip, etc.
> >
> Pablo/Thomas,
> 	We are ok to drop this patch.

OK, thanks a lot for confirming. Appreciated
  

Patch

diff --git a/doc/guides/cryptodevs/openssl.rst b/doc/guides/cryptodevs/openssl.rst
index f18a456..08cc9ba 100644
--- a/doc/guides/cryptodevs/openssl.rst
+++ b/doc/guides/cryptodevs/openssl.rst
@@ -88,6 +88,10 @@  sudo apt-get install libc6-dev-i386 (for i686-native-linuxapp-gcc target)
 This code was also verified on Fedora 24.
 This code was NOT yet verified on FreeBSD.
 
+In case openssl is cross compiled, openssl can be installed separately
+and path for openssl install directory can be given as
+export OPENSSL_PATH=<openssl install dir>
+
 Initialization
 --------------
 
diff --git a/drivers/crypto/openssl/Makefile b/drivers/crypto/openssl/Makefile
index e5fdfb5..a6f13e0 100644
--- a/drivers/crypto/openssl/Makefile
+++ b/drivers/crypto/openssl/Makefile
@@ -35,6 +35,9 @@  LIB = librte_pmd_openssl.a
 
 # build flags
 CFLAGS += -O3
+ifneq ($(OPENSSL_PATH),)
+CFLAGS += -I${OPENSSL_PATH}/include/
+endif
 CFLAGS += $(WERROR_FLAGS)
 
 # library version
@@ -44,7 +47,11 @@  LIBABIVER := 1
 EXPORT_MAP := rte_pmd_openssl_version.map
 
 # external library dependencies
+ifneq ($(OPENSSL_PATH),)
+LDLIBS += -L${OPENSSL_PATH}/lib/ -lcrypto
+else
 LDLIBS += -lcrypto
+endif
 
 # library source files
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_OPENSSL) += rte_openssl_pmd.c
diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index c25fdd9..799aa99 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -151,7 +151,11 @@  _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB)    += -lrte_pmd_aesni_mb
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB)    += -L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM)   += -lrte_pmd_aesni_gcm
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM)   += -L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB
+ifeq ($(OPENSSL_PATH),)
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_OPENSSL)     += -lrte_pmd_openssl -lcrypto
+else
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_OPENSSL)     += -L${OPENSSL_PATH}/lib -lrte_pmd_openssl -lcrypto
+endif # ($(OPENSSL_PATH),)
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += -lrte_pmd_null_crypto
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_QAT)         += -lrte_pmd_qat -lcrypto
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SNOW3G)      += -lrte_pmd_snow3g