kbuild: Set KBUILD_CFLAGS before incl. arch Makefile
authorChris Fries <cfries@google.com>
Tue, 7 Nov 2017 19:46:13 +0000 (11:46 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Mar 2018 09:54:37 +0000 (10:54 +0100)
commit6288eb92cae86430ae9ac23ec396922eaf985ba9
treede71e5307900ae3d54e6e9890ba5809bcfb37a88
parentcfe39acafbaf80504451e56ccb33d1481f13bbe7
kbuild: Set KBUILD_CFLAGS before incl. arch Makefile

commit ae6b289a37890909fea0e4a1666e19377fa0ed2c upstream.

Set the clang KBUILD_CFLAGS up before including arch/ Makefiles,
so that ld-options (etc.) can work correctly.

This fixes errors with clang such as ld-options trying to CC
against your host architecture, but LD trying to link against
your target architecture.

Signed-off-by: Chris Fries <cfries@google.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Tested-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Makefile