[x264-devel] [PATCH] Properly detect x32.

Adam Borowski kilobyte at angband.pl
Wed Jan 14 03:30:28 CET 2015


As usually, x32 gets mistaken for amd64 (both are x86-64 ABIs after all).
This version doesn't use any assembly yet, a proper port is needed.
---
 common/common.h | 2 +-
 configure       | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/common/common.h b/common/common.h
index 76ae8a3..2834f86 100644
--- a/common/common.h
+++ b/common/common.h
@@ -1010,7 +1010,7 @@ static int ALWAYS_INLINE x264_predictor_clip( int16_t (*dst)[2], int16_t (*mvc)[
     return cnt;
 }
 
-#if ARCH_X86 || ARCH_X86_64
+#if ARCH_X86 || ARCH_X86_64 || ARCH_X32
 #include "x86/util.h"
 #endif
 
diff --git a/configure b/configure
index e2977bd..26afedf 100755
--- a/configure
+++ b/configure
@@ -596,6 +596,10 @@ esac
 
 LDFLAGS="$LDFLAGS $libm"
 
+case `$CC -dumpmachine` in
+    *gnux32) host_cpu=x32
+esac
+
 stack_alignment=16
 case $host_cpu in
     i*86)
@@ -661,6 +665,10 @@ case $host_cpu in
             ASFLAGS="$ASFLAGS -f elf -m amd64"
         fi
         ;;
+    x32)
+        ARCH="X32"
+        CFLAGS="$CFLAGS -fPIC"
+        ;;
     powerpc|powerpc64)
         ARCH="PPC"
         if [ $asm = auto ] ; then
-- 
2.1.4



More information about the x264-devel mailing list