sparc: pass endianness info to sparse
v2 cover 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(-)
Signature · 4 lines
To: David S. Miller <[email protected]> CC: Sam Ravnborg <[email protected]> CC: [email protected] CC: [email protected]
PATCH v2 1/2 sparc: use a common CHECKFLAGS entry for common flags
--- arch/sparc/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
arch/sparc/Makefile +3 -2
@@ -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
Signature · 1 line
2.14.0
PATCH v2 2/2 sparc: pass endianness info to sparse
In reply to Luc Van Oostenrycksparc 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]>
--- arch/sparc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sparc/Makefile +1 -1
@@ -14,7 +14,7 @@ else KBUILD_DEFCONFIG := sparc64_defconfig endif -CHECKFLAGS += -D__sparc__ +CHECKFLAGS += -D__sparc__ -mbig-endian ifeq ($(CONFIG_SPARC32),y) #####
Signature · 1 line
2.14.0
Quoted 8 lines · Luc Van Oostenryck
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.
You're posted patches for this for about half a dozen architectures now, but we also now have generic Kconfig symbols for the byte order.
I'd much rather see this done in generic code than hacking it up everywhere.
Quoted 8 lines · Christoph Hellwig
Quoted 7 lines · Luc Van Oostenryck
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.
Quoted 7 lines
Quoted 1 line
Fix this by letting sparse know about the architecture endianness.
You're posted patches for this for about half a dozen architectures now, but we also now have generic
Kconfigsymbols for the byte order.I'd much rather see this done in generic code than hacking it up everywhere.
OK, when I wrote these patch (in June, IIRC) there wasn't yet the generic Kconfig symbol. I'll see what can now be generic and what need to stay specific (for example, ARM need __ARME{L,B}__, ARM64 & MIPS are in the same situation as are a few others archs).
-- Luc Van Oostenryck