chantra / rpms / libdnf

Forked from rpms/libdnf 2 years ago
Clone

Blame SOURCES/6c4f7462b3004e39e82c4ec186175ea4a56035b4.patch

Pablo Greco cb7e6e
From 6c4f7462b3004e39e82c4ec186175ea4a56035b4 Mon Sep 17 00:00:00 2001
Pablo Greco cb7e6e
From: Jaroslav Rohel <jrohel@redhat.com>
Pablo Greco cb7e6e
Date: Fri, 9 Aug 2019 09:54:49 +0200
Pablo Greco cb7e6e
Subject: [PATCH] hy_detect_arch(): detect crypto only on arm version >= 8
Pablo Greco cb7e6e
Pablo Greco cb7e6e
Before patch:
Pablo Greco cb7e6e
It detected armv7 with crypto extension on some "qemu-arm"
Pablo Greco cb7e6e
configurations. New architecture string "armv7hcnl" was generated.
Pablo Greco cb7e6e
Pablo Greco cb7e6e
After patch:
Pablo Greco cb7e6e
It detect crypto extension only if arm version >= 8.
Pablo Greco cb7e6e
Pablo Greco cb7e6e
https://bugzilla.redhat.com/show_bug.cgi?id=1691430
Pablo Greco cb7e6e
Pablo Greco cb7e6e
Closes: #771
Pablo Greco cb7e6e
Approved by: dmach
Pablo Greco cb7e6e
---
Pablo Greco cb7e6e
 libdnf/hy-util.cpp | 3 ++-
Pablo Greco cb7e6e
 1 file changed, 2 insertions(+), 1 deletion(-)
Pablo Greco cb7e6e
Pablo Greco cb7e6e
diff --git a/libdnf/hy-util.cpp b/libdnf/hy-util.cpp
Pablo Greco cb7e6e
index 61838cc36..f6de87d33 100644
Pablo Greco cb7e6e
--- a/libdnf/hy-util.cpp
Pablo Greco cb7e6e
+++ b/libdnf/hy-util.cpp
Pablo Greco cb7e6e
@@ -118,7 +118,8 @@ hy_detect_arch(char **arch)
Pablo Greco cb7e6e
             modifier++;
Pablo Greco cb7e6e
         if (getauxval(AT_HWCAP) & HWCAP_ARM_VFP)
Pablo Greco cb7e6e
             *modifier++ = 'h';
Pablo Greco cb7e6e
-        if (getauxval(AT_HWCAP2) & HWCAP2_AES)
Pablo Greco cb7e6e
+        // arm version >= 8 can have crypto extension
Pablo Greco cb7e6e
+        if ((atoi(un.machine+4) >= 8) && (getauxval(AT_HWCAP2) & HWCAP2_AES))
Pablo Greco cb7e6e
             *modifier++ = 'c';
Pablo Greco cb7e6e
         if (getauxval(AT_HWCAP) & HWCAP_ARM_NEON)
Pablo Greco cb7e6e
             *modifier++ = 'n';