[cairo] [PATCH] ARM: Remove any use of environment variables for cpu features detection

Siarhei Siamashka siarhei.siamashka at gmail.com
Sat Feb 6 21:54:43 PST 2010


Old code assumed that all ARMv7 processors support NEON instructions
unless overrided by environment variable ARM_TRUST_HWCAP. This causes
X server to die with SIGILL if NEON support is disabled in the kernel
configuration. Additionally, ARMv7 processors lacking NEON unit are
going to become available eventually.
---
 pixman/pixman-cpu.c |   10 ----------
 1 files changed, 0 insertions(+), 10 deletions(-)

diff --git a/pixman/pixman-cpu.c b/pixman/pixman-cpu.c
index 5d5469b..d727ddb 100644
--- a/pixman/pixman-cpu.c
+++ b/pixman/pixman-cpu.c
@@ -253,8 +253,6 @@ pixman_arm_read_auxv ()
 	    if (aux.a_type == AT_HWCAP)
 	    {
 		uint32_t hwcap = aux.a_un.a_val;
-		if (getenv ("ARM_FORCE_HWCAP"))
-		    hwcap = strtoul (getenv ("ARM_FORCE_HWCAP"), NULL, 0);
 		/* hardcode these values to avoid depending on specific
 		 * versions of the hwcap header, e.g. HWCAP_NEON
 		 */
@@ -266,8 +264,6 @@ pixman_arm_read_auxv ()
 	    else if (aux.a_type == AT_PLATFORM)
 	    {
 		const char *plat = (const char*) aux.a_un.a_val;
-		if (getenv ("ARM_FORCE_PLATFORM"))
-		    plat = getenv ("ARM_FORCE_PLATFORM");
 		if (strncmp (plat, "v7l", 3) == 0)
 		{
 		    arm_has_v7 = TRUE;
@@ -280,12 +276,6 @@ pixman_arm_read_auxv ()
 	    }
 	}
 	close (fd);
-
-	/* if we don't have 2.6.29, we have to do this hack; set
-	 * the env var to trust HWCAP.
-	 */
-	if (!getenv ("ARM_TRUST_HWCAP") && arm_has_v7)
-	    arm_has_neon = TRUE;
     }
 
     arm_tests_initialized = TRUE;
-- 
1.6.4.4



More information about the cairo mailing list