From f1b2bca4f51623b3605468d629dec7508a1db149 Mon Sep 17 00:00:00 2001 From: Anuj Mittal Date: Wed, 18 Sep 2019 13:56:35 +0800 Subject: clang: pass PYTHON_EXECUTABLE to target as well Also make sure that we pass this value on to an internal native build that tries to detect python while cross-compiling. Signed-off-by: Anuj Mittal --- ..._EXECUTABLE-when-cross-compiling-for-nati.patch | 25 ++++++++++++++++++++++ recipes-devtools/clang/clang_git.bb | 1 + recipes-devtools/clang/common.inc | 1 + 3 files changed, 27 insertions(+) create mode 100644 recipes-devtools/clang/clang/0001-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch (limited to 'recipes-devtools') diff --git a/recipes-devtools/clang/clang/0001-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch b/recipes-devtools/clang/clang/0001-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch new file mode 100644 index 0000000..ab3c837 --- /dev/null +++ b/recipes-devtools/clang/clang/0001-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch @@ -0,0 +1,25 @@ +From 112a89e845333ae98e9802c5ac5a4761032e08de Mon Sep 17 00:00:00 2001 +From: Anuj Mittal +Date: Wed, 18 Sep 2019 12:56:58 +0800 +Subject: [PATCH] Pass PYTHON_EXECUTABLE when cross compiling for native build + +Signed-off-by: Anuj Mittal +--- + llvm/cmake/modules/CrossCompile.cmake | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/llvm/cmake/modules/CrossCompile.cmake b/llvm/cmake/modules/CrossCompile.cmake +index d6b4161..7fae108 100644 +--- a/llvm/cmake/modules/CrossCompile.cmake ++++ b/llvm/cmake/modules/CrossCompile.cmake +@@ -62,6 +62,7 @@ function(llvm_create_cross_target_internal target_name toolchain buildtype) + -DLLVM_ENABLE_PROJECTS="${llvm_enable_projects_arg}" + -DLLVM_EXTERNAL_PROJECTS="${llvm_external_projects_arg}" + -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN="${LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN}" ++ -DPYTHON_EXECUTABLE="${PYTHON_EXECUTABLE}" + ${build_type_flags} ${linker_flag} ${external_clang_dir} + WORKING_DIRECTORY ${LLVM_${target_name}_BUILD} + DEPENDS CREATE_LLVM_${target_name} +-- +2.7.4 + diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb index 49691d5..c186cc7 100644 --- a/recipes-devtools/clang/clang_git.bb +++ b/recipes-devtools/clang/clang_git.bb @@ -147,6 +147,7 @@ EXTRA_OECMAKE_append_class-target = "\ -DPYTHON_LIBRARY=${STAGING_LIBDIR}/lib${PYTHON_DIR}${PYTHON_ABI}.so \ -DPYTHON_INCLUDE_DIR=${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI} \ -DLLVM_LIBDIR_SUFFIX=${@d.getVar('baselib').replace('lib', '')} \ + -DPYTHON_EXECUTABLE='${PYTHON}' \ " DEPENDS = "binutils zlib libffi libedit libedit-native libxml2 libxml2-native ninja-native swig-native" diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc index ceb9daa..955c3cc 100644 --- a/recipes-devtools/clang/common.inc +++ b/recipes-devtools/clang/common.inc @@ -30,6 +30,7 @@ SRC_URI = "\ file://0020-clang-default-to-lp64d-ABI-and-rv64gc-ISA.patch \ file://0022-Driver-Prioritize-SYSROOT-usr-include-over-RESOURCE_.patch \ file://0023-RISCV-Add-support-for-floating-point-registers-in-in.patch \ + file://0001-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch \ " # Fallback to no-PIE if not set -- cgit v1.2.3-54-g00ecf