Received: from eggs.gnu.org ([2001:4830:134:3::10]:56982) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VELjb-0008Fv-T6 for qemu-devel@nongnu.org; Tue, 27 Aug 2013 12:03:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VELjX-0005Ui-NP for qemu-devel@nongnu.org; Tue, 27 Aug 2013 12:03:11 -0400 From: James Hogan Date: Tue, 27 Aug 2013 17:02:13 +0100 Message-ID: <1377619333-16062-1-git-send-email-james.hogan@imgtec.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH] qemu: Fix cross compilation for mipsel List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Sanjay Lal , James Hogan , =?UTF-8?q?Andreas=20F=C3=A4rber?= , qemu-stable@nongnu.org The configure script was setting HOST_WORDS_BIGENDIAN for all $cpu = mips|mips64 when cross compiling, since endianness cannot be detected by running a test program. This includes little endian MIPS though. It didn't cause any build errors but does prevent QEMU from working correctly. Instead, detect the endianness similar to how we do for ARM, by checking for the __MIPSEB__ builtin processor definition. This is from a hunk in the "[PATCH 8/12] KVM/MIPS: Enable KVM/MIPS for MIPS targets. Add MIPS GIC code to the build" patch by Sanjay Lal [1]. [1] https://patchwork.kernel.org/patch/2207251/ Signed-off-by: James Hogan Cc: Andreas Färber Cc: Sanjay Lal Cc: qemu-stable@nongnu.org --- configure | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 0a55c20..a765a9f 100755 --- a/configure +++ b/configure @@ -1415,7 +1415,12 @@ case "$cpu" in bigendian=yes fi ;; - hppa|m68k|mips|mips64|ppc|ppc64|s390|s390x|sparc|sparc64) + mips|mips64) + if check_define __MIPSEB__; then + bigendian=yes + fi + ;; + hppa|m68k|ppc|ppc64|s390|s390x|sparc|sparc64) bigendian=yes ;; esac -- 1.8.1.2