2017-11-09 06:18:16

by Luc Van Oostenryck

[permalink] [raw]
Subject: [PATCH v2 0/2] sparc: pass endianness info to sparse

The goal of these two patches is to ass endianness and machine
size info to sparse so that sparse can emit correct diagnostics
even when the endianness or machine size doesn't correspond to
sparse's defaults.

Change since v1:
- move sparse options common to sparc32 & sparc64 at the
same place.

Luc Van Oostenryck (2):
sparc: use a common CHECKFLAGS entry for common flags
sparc: pass endianness info to sparse

arch/sparc/Makefile | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

--
To: David S. Miller <[email protected]>
CC: Sam Ravnborg <[email protected]>
CC: [email protected]
CC: [email protected]

From 1583568171624506780@xxx Thu Nov 09 06:18:13 +0000 2017
X-GM-THRID: 1583568171624506780
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread


2017-11-09 06:18:13

by Luc Van Oostenryck

[permalink] [raw]
Subject: [PATCH v2 2/2] sparc: pass endianness info to sparse

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 <[email protected]>
CC: [email protected]
Signed-off-by: Luc Van Oostenryck <[email protected]>
---
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


From 1583592604486585911@xxx Thu Nov 09 12:46:34 +0000 2017
X-GM-THRID: 1583051353913396917
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread

2017-11-09 06:18:21

by Luc Van Oostenryck

[permalink] [raw]
Subject: [PATCH v2 1/2] sparc: use a common CHECKFLAGS entry for common flags

---
arch/sparc/Makefile | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/sparc/Makefile b/arch/sparc/Makefile
index 8496a074b..a42aa114e 100644
--- a/arch/sparc/Makefile
+++ b/arch/sparc/Makefile
@@ -14,12 +14,13 @@ else
KBUILD_DEFCONFIG := sparc64_defconfig
endif

+CHECKFLAGS += -D__sparc__
+
ifeq ($(CONFIG_SPARC32),y)
#####
# sparc32
#

-CHECKFLAGS += -D__sparc__
LDFLAGS := -m elf32_sparc
export BITS := 32
UTS_MACHINE := sparc
@@ -38,7 +39,7 @@ else
# sparc64
#

-CHECKFLAGS += -D__sparc__ -D__sparc_v9__ -D__arch64__ -m64
+CHECKFLAGS += -D__sparc_v9__ -D__arch64__ -m64
LDFLAGS := -m elf64_sparc
export BITS := 64
UTS_MACHINE := sparc64
--
2.14.0


From 1583347383254401477@xxx Mon Nov 06 19:48:53 +0000 2017
X-GM-THRID: 1583347383254401477
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread