]> git.baikalelectronics.ru Git - kernel.git/commit
kbuild: fix CONFIG_CC_CAN_LINK(_STATIC) for cross-compilation with Clang
authorMasahiro Yamada <masahiroy@kernel.org>
Tue, 30 Jun 2020 15:06:24 +0000 (00:06 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Wed, 1 Jul 2020 15:57:45 +0000 (00:57 +0900)
commit3457544b706556bcd0fe1098701cc8f83416fe6b
treedefed5906aa7bed07ef2eb81367a18087cd942dc
parente61c65b0115b80d55c3212767ffe2664d67e2afe
kbuild: fix CONFIG_CC_CAN_LINK(_STATIC) for cross-compilation with Clang

scripts/cc-can-link.sh tests if the compiler can link userspace
programs.

When $(CC) is GCC, it is checked against the target architecture
because the toolchain prefix is specified as a part of $(CC).

When $(CC) is Clang, it is checked against the host architecture
because --target option is missing.

Pass $(CLANG_FLAGS) to scripts/cc-can-link.sh to evaluate the link
capability for the target architecture.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
init/Kconfig