Peter Robinson 2be348
From 2426c2a066e44f4d9a342585e76cdbdb0a8a2db1 Mon Sep 17 00:00:00 2001
Peter Robinson 2be348
From: Peter Robinson <pbrobinson@gmail.com>
Peter Robinson 2be348
Date: Wed, 23 Oct 2019 20:22:19 +0100
Peter Robinson 2be348
Subject: [PATCH] Revert "Improve ARM detection"
Peter Robinson 2be348
Peter Robinson 2be348
This reverts commit 8c3a7b8fa92b49a811fe36b60857b12f5d7db8a8.
Peter Robinson 2be348
Peter Robinson 2be348
This is the final piece in fixing rhbz 1691430. It's a clean revert
Peter Robinson 2be348
so let's do that for F-31 and we can discuss the details later.
Peter Robinson 2be348
Peter Robinson 2be348
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Peter Robinson 2be348
---
Peter Robinson 2be348
 lib/rpmrc.c | 37 +++++++++----------------------------
Peter Robinson 2be348
 1 file changed, 9 insertions(+), 28 deletions(-)
Peter Robinson 2be348
Peter Robinson 2be348
diff --git a/lib/rpmrc.c b/lib/rpmrc.c
Peter Robinson 2be348
index 0806e1b07..cada3f788 100644
Peter Robinson 2be348
--- a/lib/rpmrc.c
Peter Robinson 2be348
+++ b/lib/rpmrc.c
Peter Robinson 2be348
@@ -82,7 +82,6 @@ struct rpmOption {
Peter Robinson 2be348
 static struct rpmat_s {
Peter Robinson 2be348
     const char *platform;
Peter Robinson 2be348
     uint64_t hwcap;
Peter Robinson 2be348
-    uint64_t hwcap2;
Peter Robinson 2be348
 } rpmat;
Peter Robinson 2be348
 
Peter Robinson 2be348
 typedef struct defaultEntry_s {
Peter Robinson 2be348
@@ -951,9 +950,6 @@ static int is_geode(void)
Peter Robinson 2be348
 
Peter Robinson 2be348
 
Peter Robinson 2be348
 #if defined(__linux__)
Peter Robinson 2be348
-#ifndef AT_HWCAP2 /* glibc < 2.18 */
Peter Robinson 2be348
-#define AT_HWCAP2 26
Peter Robinson 2be348
-#endif
Peter Robinson 2be348
 /**
Peter Robinson 2be348
  * Populate rpmat structure with auxv values
Peter Robinson 2be348
  */
Peter Robinson 2be348
@@ -967,7 +963,6 @@ static void read_auxv(void)
Peter Robinson 2be348
 	if (!rpmat.platform)
Peter Robinson 2be348
 	    rpmat.platform = "";
Peter Robinson 2be348
 	rpmat.hwcap = getauxval(AT_HWCAP);
Peter Robinson 2be348
-	rpmat.hwcap2 = getauxval(AT_HWCAP2);
Peter Robinson 2be348
 #else
Peter Robinson 2be348
 	rpmat.platform = "";
Peter Robinson 2be348
 	int fd = open("/proc/self/auxv", O_RDONLY);
Peter Robinson 2be348
@@ -989,9 +984,6 @@ static void read_auxv(void)
Peter Robinson 2be348
                     case AT_HWCAP:
Peter Robinson 2be348
                         rpmat.hwcap = auxv.a_un.a_val;
Peter Robinson 2be348
                         break;
Peter Robinson 2be348
-		    case AT_HWCAP2:
Peter Robinson 2be348
-			rpmat.hwcap2 = auxv.a_un.a_val;
Peter Robinson 2be348
-			break;
Peter Robinson 2be348
                 }
Peter Robinson 2be348
 	    }
Peter Robinson 2be348
 	    close(fd);
Peter Robinson 2be348
@@ -1225,27 +1217,16 @@ static void defaultMachine(rpmrcCtx ctx, const char ** arch, const char ** os)
Peter Robinson 2be348
 #	if !defined(HWCAP_ARM_VFPv3)
Peter Robinson 2be348
 #	    define HWCAP_ARM_VFPv3	(1 << 13)
Peter Robinson 2be348
 #	endif
Peter Robinson 2be348
-#	if !defined(HWCAP2_AES)
Peter Robinson 2be348
-#	    define HWCAP2_AES		(1 << 0)
Peter Robinson 2be348
-#	endif
Peter Robinson 2be348
-	/*
Peter Robinson 2be348
-	 * un.machine is armvXE, where X is version number and E is
Peter Robinson 2be348
-	 * endianness (b or l)
Peter Robinson 2be348
-	 */
Peter Robinson 2be348
-	if (rstreqn(un.machine, "armv", 4)) {
Peter Robinson 2be348
-		char endian = un.machine[strlen(un.machine)-1];
Peter Robinson 2be348
-		char *modifier = un.machine + 5;
Peter Robinson 2be348
-		/* keep armv7, armv8, armv9, armv10, ... */
Peter Robinson 2be348
-		while(risdigit(*modifier)) 
Peter Robinson 2be348
-			modifier++;
Peter Robinson 2be348
-		if (rpmat.hwcap & HWCAP_ARM_VFPv3)
Peter Robinson 2be348
-			*modifier++ = 'h';
Peter Robinson 2be348
-		if (rpmat.hwcap2 & HWCAP2_AES)
Peter Robinson 2be348
-			*modifier++ = 'c';
Peter Robinson 2be348
+	if (rstreq(un.machine, "armv7l")) {
Peter Robinson 2be348
+	    if (rpmat.hwcap & HWCAP_ARM_VFPv3) {
Peter Robinson 2be348
 		if (rpmat.hwcap & HWCAP_ARM_NEON)
Peter Robinson 2be348
-			*modifier++ = 'n';
Peter Robinson 2be348
-		*modifier++ = endian;
Peter Robinson 2be348
-		*modifier++ = 0;
Peter Robinson 2be348
+		    strcpy(un.machine, "armv7hnl");
Peter Robinson 2be348
+		else
Peter Robinson 2be348
+		    strcpy(un.machine, "armv7hl");
Peter Robinson 2be348
+	    }
Peter Robinson 2be348
+	} else if (rstreq(un.machine, "armv6l")) {
Peter Robinson 2be348
+	    if (rpmat.hwcap & HWCAP_ARM_VFP)
Peter Robinson 2be348
+		strcpy(un.machine, "armv6hl");
Peter Robinson 2be348
 	}
Peter Robinson 2be348
 #	endif	/* arm*-linux */
Peter Robinson 2be348
 
Peter Robinson 2be348
-- 
Peter Robinson 2be348
2.23.0
Peter Robinson 2be348