[rpm/f15] only conditionally apply the armhfp logic code we do need the hfp macros everywhere

Dennis Gilmore ausil at fedoraproject.org
Wed Dec 21 16:41:07 UTC 2011


commit 586889ef7e5b62b48928907626dc58b983ed7dba
Author: Dennis Gilmore <dennis at ausil.us>
Date:   Wed Dec 21 10:41:00 2011 -0600

    only conditionally apply the armhfp logic code we do need the hfp macros everywhere

 rpm-4.9.0-armhfp-logic.patch |   84 ++++++++++++++++++++++++++++++++++++++++++
 rpm-4.9.0-armhfp.patch       |   83 -----------------------------------------
 rpm.spec                     |   11 ++++-
 3 files changed, 92 insertions(+), 86 deletions(-)
---
diff --git a/rpm-4.9.0-armhfp-logic.patch b/rpm-4.9.0-armhfp-logic.patch
new file mode 100644
index 0000000..9cefb2f
--- /dev/null
+++ b/rpm-4.9.0-armhfp-logic.patch
@@ -0,0 +1,84 @@
+diff -uNr rpm-4.9.0-orig//lib/rpmrc.c rpm-4.9.0/lib/rpmrc.c
+--- rpm-4.9.0-orig//lib/rpmrc.c	2011-08-05 12:23:04.000000000 -0500
++++ rpm-4.9.0/lib/rpmrc.c	2011-08-05 12:25:13.000000000 -0500
+@@ -732,6 +732,56 @@
+ }
+ #endif
+ 
++#if defined(__linux__) && defined(__arm__)
++static int has_neon()
++{
++        char buffer[4096], *p;
++        int fd = open("/proc/cpuinfo", O_RDONLY);
++        if (read(fd, &buffer, sizeof(buffer) - 1) == -1) {
++                rpmlog(RPMLOG_WARNING, _("read(/proc/cpuinfo) failed\n"));
++                close(fd);
++                return 0;
++        }
++        close(fd);
++
++        p = strstr(buffer, "Features");
++        p = strtok(p, "\n");
++        p = strstr(p, "neon");
++        p = strtok(p, " ");
++        if (p == NULL) {
++                rpmlog(RPMLOG_WARNING, _("/proc/cpuinfo has no 'Features' line\n"));
++                return 0;
++        } else if (strcmp(p, "neon") == 0) {
++                return 1;
++        }
++        return 0;
++}
++
++static int has_hfp()
++{
++        char buffer[4096], *p;
++        int fd = open("/proc/cpuinfo", O_RDONLY);
++        if (read(fd, &buffer, sizeof(buffer) - 1) == -1) {
++                rpmlog(RPMLOG_WARNING, _("read(/proc/cpuinfo) failed\n"));
++                close(fd);
++                return 0;
++        }
++        close(fd);
++
++        p = strstr(buffer, "Features");
++        p = strtok(p, "\n");
++        p = strstr(p, "vfpv3");
++        p = strtok(p, " ");
++        if (p == NULL) {
++                rpmlog(RPMLOG_WARNING, _("/proc/cpuinfo has no 'Features' line\n"));
++                return 0;
++        } else if (strcmp(p, "vfpv3") == 0) {
++                return 1;
++        }
++        return 0;
++}
++#endif
++
+ 
+ #	if defined(__linux__) && defined(__i386__)
+ #include <setjmp.h>
+@@ -1157,6 +1207,22 @@
+ 	}
+ #	endif	/* sparc*-linux */
+ 
++#	if defined(__linux__) && defined(__arm__)
++	{
++	    if (strcmp(un.machine, "armv7l") == 0 ) {
++	        if (has_neon() && has_hfp())
++                    strcpy(un.machine, "armv7hnl");
++                else if (has_hfp())
++                    strcpy(un.machine, "armv7hl");
++	    } else if (strcmp(un.machine, "armv6l") == 0 ) {
++	        if (has_neon() && has_hfp())
++                    strcpy(un.machine, "armv6hnl");
++                else if (has_hfp())
++                    strcpy(un.machine, "armv6hl");
++	    }
++	}
++#	endif	/* arm*-linux */
++
+ #	if defined(__GNUC__) && defined(__alpha__)
+ 	{
+ 	    unsigned long amask, implver;
+
diff --git a/rpm-4.9.0-armhfp.patch b/rpm-4.9.0-armhfp.patch
index f31bbc6..03f171b 100644
--- a/rpm-4.9.0-armhfp.patch
+++ b/rpm-4.9.0-armhfp.patch
@@ -10,89 +10,6 @@ diff -uNr rpm-4.9.0-orig//installplatform rpm-4.9.0/installplatform
    sh4*) SUBSTS='s_sh4_sh4_ s_sh4_sh4a_' ;;
    sparc*) SUBSTS='s_sparc\(64\|64v\|v9v\|v9\)_sparc_ s_sparc64_sparcv9_;s_sparc\([^v]\|$\)_sparcv9\1_ s_sparcv9_sparc64_;s_sparc\([^6]\|$\)_sparc64\1_' ;;
    powerpc*|ppc*) SUBSTS='s_ppc64_ppc_ s_ppc\([^6ip]\|$\)_ppc64\1_ s_ppc\([^6ip]\|$\)_ppciseries_ s_ppc\([^6ip]\|$\)_ppcpseries_ s_ppc\([^6ip]\|$\)_ppc64iseries_ s_ppc\([^6ip]\|$\)_ppc64pseries_' ;;
