From 84b46c9c654d23d11a5848a6fe44cca37da2b49d Mon Sep 17 00:00:00 2001 From: Chenxi Mao Date: Thu, 8 Jun 2023 09:53:17 +0800 Subject: [PATCH 1/2] Try to fix build error Change-Id: Ic7c2f53f0ef651c57ab46ed6cfa9c19d4f68f13f --- ...ing-about-signed-unsigned-conversion.patch | 25 +++++++++++++++++++ ...-warning-about-truncating-conversion.patch | 25 +++++++++++++++++++ libxcrypt.spec | 2 ++ 3 files changed, 52 insertions(+) create mode 100644 0001-Fix-warning-about-signed-unsigned-conversion.patch create mode 100644 0001-Fix-warning-about-truncating-conversion.patch diff --git a/0001-Fix-warning-about-signed-unsigned-conversion.patch b/0001-Fix-warning-about-signed-unsigned-conversion.patch new file mode 100644 index 0000000..5c45ddb --- /dev/null +++ b/0001-Fix-warning-about-signed-unsigned-conversion.patch @@ -0,0 +1,25 @@ +From 17cf4ce8af5a2a1af4c0f52260019cbae01835b8 Mon Sep 17 00:00:00 2001 +From: Moinak Bhattacharyya +Date: Tue, 8 Nov 2022 04:37:13 -0600 +Subject: [PATCH 1/1] Fix warning about signed->unsigned conversion + +--- + lib/alg-yescrypt-opt.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/alg-yescrypt-opt.c b/lib/alg-yescrypt-opt.c +index dacc73b..a33c6e4 100644 +--- a/lib/alg-yescrypt-opt.c ++++ b/lib/alg-yescrypt-opt.c +@@ -514,7 +514,7 @@ static volatile uint64_t Smask2var = Smask2; + #define PWXFORM_SIMD(X) { \ + uint64_t x; \ + FORCE_REGALLOC_1 \ +- uint32_t lo = (uint32_t)(x = EXTRACT64(X) & Smask2reg); \ ++ uint32_t lo = (uint32_t)(x = ((uint64_t)EXTRACT64(X)) & Smask2reg); \ + FORCE_REGALLOC_2 \ + uint32_t hi = x >> 32; \ + X = _mm_mul_epu32(HI32(X), X); \ +-- +2.33.0 + diff --git a/0001-Fix-warning-about-truncating-conversion.patch b/0001-Fix-warning-about-truncating-conversion.patch new file mode 100644 index 0000000..5dfe238 --- /dev/null +++ b/0001-Fix-warning-about-truncating-conversion.patch @@ -0,0 +1,25 @@ +From 239664bf18fc2bc093d8dbaa1fb0a0307651897f Mon Sep 17 00:00:00 2001 +From: Moinak Bhattacharyya +Date: Mon, 7 Nov 2022 03:40:23 -0600 +Subject: [PATCH 1/1] Fix warning about truncating conversion + +--- + lib/alg-yescrypt-opt.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/alg-yescrypt-opt.c b/lib/alg-yescrypt-opt.c +index 60a6ccd..dacc73b 100644 +--- a/lib/alg-yescrypt-opt.c ++++ b/lib/alg-yescrypt-opt.c +@@ -514,7 +514,7 @@ static volatile uint64_t Smask2var = Smask2; + #define PWXFORM_SIMD(X) { \ + uint64_t x; \ + FORCE_REGALLOC_1 \ +- uint32_t lo = x = EXTRACT64(X) & Smask2reg; \ ++ uint32_t lo = (uint32_t)(x = EXTRACT64(X) & Smask2reg); \ + FORCE_REGALLOC_2 \ + uint32_t hi = x >> 32; \ + X = _mm_mul_epu32(HI32(X), X); \ +-- +2.33.0 + diff --git a/libxcrypt.spec b/libxcrypt.spec index 4ac85b9..44e8281 100644 --- a/libxcrypt.spec +++ b/libxcrypt.spec @@ -13,6 +13,8 @@ Source0: https://github.com/besser82/%{name}/archive/v%{version}.tar.gz Patch9000: add-sm3-crypt-support.patch Patch9001: libxcrypt-4.4.26-sw.patch +Patch9002: 0001-Fix-warning-about-truncating-conversion.patch +Patch9003: 0001-Fix-warning-about-signed-unsigned-conversion.patch BuildRequires: autoconf libtool fipscheck BuildRequires: perl >= 5.14.0 -- Gitee From f2064152946c65e332d1ed0fbea0f67942966b69 Mon Sep 17 00:00:00 2001 From: Chenxi Mao Date: Fri, 9 Jun 2023 15:31:44 +0800 Subject: [PATCH 2/2] Fix build error if AVX2 enabled Below build error found if AVX2 enabled: [ 17s] lib/alg-yescrypt-opt.c:517:33: error: conversion to 'long long unsigned int' from 'long long int' may change the sign of the result [-Werror=sign-conversion] [ 17s] 517 | uint32_t lo = x = EXTRACT64(X) & Smask2reg; \ Cherry pick upstream patches to fix this error. Signed-off-by: Chenxi Mao --- libxcrypt.spec | 9 ++++++--- ...am-Fix-warning-about-signed-unsigned-conversion.patch | 0 ...pstream-Fix-warning-about-truncating-conversion.patch | 0 3 files changed, 6 insertions(+), 3 deletions(-) rename 0001-Fix-warning-about-signed-unsigned-conversion.patch => upstream-Fix-warning-about-signed-unsigned-conversion.patch (100%) rename 0001-Fix-warning-about-truncating-conversion.patch => upstream-Fix-warning-about-truncating-conversion.patch (100%) diff --git a/libxcrypt.spec b/libxcrypt.spec index 44e8281..501dd27 100644 --- a/libxcrypt.spec +++ b/libxcrypt.spec @@ -5,7 +5,7 @@ %endif Name: libxcrypt Version: 4.4.26 -Release: 4 +Release: 5 Summary: Extended crypt library for DES, MD5, Blowfish and others License: LGPLv2+ and BSD and Public Domain URL: https://github.com/besser82/%{name} @@ -13,8 +13,8 @@ Source0: https://github.com/besser82/%{name}/archive/v%{version}.tar.gz Patch9000: add-sm3-crypt-support.patch Patch9001: libxcrypt-4.4.26-sw.patch -Patch9002: 0001-Fix-warning-about-truncating-conversion.patch -Patch9003: 0001-Fix-warning-about-signed-unsigned-conversion.patch +Patch9002: upstream-Fix-warning-about-truncating-conversion.patch +Patch9003: upstream-Fix-warning-about-signed-unsigned-conversion.patch BuildRequires: autoconf libtool fipscheck BuildRequires: perl >= 5.14.0 @@ -108,6 +108,9 @@ autoreconf -fiv %changelog +* Fri Jun 9 2023 Chenxi Mao - 4.4.26-5 +- Cherry pick upstream patches to fix build errors if avx2 enabled. + * Fri Oct 21 2022 wuzx - 4.4.26-4 - add sw64 patch diff --git a/0001-Fix-warning-about-signed-unsigned-conversion.patch b/upstream-Fix-warning-about-signed-unsigned-conversion.patch similarity index 100% rename from 0001-Fix-warning-about-signed-unsigned-conversion.patch rename to upstream-Fix-warning-about-signed-unsigned-conversion.patch diff --git a/0001-Fix-warning-about-truncating-conversion.patch b/upstream-Fix-warning-about-truncating-conversion.patch similarity index 100% rename from 0001-Fix-warning-about-truncating-conversion.patch rename to upstream-Fix-warning-about-truncating-conversion.patch -- Gitee