Re: [OE-core] [PATCH 3/4] nss: Pass NSS_USE_ARM_HW_CRYPTO as define in CFLAGS

2020-01-26 Thread Martin Jansa
On Thu, Jan 23, 2020 at 12:00:40PM -0800, Khem Raj wrote:
> Use NSS_USE_ARM_HW_CRYPTO to detect USE_ARM_GCM, since there are
> dependent, without this we control the crypto code function inclusion in
> build but do not control the call sites, which can result in undefined
> symbols e.g.
> 
> Linux_SINGLE_SHLIB/gcm.o: in function `gcmHash_InitContext':
> /usr/src/debug/nss/3.49.1-r0/nss-3.49.1/nss/lib/freebl/gcm.c:112: undefined 
> reference to `gcm_HashInit_hw'

Fixes the errors I'm seeing since nss upgrade, thanks!

Acked-by: Martin Jansa 

> 
> Signed-off-by: Khem Raj 
> ---
>  ...figure-option-to-disable-ARM-HW-cryp.patch | 25 ---
>  1 file changed, 21 insertions(+), 4 deletions(-)
> 
> diff --git 
> a/meta/recipes-support/nss/nss/0001-freebl-add-a-configure-option-to-disable-ARM-HW-cryp.patch
>  
> b/meta/recipes-support/nss/nss/0001-freebl-add-a-configure-option-to-disable-ARM-HW-cryp.patch
> index fe29d19882..803c06b218 100644
> --- 
> a/meta/recipes-support/nss/nss/0001-freebl-add-a-configure-option-to-disable-ARM-HW-cryp.patch
> +++ 
> b/meta/recipes-support/nss/nss/0001-freebl-add-a-configure-option-to-disable-ARM-HW-cryp.patch
> @@ -12,20 +12,19 @@ Signed-off-by: Alexander Kanavin 
>   nss/lib/freebl/Makefile | 3 +++
>   1 file changed, 3 insertions(+)
>  
> -diff --git a/nss/lib/freebl/Makefile b/nss/lib/freebl/Makefile
> -index 06506f0..a8b015d 100644
>  --- a/nss/lib/freebl/Makefile
>  +++ b/nss/lib/freebl/Makefile
> -@@ -125,6 +125,8 @@ else
> +@@ -125,6 +125,9 @@ else
>   DEFINES += -DNSS_X86
>   endif
>   endif
>  +
>  +ifdef NSS_USE_ARM_HW_CRYPTO
> ++DEFINES += -DNSS_USE_ARM_HW_CRYPTO
>   ifeq ($(CPU_ARCH),aarch64)
>   DEFINES += -DUSE_HW_AES
>   EXTRA_SRCS += aes-armv8.c gcm-aarch64.c
> -@@ -145,6 +147,7 @@ ifeq ($(CPU_ARCH),arm)
> +@@ -146,6 +149,7 @@ ifeq ($(CPU_ARCH),arm)
>   endif
>   endif
>   endif
> @@ -33,3 +32,21 @@ index 06506f0..a8b015d 100644
>   
>   ifeq ($(OS_TARGET),OSF1)
>   DEFINES += -DMP_ASSEMBLY_MULTIPLY -DMP_NO_MP_WORD
> +--- a/nss/lib/freebl/gcm.c
>  b/nss/lib/freebl/gcm.c
> +@@ -17,6 +17,7 @@
> + 
> + #include 
> + 
> ++#ifdef NSS_USE_ARM_HW_CRYPTO
> + /* old gcc doesn't support some poly64x2_t intrinsic */
> + #if defined(__aarch64__) && defined(IS_LITTLE_ENDIAN) && \
> + (defined(__clang__) || defined(__GNUC__) && __GNUC__ > 6)
> +@@ -28,6 +29,7 @@
> +  * that compiler uses -mfpu=neon only. */
> + #define USE_ARM_GCM
> + #endif
> ++#endif
> + 
> + /* Forward declarations */
> + SECStatus gcm_HashInit_hw(gcmHashContext *ghash);
> -- 
> 2.25.0
> 
> -- 
> ___
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


signature.asc
Description: PGP signature
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 3/4] nss: Pass NSS_USE_ARM_HW_CRYPTO as define in CFLAGS

2020-01-23 Thread Khem Raj
Use NSS_USE_ARM_HW_CRYPTO to detect USE_ARM_GCM, since there are
dependent, without this we control the crypto code function inclusion in
build but do not control the call sites, which can result in undefined
symbols e.g.

Linux_SINGLE_SHLIB/gcm.o: in function `gcmHash_InitContext':
/usr/src/debug/nss/3.49.1-r0/nss-3.49.1/nss/lib/freebl/gcm.c:112: undefined 
reference to `gcm_HashInit_hw'

Signed-off-by: Khem Raj 
---
 ...figure-option-to-disable-ARM-HW-cryp.patch | 25 ---
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git 
a/meta/recipes-support/nss/nss/0001-freebl-add-a-configure-option-to-disable-ARM-HW-cryp.patch
 
b/meta/recipes-support/nss/nss/0001-freebl-add-a-configure-option-to-disable-ARM-HW-cryp.patch
index fe29d19882..803c06b218 100644
--- 
a/meta/recipes-support/nss/nss/0001-freebl-add-a-configure-option-to-disable-ARM-HW-cryp.patch
+++ 
b/meta/recipes-support/nss/nss/0001-freebl-add-a-configure-option-to-disable-ARM-HW-cryp.patch
@@ -12,20 +12,19 @@ Signed-off-by: Alexander Kanavin 
  nss/lib/freebl/Makefile | 3 +++
  1 file changed, 3 insertions(+)
 
-diff --git a/nss/lib/freebl/Makefile b/nss/lib/freebl/Makefile
-index 06506f0..a8b015d 100644
 --- a/nss/lib/freebl/Makefile
 +++ b/nss/lib/freebl/Makefile
-@@ -125,6 +125,8 @@ else
+@@ -125,6 +125,9 @@ else
  DEFINES += -DNSS_X86
  endif
  endif
 +
 +ifdef NSS_USE_ARM_HW_CRYPTO
++DEFINES += -DNSS_USE_ARM_HW_CRYPTO
  ifeq ($(CPU_ARCH),aarch64)
  DEFINES += -DUSE_HW_AES
  EXTRA_SRCS += aes-armv8.c gcm-aarch64.c
-@@ -145,6 +147,7 @@ ifeq ($(CPU_ARCH),arm)
+@@ -146,6 +149,7 @@ ifeq ($(CPU_ARCH),arm)
  endif
  endif
  endif
@@ -33,3 +32,21 @@ index 06506f0..a8b015d 100644
  
  ifeq ($(OS_TARGET),OSF1)
  DEFINES += -DMP_ASSEMBLY_MULTIPLY -DMP_NO_MP_WORD
+--- a/nss/lib/freebl/gcm.c
 b/nss/lib/freebl/gcm.c
+@@ -17,6 +17,7 @@
+ 
+ #include 
+ 
++#ifdef NSS_USE_ARM_HW_CRYPTO
+ /* old gcc doesn't support some poly64x2_t intrinsic */
+ #if defined(__aarch64__) && defined(IS_LITTLE_ENDIAN) && \
+ (defined(__clang__) || defined(__GNUC__) && __GNUC__ > 6)
+@@ -28,6 +29,7 @@
+  * that compiler uses -mfpu=neon only. */
+ #define USE_ARM_GCM
+ #endif
++#endif
+ 
+ /* Forward declarations */
+ SECStatus gcm_HashInit_hw(gcmHashContext *ghash);
-- 
2.25.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core