OSDN Git Service

kbuild: move cc-option and cc-disable-warning after incl. arch Makefile
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Mon, 27 Nov 2017 12:15:13 +0000 (21:15 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Wed, 6 Dec 2017 12:53:57 +0000 (21:53 +0900)
commitcfe17c9bbe6a673fdafdab179c32b355ed447f66
treea8829e79271018fedab3f8c4a8e1d5cc02a5903b
parentae64f9bd1d3621b5e60d7363bc20afb46aede215
kbuild: move cc-option and cc-disable-warning after incl. arch Makefile

Geert reported commit ae6b289a3789 ("kbuild: Set KBUILD_CFLAGS before
incl. arch Makefile") broke cross-compilation using a cross-compiler
that supports less compiler options than the host compiler.

For example,

  cc1: error: unrecognized command line option "-Wno-unused-but-set-variable"

This problem happens on architectures that setup CROSS_COMPILE in their
arch/*/Makefile.

Move the cc-option and cc-disable-warning back to the original position,
but keep the Clang target options untouched.

Fixes: ae6b289a3789 ("kbuild: Set KBUILD_CFLAGS before incl. arch Makefile")
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Makefile