-diff -uNr rpm-4.9.0-orig//lib/rpmrc.c rpm-4.9.0/lib/rpmrc.c
---- rpm-4.9.0-orig//lib/rpmrc.c	2011-08-05 12:23:04.000000000 -0500
-+++ rpm-4.9.0/lib/rpmrc.c	2011-08-05 12:25:13.000000000 -0500
-@@ -732,6 +732,56 @@
- }
- #endif
- 
-+#if defined(__linux__) && defined(__arm__)
-+static int has_neon()
-+{
-+        char buffer[4096], *p;
-+        int fd = open("/proc/cpuinfo", O_RDONLY);
-+        if (read(fd, &buffer, sizeof(buffer) - 1) == -1) {
-+                rpmlog(RPMLOG_WARNING, _("read(/proc/cpuinfo) failed\n"));
-+                close(fd);
-+                return 0;
-+        }
-+        close(fd);
-+
-+        p = strstr(buffer, "Features");
-+        p = strtok(p, "\n");
-+        p = strstr(p, "neon");
-+        p = strtok(p, " ");
-+        if (p == NULL) {
-+                rpmlog(RPMLOG_WARNING, _("/proc/cpuinfo has no 'Features' line\n"));
-+                return 0;
-+        } else if (strcmp(p, "neon") == 0) {
-+                return 1;
-+        }
-+        return 0;
-+}
-+
-+static int has_hfp()
-+{
-+        char buffer[4096], *p;
-+        int fd = open("/proc/cpuinfo", O_RDONLY);
-+        if (read(fd, &buffer, sizeof(buffer) - 1) == -1) {
-+                rpmlog(RPMLOG_WARNING, _("read(/proc/cpuinfo) failed\n"));
-+                close(fd);
-+                return 0;
-+        }
-+        close(fd);
-+
-+        p = strstr(buffer, "Features");
-+        p = strtok(p, "\n");
-+        p = strstr(p, "vfpv3");
-+        p = strtok(p, " ");
-+        if (p == NULL) {
-+                rpmlog(RPMLOG_WARNING, _("/proc/cpuinfo has no 'Features' line\n"));
-+                return 0;
-+        } else if (strcmp(p, "vfpv3") == 0) {
-+                return 1;
-+        }
-+        return 0;
-+}
-+#endif
-+
- 
- #	if defined(__linux__) && defined(__i386__)
- #include <setjmp.h>
-@@ -1157,6 +1207,22 @@
- 	}
- #	endif	/* sparc*-linux */
- 
-+#	if defined(__linux__) && defined(__arm__)
-+	{
-+	    if (strcmp(un.machine, "armv7l") == 0 ) {
-+	        if (has_neon() && has_hfp())
-+                    strcpy(un.machine, "armv7hnl");
-+                else if (has_hfp())
-+                    strcpy(un.machine, "armv7hl");
-+	    } else if (strcmp(un.machine, "armv6l") == 0 ) {
-+	        if (has_neon() && has_hfp())
-+                    strcpy(un.machine, "armv6hnl");
-+                else if (has_hfp())
-+                    strcpy(un.machine, "armv6hl");
-+	    }
-+	}
-+#	endif	/* arm*-linux */
-+
- #	if defined(__GNUC__) && defined(__alpha__)
- 	{
- 	    unsigned long amask, implver;
 diff -uNr rpm-4.9.0-orig//macros.in rpm-4.9.0/macros.in
 --- rpm-4.9.0-orig//macros.in	2011-08-05 12:23:04.000000000 -0500
 +++ rpm-4.9.0/macros.in	2011-08-05 12:25:13.000000000 -0500
diff --git a/rpm.spec b/rpm.spec
index 4f055f2..4e6bde6 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -21,7 +21,7 @@
 Summary: The RPM package management system
 Name: rpm
 Version: %{rpmver}
-Release: %{?snapver:0.%{snapver}.}3%{?dist}.1
+Release: %{?snapver:0.%{snapver}.}3%{?dist}.2
 Group: System Environment/Base
 Url: http://www.rpm.org/
 Source0: http://rpm.org/releases/rpm-4.9.x/%{name}-%{srcver}.tar.bz2
@@ -40,6 +40,7 @@ Patch3: rpm-4.8.0-no-man-dirs.patch
 Patch4: rpm-4.8.1-use-gpg2.patch
 #conditionally applied patch for arm hardware floating point
 Patch5: rpm-4.9.0-armhfp.patch
+Patch6: rpm-4.9.0-armhfp-logic.patch
 
 # Patches already in upstream
 
@@ -213,9 +214,10 @@ packages on a system.
 %patch302 -p1 -b .geode
 %patch303 -p1 -b .debuginfo-allnames
 
+%patch5 -p1 -b .armhfp
 # this patch cant be applied on softfp builds
 %ifnarch armv3l armv4b armv4l armv4tl armv5tel armv5tejl armv6l armv7l
-%patch5 -p1 -b .armhfp
+%patch6 -p1 -b .armhfp-logic
 %endif
 
 %if %{with int_bdb}
@@ -430,7 +432,10 @@ exit 0
 %doc COPYING doc/librpm/html/*
 
 %changelog
-* Tue Nov 30 2011 Dennis Gilmore <dennis at ausil.us> - 4.9.1.2-2.1
+* Wed Dec 21 2011 Dennis Gilmore <dennis at ausil.us> - 4.9.1.2-3.2
+- only conditionally apply the armhfp logic code we do need the hfp macros everywhere
+
+* Tue Nov 30 2011 Dennis Gilmore <dennis at ausil.us> - 4.9.1.2-3.1
 - conditionally apply arm patch for hardfp on all arches but arm softfp ones
 
 * Fri Sep 30 2011 Panu Matilainen <pmatilai at redhat.com> - 4.9.1.2-1


More information about the scm-commits mailing list