diff --git a/meta/recipes-devtools/clang/clang_git.bb b/meta/recipes-devtools/clang/clang_git.bb
index 90076f9d6d..6c149945fd 100644
--- a/meta/recipes-devtools/clang/clang_git.bb
+++ b/meta/recipes-devtools/clang/clang_git.bb
@@ -100,6 +100,18 @@ do_configure:prepend() {
   ln -srf ${S}/clang-tools-extra ${S}/clang/tools/extra
 }
 
+# The tests run on the target, so lit must use the target python.
+clang_lit_target_python() {
+    sed -i 's|^config.python_executable = .*|config.python_executable = "${bindir}/python3"|' \
+        ${B}/test/lit.site.cfg.py
+}
+
+do_configure:append:class-target() {
+    if [ "${CLANG_ENABLE_TESTSUITE}" = "1" ]; then
+        clang_lit_target_python
+    fi
+}
+
 do_install:append() {
     oe_multilib_header clang/Config/config.h
 }
diff --git a/meta/recipes-devtools/clang/llvm_git.bb b/meta/recipes-devtools/clang/llvm_git.bb
index bec7e93eab..a61ddcb7ef 100644
--- a/meta/recipes-devtools/clang/llvm_git.bb
+++ b/meta/recipes-devtools/clang/llvm_git.bb
@@ -105,8 +105,17 @@ reproducible_build_variables() {
         ${B}/tools/llvm-config/BuildVariables.inc
 }
 
+# The tests run on the target, so lit must use the target python.
+llvm_lit_target_python() {
+    sed -i 's|^config.python_executable = .*|config.python_executable = "${bindir}/python3"|' \
+        ${B}/test/lit.site.cfg.py
+}
+
 do_configure:append:class-target() {
     reproducible_build_variables
+    if [ "${CLANG_ENABLE_TESTSUITE}" = "1" ]; then
+        llvm_lit_target_python
+    fi
 }
 do_configure:append:class-nativesdk() {
     reproducible_build_variables
