]> git.baikalelectronics.ru Git - kernel.git/commit
selftests: Fix clang cross compilation
authorMark Brown <broonie@kernel.org>
Tue, 14 Jun 2022 12:10:45 +0000 (13:10 +0100)
committerShuah Khan <skhan@linuxfoundation.org>
Tue, 14 Jun 2022 17:24:24 +0000 (11:24 -0600)
commit50de0bb4ad4473ff0ca4d4bad012d7fc56b0db41
tree7f8d04cef7d59d861a6b61ee0198945e1a343558
parentf040cca4b0da0180bf9de9141ef5c95f60f85182
selftests: Fix clang cross compilation

Unlike GCC clang uses a single compiler image to support multiple target
architectures meaning that we can't simply rely on CROSS_COMPILE to select
the output architecture. Instead we must pass --target to the compiler to
tell it what to output, kselftest was not doing this so cross compilation
of kselftest using clang resulted in kselftest being built for the host
architecture.

More work is required to fix tests using custom rules but this gets the
bulk of things building.

Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/lib.mk