Skip to content

Commit

Permalink
c6x: pass endianness info to sparse
Browse files Browse the repository at this point in the history
c6x depends on the macro '_BIG_ENDIAN' being defined or not
to correctly select or define endian-specific macros, structures
or pieces of code.

This macro is predefined by the compiler but sparse knows nothing
about it and thus may pre-process files differently from what
gcc would.

Fix this by passing '-D_BIG_ENDIAN' when compiling a big-endian
kernel, like GCC would have done.

To: Mark Salter <msalter@redhat.com>
To: Aurelien Jacquiot <a-jacquiot@ti.com>
CC: linux-c6x-dev@linux-c6x.org
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: Mark Salter <msalter@redhat.com>
  • Loading branch information
Luc Van Oostenryck authored and Mark Salter committed Apr 10, 2018
1 parent 319938b commit 85fa2cc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/c6x/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ KBUILD_AFLAGS += -mbig-endian
LINKFLAGS += -mbig-endian
KBUILD_LDFLAGS += -mbig-endian
LDFLAGS += -EB
CHECKFLAGS += -D_BIG_ENDIAN
endif

head-y := arch/c6x/kernel/head.o
Expand Down

0 comments on commit 85fa2cc

Please sign in to comment.