From patchwork Tue Aug 27 16:02:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: James Hogan X-Patchwork-Id: 270151 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id EB44B2C00DC for ; Wed, 28 Aug 2013 02:03:39 +1000 (EST) Received: from localhost ([::1]:57364 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VELk1-0008N1-I5 for incoming@patchwork.ozlabs.org; Tue, 27 Aug 2013 12:03:37 -0400 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 Received: from multi.imgtec.com ([194.200.65.239]:43245) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VELjN-0005Is-Au; Tue, 27 Aug 2013 12:02:57 -0400 From: James Hogan To: Date: Tue, 27 Aug 2013 17:02:13 +0100 Message-ID: <1377619333-16062-1-git-send-email-james.hogan@imgtec.com> X-Mailer: git-send-email 1.8.1.2 MIME-Version: 1.0 X-Originating-IP: [192.168.154.65] X-SEF-Processed: 7_3_0_01192__2013_08_27_17_02_50 X-detected-operating-system: by eggs.gnu.org: Windows XP X-Received-From: 194.200.65.239 Cc: Sanjay Lal , James Hogan , =?UTF-8?q?Andreas=20F=C3=A4rber?= , qemu-stable@nongnu.org Subject: [Qemu-devel] [PATCH] qemu: Fix cross compilation for mipsel X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@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