mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Antony Pavlov <antonynpavlov@gmail.com>
To: barebox <barebox@lists.infradead.org>,
	Sascha Hauer <s.hauer@pengutronix.de>
Subject: big-endian sandbox issue
Date: Wed, 1 Jul 2015 07:55:05 +0300	[thread overview]
Message-ID: <CAA4bVAH3Qk2Fmv5X9fdkqto+b2D+qyXMXQenaffyau_Oc_ewkA@mail.gmail.com> (raw)

Hi!

I have tried to build barebox on big-endian MIPS CPU running Debian 8.
It fails because of unconditional <linux/byteorder/little_endian.h> inclusion.

At the first glance this can help:

--- a/arch/sandbox/include/asm/byteorder.h
+++ b/arch/sandbox/include/asm/byteorder.h
@@ -3,6 +3,12 @@

 #include <asm/types.h>

+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+#include <linux/byteorder/big_endian.h>
+#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
 #include <linux/byteorder/little_endian.h>
+#else
+#error "__BYTE_ORDER__ != __ORDER_BIG_ENDIAN__ and __BYTE_ORDER__ !=
__ORDER_LITTLE_ENDIAN__"
+#endif

 #endif /* _I386_BYTEORDER_H */

But some warning appears:

In file included from common/filetype.c:21:0:
/barebox.git/arch/sandbox/include/asm/unaligned.h:11:21: warning:
"__LITTLE_ENDIAN" is not defined [-Wundef]
 #if __BYTE_ORDER == __LITTLE_ENDIAN

System-wide <endian.h> can fix the situation, but we use -nostdinc, so
the error occurs:

barebox.git/arch/sandbox/include/asm/byteorder.h:7:20: fatal error:
endian.h: No such file or directory
 #include <endian.h>
                    ^
compilation terminated.

Moreover AFAIR <endian.h> isn't available on BSD, so '#if
defined(__linux__)' has to be used.


Any suggestions?

-- 
Best regards,
  Antony Pavlov

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2015-07-01  4:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-01  4:55 Antony Pavlov [this message]
2015-07-01  6:24 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAA4bVAH3Qk2Fmv5X9fdkqto+b2D+qyXMXQenaffyau_Oc_ewkA@mail.gmail.com \
    --to=antonynpavlov@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox