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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 Nov 2018 15:07:58 +0000 (16:07 +0100)
commit0925fe3d2eb6907dd2bf6e6521be6c8d52045c2d
treeba518f76f9dbc252cbe6e2414f75c9712514ae44
parentc630d13c98062347d2efd3814c0bef170ad5ce65
kbuild: move cc-option and cc-disable-warning after incl. arch Makefile

commit cfe17c9bbe6a673fdafdab179c32b355ed447f66 upstream.

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>
[nc: Adjust context]
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Makefile