]> git.lizzy.rs Git - rust.git/blobdiff - configure
Fix UB in test helpers
[rust.git] / configure
index a93a6c5a3a68559505a6ce69515e06767b31f100..fa81684fb48e289b2be7a9f46450da295c4b4ef4 100755 (executable)
--- a/configure
+++ b/configure
@@ -541,6 +541,18 @@ case $CFG_CPUTYPE in
         CFG_CPUTYPE=x86_64
         ;;
 
+    mips | mips64)
+        if [ "$CFG_CPUTYPE" = "mips64" ]; then
+            CFG_OSTYPE="${CFG_OSTYPE}abi64"
+        fi
+        ENDIAN=$(printf '\1' | od -dAn)
+        if [ "$ENDIAN" -eq 1 ]; then
+            CFG_CPUTYPE="${CFG_CPUTYPE}el"
+        elif [ "$ENDIAN" -ne 256 ]; then
+            err "unknown endianness: $ENDIAN (expecting 1 for little or 256 for big)"
+        fi
+        ;;
+
     BePC)
         CFG_CPUTYPE=i686
         ;;