[compiler-rt] 16de508 - honor Python2_EXECUTABLE and Python3_EXECUTABLE when they are passed to cmake
Michael Kruse via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 17 15:49:29 PST 2020
Author: Robert Underwood
Date: 2020-11-17T17:49:14-06:00
New Revision: 16de50895e96adbe261a5ce2498366bda7b3fccd
URL: https://github.com/llvm/llvm-project/commit/16de50895e96adbe261a5ce2498366bda7b3fccd
DIFF: https://github.com/llvm/llvm-project/commit/16de50895e96adbe261a5ce2498366bda7b3fccd.diff
LOG: honor Python2_EXECUTABLE and Python3_EXECUTABLE when they are passed to cmake
CMake's find_package(Python3) and find_package(Python2) packages have a PYTHON_EXECUTABLE, Python2_EXECUTABLE, and Python3_EXECUTABLE cmake variables which control which version of python is built against. As far as I can tell, the rest of LLVM honors these variables. This can cause the build process to fail when if the automatically selected version of Python can't run due to modifications of LD_LIBRARY_PATH when using spack. The corresponding Spack issue is https://github.com/spack/spack/issues/19908. The corresponding LLVM issue is 48180
I believe an appropriate fix is to add the variables to the list of PASSTHROUGH_VARIABLES in cmake/Modules/AddCompilerRT.cmake, and this fixed compilation errors for me.
This bug affects distributions like Gentoo and package managers like Spack which allow for combinatorial versioning.
Reviewed By: Meinersbur
Differential Revision: https://reviews.llvm.org/D91536
Added:
Modified:
compiler-rt/cmake/Modules/AddCompilerRT.cmake
Removed:
################################################################################
diff --git a/compiler-rt/cmake/Modules/AddCompilerRT.cmake b/compiler-rt/cmake/Modules/AddCompilerRT.cmake
index bd1499b4b4d8..0b8db6a868a1 100644
--- a/compiler-rt/cmake/Modules/AddCompilerRT.cmake
+++ b/compiler-rt/cmake/Modules/AddCompilerRT.cmake
@@ -583,6 +583,9 @@ macro(add_custom_libcxx name prefix)
CMAKE_OBJDUMP
CMAKE_STRIP
CMAKE_SYSROOT
+ PYTHON_EXECUTABLE
+ Python3_EXECUTABLE
+ Python2_EXECUTABLE
CMAKE_SYSTEM_NAME)
foreach(variable ${PASSTHROUGH_VARIABLES})
get_property(is_value_set CACHE ${variable} PROPERTY VALUE SET)
More information about the llvm-commits
mailing list