From 5740f94fedc11b87cb9a3d9d65c204982e460959 Mon Sep 17 00:00:00 2001 From: Ximin Luo Date: Wed, 28 Dec 2016 13:56:29 +0100 Subject: [PATCH 1/2] Detect mips CPUs in ./configure This mirrors existing logic already in src/bootstrap/bootstrap.py --- configure | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/configure b/configure index a93a6c5a3a6..fa81684fb48 100755 --- 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 ;; From 246e7492af6298e9ddf448c3c2aa67d41154f73a Mon Sep 17 00:00:00 2001 From: Ximin Luo Date: Thu, 29 Dec 2016 14:26:53 +0100 Subject: [PATCH 2/2] Add mips architectures to conditional-compile test --- src/test/run-pass/conditional-compile-arch.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/run-pass/conditional-compile-arch.rs b/src/test/run-pass/conditional-compile-arch.rs index 368ffe6e713..24c461d5f51 100644 --- a/src/test/run-pass/conditional-compile-arch.rs +++ b/src/test/run-pass/conditional-compile-arch.rs @@ -22,6 +22,12 @@ pub fn main() { } #[cfg(target_arch = "aarch64")] pub fn main() { } +#[cfg(target_arch = "mips")] +pub fn main() { } + +#[cfg(target_arch = "mips64")] +pub fn main() { } + #[cfg(target_arch = "powerpc64")] pub fn main() { }