mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: "David S . Miller" <davem@davemloft.net>
Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>,
	Sam Ravnborg <sam@ravnborg.org>,
	sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 2/2] sparc: pass endianness info to sparse
Date: Thu,  9 Nov 2017 07:16:52 +0100	[thread overview]
Message-ID: <20171109061652.14948-3-luc.vanoostenryck@gmail.com> (raw)
In-Reply-To: <20171109061652.14948-1-luc.vanoostenryck@gmail.com>

sparc is big-endian only but sparse assumes the same endianness
as the building machine.
This is problematic for code which expect __BYTE_ORDER__ being
correctly predefined by the compiler which sparse can then
pre-process differently from what gcc would, depending on the
building machine endianness.

Fix this by letting sparse know about the architecture endianness.

To: David S. Miller <davem@davemloft.net>
CC: sparclinux@vger.kernel.org
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 arch/sparc/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/sparc/Makefile b/arch/sparc/Makefile
index a42aa114e..08d477faf 100644
--- a/arch/sparc/Makefile
+++ b/arch/sparc/Makefile
@@ -14,7 +14,7 @@ else
         KBUILD_DEFCONFIG := sparc64_defconfig
 endif
 
-CHECKFLAGS     += -D__sparc__
+CHECKFLAGS     += -D__sparc__ -mbig-endian
 
 ifeq ($(CONFIG_SPARC32),y)
 #####
-- 
2.14.0

  parent reply	other threads:[~2017-11-09  6:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-09  6:16 [PATCH v2 0/2] " Luc Van Oostenryck
2017-11-09  6:16 ` [PATCH v2 1/2] sparc: use a common CHECKFLAGS entry for common flags Luc Van Oostenryck
2017-11-09  6:16 ` Luc Van Oostenryck [this message]
2017-11-09  8:34   ` [PATCH v2 2/2] sparc: pass endianness info to sparse Christoph Hellwig
2017-11-09 13:13     ` Luc Van Oostenryck

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=20171109061652.14948-3-luc.vanoostenryck@gmail.com \
    --to=luc.vanoostenryck@gmail.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.org \
    --cc=sparclinux@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®