[lld] c4c3883 - build: use `find_package(Python3)` if available

Eric Christopher via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 28 16:44:06 PDT 2020


Broke a number of things for me and a few other people I spoke with as
well. I've gone ahead and temporarily reverted here:

commit 35edd704e0fda09e8e634515c0b451d4a8b6b914 (HEAD -> master,
origin/master, origin/HEAD)
Author: Eric Christopher <echristo at gmail.com>
Date:   Tue Apr 28 16:41:22 2020 -0700

    Temporarily revert "build: use `find_package(Python3)` if available"
    as it seems to be causing multiple people problems with running tests
    and building.

    This reverts commit c4c3883b00d3a6aa657a5e3e515c90c9ea1f81c6.

and happy to work with Saleem to see what we can do to fix.

Some builds and tests weren't running (all of lldb's python tests were
failing and something weird in libc++ as well for building).

Sorry, and let me know what I can do to help.

-eric

On Tue, Apr 28, 2020 at 10:26 AM Reid Kleckner via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> This broke the gn build (which Saleem is of course not obligated to fix),
> and I applied a duct tape fix for it
> in cbaa74a0981833537e88a8eeac9c9df0f528833c. Feel free to improve on it.
>
>
> On Tue, Apr 28, 2020 at 9:26 AM Saleem Abdulrasool via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
>
>>
>> Author: Saleem Abdulrasool
>> Date: 2020-04-28T09:24:27-07:00
>> New Revision: c4c3883b00d3a6aa657a5e3e515c90c9ea1f81c6
>>
>> URL:
>> https://github.com/llvm/llvm-project/commit/c4c3883b00d3a6aa657a5e3e515c90c9ea1f81c6
>> DIFF:
>> https://github.com/llvm/llvm-project/commit/c4c3883b00d3a6aa657a5e3e515c90c9ea1f81c6.diff
>>
>> LOG: build: use `find_package(Python3)` if available
>>
>> This is primarily motivated by the desire to move from Python2 to
>> Python3.  `PYTHON_EXECUTABLE` is ambiguous.  This explicitly identifies
>> the python interpreter in use.  Since the LLVM build seems to be able to
>> completed successfully with python3, use that across the build.  The old
>> path aliases `PYTHON_EXECUTABLE` to be treated as Python3.
>>
>> Added:
>>
>>
>> Modified:
>>     clang-tools-extra/test/lit.site.cfg.py.in
>>     clang/CMakeLists.txt
>>     clang/bindings/python/tests/CMakeLists.txt
>>     clang/test/lit.site.cfg.py.in
>>     clang/utils/perf-training/CMakeLists.txt
>>     clang/utils/perf-training/lit.site.cfg.in
>>     clang/utils/perf-training/order-files.lit.site.cfg.in
>>     lld/CMakeLists.txt
>>     lld/test/Unit/lit.site.cfg.py.in
>>     lld/test/lit.site.cfg.py.in
>>     llvm/CMakeLists.txt
>>     llvm/cmake/config-ix.cmake
>>     llvm/cmake/modules/AddLLVM.cmake
>>     llvm/test/lit.site.cfg.py.in
>>     llvm/tools/llvm-shlib/CMakeLists.txt
>>
>> Removed:
>>
>>
>>
>>
>> ################################################################################
>> diff  --git a/clang-tools-extra/test/lit.site.cfg.py.in
>> b/clang-tools-extra/test/lit.site.cfg.py.in
>> index a970e7fafc1f..5dc112a56126 100644
>> --- a/clang-tools-extra/test/lit.site.cfg.py.in
>> +++ b/clang-tools-extra/test/lit.site.cfg.py.in
>> @@ -8,7 +8,7 @@ config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
>>  config.clang_tools_binary_dir = "@CLANG_TOOLS_BINARY_DIR@"
>>  config.clang_tools_dir = "@CLANG_TOOLS_DIR@"
>>  config.clang_libs_dir = "@SHLIBDIR@"
>> -config.python_executable = "@PYTHON_EXECUTABLE@"
>> +config.python_executable = "@Python3_EXECUTABLE@"
>>  config.target_triple = "@TARGET_TRIPLE@"
>>  config.clang_staticanalyzer = @CLANG_ENABLE_STATIC_ANALYZER@
>>
>>
>> diff  --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
>> index 88e556fd88a0..7dadc5f6e917 100644
>> --- a/clang/CMakeLists.txt
>> +++ b/clang/CMakeLists.txt
>> @@ -130,16 +130,38 @@ if( CMAKE_SOURCE_DIR STREQUAL
>> CMAKE_CURRENT_SOURCE_DIR )
>>    set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY
>> ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
>>
>>    if(LLVM_INCLUDE_TESTS)
>> -    include(FindPythonInterp)
>> -    if(NOT PYTHONINTERP_FOUND)
>> -      message(FATAL_ERROR
>> -"Unable to find Python interpreter, required for builds and testing.
>> +    if(CMAKE_VERSION VERSION_LESS 3.12)
>> +      include(FindPythonInterp)
>> +      if(NOT PYTHONINTERP_FOUND)
>> +        message(FATAL_ERROR
>> +  "Unable to find Python interpreter, required for builds and testing.
>>
>> -Please install Python or specify the PYTHON_EXECUTABLE CMake variable.")
>> -    endif()
>> +  Please install Python or specify the PYTHON_EXECUTABLE CMake
>> variable.")
>> +      endif()
>> +
>> +      if( ${PYTHON_VERSION_STRING} VERSION_LESS 2.7 )
>> +        message(FATAL_ERROR "Python 2.7 or newer is required")
>> +      endif()
>>
>> -    if( ${PYTHON_VERSION_STRING} VERSION_LESS 2.7 )
>> -      message(FATAL_ERROR "Python 2.7 or newer is required")
>> +      add_executable(Python3::Interpreter IMPORTED)
>> +      set_target_properties(Python3::Interpreter PROPERTIES
>> +        IMPORTED_LOCATION ${PYTHON_EXECUTABLE})
>> +      set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE})
>> +    else()
>> +      find_package(Python3 COMPONENTS Interpreter)
>> +      if(NOT Python3_Interpreter_FOUND)
>> +        message(WARNING "Python3 not found, using python2 as a fallback")
>> +        find_package(Python2 COMPONENTS Interpreter REQUIRED)
>> +        if(Python2_VERSION VERSION_LESS 2.7)
>> +          message(SEND_ERROR "Python 2.7 or newer is required")
>> +        endif()
>> +
>> +        # Treat python2 as python3
>> +        add_executable(Python3::Interpreter IMPORTED)
>> +        set_target_properties(Python3::Interpreter PROPERTIES
>> +          IMPORTED_LOCATION ${Python2_EXECUTABLE})
>> +        set(Python3_EXECUTABLE ${Python2_EXECUTABLE})
>> +      endif()
>>      endif()
>>
>>      # Check prebuilt llvm/utils.
>>
>> diff  --git a/clang/bindings/python/tests/CMakeLists.txt
>> b/clang/bindings/python/tests/CMakeLists.txt
>> index 626256af9c1b..3f58c4bde8e7 100644
>> --- a/clang/bindings/python/tests/CMakeLists.txt
>> +++ b/clang/bindings/python/tests/CMakeLists.txt
>> @@ -3,7 +3,7 @@
>>  add_custom_target(check-clang-python
>>      COMMAND ${CMAKE_COMMAND} -E env
>>              CLANG_LIBRARY_PATH=$<TARGET_FILE_DIR:libclang>
>> -            ${PYTHON_EXECUTABLE} -m unittest discover
>> +            "${Python3_EXECUTABLE}" -m unittest discover
>>      DEPENDS libclang
>>      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/..)
>>
>>
>> diff  --git a/clang/test/lit.site.cfg.py.in b/clang/test/
>> lit.site.cfg.py.in
>> index daec694bd128..4527ccadbb4a 100644
>> --- a/clang/test/lit.site.cfg.py.in
>> +++ b/clang/test/lit.site.cfg.py.in
>> @@ -27,7 +27,7 @@ config.enable_backtrace = @ENABLE_BACKTRACES@
>>  config.enable_experimental_new_pass_manager =
>> @ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER@
>>  config.enable_threads = @LLVM_ENABLE_THREADS@
>>  config.host_arch = "@HOST_ARCH@"
>> -config.python_executable = "@PYTHON_EXECUTABLE@"
>> +config.python_executable = "@Python3_EXECUTABLE@"
>>  config.use_z3_solver = lit_config.params.get('USE_Z3_SOLVER',
>> "@USE_Z3_SOLVER@")
>>  config.has_plugins = @LLVM_ENABLE_PLUGINS@
>>
>>
>> diff  --git a/clang/utils/perf-training/CMakeLists.txt
>> b/clang/utils/perf-training/CMakeLists.txt
>> index 1f8612206b7a..172076fd0ce5 100644
>> --- a/clang/utils/perf-training/CMakeLists.txt
>> +++ b/clang/utils/perf-training/CMakeLists.txt
>> @@ -23,7 +23,7 @@ if(LLVM_BUILD_INSTRUMENTED)
>>      )
>>
>>    add_custom_target(clear-profraw
>> -    COMMAND ${PYTHON_EXECUTABLE}
>> ${CMAKE_CURRENT_SOURCE_DIR}/perf-helper.py clean
>> ${CMAKE_CURRENT_BINARY_DIR} profraw
>> +    COMMAND "${Python3_EXECUTABLE}"
>> ${CMAKE_CURRENT_SOURCE_DIR}/perf-helper.py clean
>> ${CMAKE_CURRENT_BINARY_DIR} profraw
>>      COMMENT "Clearing old profraw data")
>>
>>    if(NOT LLVM_PROFDATA)
>> @@ -34,7 +34,7 @@ if(LLVM_BUILD_INSTRUMENTED)
>>      message(STATUS "To enable merging PGO data LLVM_PROFDATA has to
>> point to llvm-profdata")
>>    else()
>>      add_custom_target(generate-profdata
>> -      COMMAND ${PYTHON_EXECUTABLE}
>> ${CMAKE_CURRENT_SOURCE_DIR}/perf-helper.py merge ${LLVM_PROFDATA}
>> ${CMAKE_CURRENT_BINARY_DIR}/clang.profdata ${CMAKE_CURRENT_BINARY_DIR}
>> +      COMMAND "${Python3_EXECUTABLE}"
>> ${CMAKE_CURRENT_SOURCE_DIR}/perf-helper.py merge ${LLVM_PROFDATA}
>> ${CMAKE_CURRENT_BINARY_DIR}/clang.profdata ${CMAKE_CURRENT_BINARY_DIR}
>>        COMMENT "Merging profdata"
>>        DEPENDS generate-profraw)
>>    endif()
>> @@ -55,7 +55,7 @@ if(APPLE AND DTRACE)
>>      )
>>
>>    add_custom_target(clear-dtrace-logs
>> -    COMMAND ${PYTHON_EXECUTABLE}
>> ${CMAKE_CURRENT_SOURCE_DIR}/perf-helper.py clean
>> ${CMAKE_CURRENT_BINARY_DIR} dtrace
>> +    COMMAND "${Python3_EXECUTABLE}"
>> ${CMAKE_CURRENT_SOURCE_DIR}/perf-helper.py clean
>> ${CMAKE_CURRENT_BINARY_DIR} dtrace
>>      COMMENT "Clearing old dtrace data")
>>
>>    if(NOT CLANG_ORDER_FILE)
>> @@ -63,7 +63,7 @@ if(APPLE AND DTRACE)
>>    endif()
>>
>>    add_custom_target(generate-order-file
>> -    COMMAND ${PYTHON_EXECUTABLE}
>> ${CMAKE_CURRENT_SOURCE_DIR}/perf-helper.py gen-order-file --binary
>> $<TARGET_FILE:clang> --output ${CLANG_ORDER_FILE}
>> ${CMAKE_CURRENT_BINARY_DIR}
>> +    COMMAND "${Python3_EXECUTABLE}"
>> ${CMAKE_CURRENT_SOURCE_DIR}/perf-helper.py gen-order-file --binary
>> $<TARGET_FILE:clang> --output ${CLANG_ORDER_FILE}
>> ${CMAKE_CURRENT_BINARY_DIR}
>>      COMMENT "Generating order file"
>>      DEPENDS generate-dtrace-logs)
>>  endif()
>>
>> diff  --git a/clang/utils/perf-training/lit.site.cfg.in
>> b/clang/utils/perf-training/lit.site.cfg.in
>> index 340a0e909b10..a1c6d6bc663d 100644
>> --- a/clang/utils/perf-training/lit.site.cfg.in
>> +++ b/clang/utils/perf-training/lit.site.cfg.in
>> @@ -7,7 +7,7 @@ config.perf_helper_dir = "@CMAKE_CURRENT_SOURCE_DIR@"
>>  config.test_exec_root = "@CMAKE_CURRENT_BINARY_DIR@"
>>  config.test_source_root = "@CLANG_PGO_TRAINING_DATA@"
>>  config.target_triple = "@TARGET_TRIPLE@"
>> -config.python_exe = "@PYTHON_EXECUTABLE@"
>> +config.python_exe = "@Python3_EXECUTABLE@"
>>
>>  # Support substitution of the tools and libs dirs with user parameters.
>> This is
>>  # used when we can't determine the tool dir at configuration time.
>>
>> diff  --git a/clang/utils/perf-training/order-files.lit.site.cfg.in
>> b/clang/utils/perf-training/order-files.lit.site.cfg.in
>> index 87406dbaf9a6..91f2b79d208d 100644
>> --- a/clang/utils/perf-training/order-files.lit.site.cfg.in
>> +++ b/clang/utils/perf-training/order-files.lit.site.cfg.in
>> @@ -7,7 +7,7 @@ config.perf_helper_dir = "@CMAKE_CURRENT_SOURCE_DIR@"
>>  config.test_exec_root = "@CMAKE_CURRENT_BINARY_DIR@"
>>  config.test_source_root = "@CLANG_PGO_TRAINING_DATA@"
>>  config.target_triple = "@TARGET_TRIPLE@"
>> -config.python_exe = "@PYTHON_EXECUTABLE@"
>> +config.python_exe = "@Python3_EXECUTABLE@"
>>
>>  # Support substitution of the tools and libs dirs with user parameters.
>> This is
>>  # used when we can't determine the tool dir at configuration time.
>>
>> diff  --git a/lld/CMakeLists.txt b/lld/CMakeLists.txt
>> index 3bd9e9556a85..7bbc59c7a811 100644
>> --- a/lld/CMakeLists.txt
>> +++ b/lld/CMakeLists.txt
>> @@ -56,16 +56,38 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
>>    include(HandleLLVMOptions)
>>
>>    if(LLVM_INCLUDE_TESTS)
>> -    include(FindPythonInterp)
>> -    if(NOT PYTHONINTERP_FOUND)
>> -      message(FATAL_ERROR
>> -"Unable to find Python interpreter, required for testing.
>> +    if(CMAKE_VERSION VERSION_LESS 3.12)
>> +      include(FindPythonInterp)
>> +      if(NOT PYTHONINTERP_FOUND)
>> +        message(FATAL_ERROR
>> +  "Unable to find Python interpreter, required for testing.
>>
>> -Please install Python or specify the PYTHON_EXECUTABLE CMake variable.")
>> -    endif()
>> +  Please install Python or specify the PYTHON_EXECUTABLE CMake
>> variable.")
>> +      endif()
>> +
>> +      if(${PYTHON_VERSION_STRING} VERSION_LESS 2.7)
>> +        message(FATAL_ERROR "Python 2.7 or newer is required")
>> +      endif()
>>
>> -    if(${PYTHON_VERSION_STRING} VERSION_LESS 2.7)
>> -      message(FATAL_ERROR "Python 2.7 or newer is required")
>> +      add_executable(Python3::Interpeter IMPORTED)
>> +      set_target_properties(Python3::Interpreter PROPERTIES
>> +        IMPORTED_LOCATION ${PYTHON_EXECUTABLE})
>> +      set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE})
>> +    else()
>> +      find_package(Python3 COMPONENTS Interpreter)
>> +      if(NOT Python3_Interpreter_FOUND)
>> +        message(WARNING "Python3 not found, using python2 as a fallback")
>> +        find_package(Python2 COMPONENTS Interpreter REQUIRED)
>> +        if(Python2_VERSION VERSION_LESS 2.7)
>> +          message(SEND_ERROR "Python 2.7 or newer is required")
>> +        endif()
>> +
>> +        # Treat python2 as python3
>> +        add_executable(Python3::Interpreter IMPORTED)
>> +        set_target_properties(Python3::Interpreter PROPERTIES
>> +          IMPORTED_LOCATION ${Python2_EXECUTABLE})
>> +        set(Python3_EXECUTABLE ${Python2_EXECUTABLE})
>> +      endif()
>>      endif()
>>
>>      # Check prebuilt llvm/utils.
>>
>> diff  --git a/lld/test/Unit/lit.site.cfg.py.in b/lld/test/Unit/
>> lit.site.cfg.py.in
>> index cc12117ad0bf..d96e20f11d0a 100644
>> --- a/lld/test/Unit/lit.site.cfg.py.in
>> +++ b/lld/test/Unit/lit.site.cfg.py.in
>> @@ -11,7 +11,7 @@ config.lld_src_root = "@LLD_SOURCE_DIR@"
>>  config.lld_libs_dir = "@LLVM_LIBRARY_OUTPUT_INTDIR@"
>>  config.lld_tools_dir = "@LLVM_RUNTIME_OUTPUT_INTDIR@"
>>  config.target_triple = "@TARGET_TRIPLE@"
>> -config.python_executable = "@PYTHON_EXECUTABLE@"
>> +config.python_executable = "@Python3_EXECUTABLE@"
>>
>>  # Support substitution of the tools and libs dirs with user parameters.
>> This is
>>  # used when we can't determine the tool dir at configuration time.
>>
>> diff  --git a/lld/test/lit.site.cfg.py.in b/lld/test/lit.site.cfg.py.in
>> index 02840f8d6a30..4aa2fcda73bb 100644
>> --- a/lld/test/lit.site.cfg.py.in
>> +++ b/lld/test/lit.site.cfg.py.in
>> @@ -13,7 +13,7 @@ config.lld_obj_root = "@LLD_BINARY_DIR@"
>>  config.lld_libs_dir = "@LLVM_LIBRARY_OUTPUT_INTDIR@"
>>  config.lld_tools_dir = "@LLVM_RUNTIME_OUTPUT_INTDIR@"
>>  config.target_triple = "@TARGET_TRIPLE@"
>> -config.python_executable = "@PYTHON_EXECUTABLE@"
>> +config.python_executable = "@Python3_EXECUTABLE@"
>>  config.have_zlib = @HAVE_LIBZ@
>>  config.sizeof_void_p = @CMAKE_SIZEOF_VOID_P@
>>
>>
>> diff  --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
>> index 8bc5a9f052f9..cc86e5ac3856 100644
>> --- a/llvm/CMakeLists.txt
>> +++ b/llvm/CMakeLists.txt
>> @@ -671,16 +671,38 @@ option(LLVM_ENABLE_PLUGINS "Enable plugin support"
>> ${LLVM_ENABLE_PLUGINS_default
>>
>>  include(HandleLLVMOptions)
>>
>> -include(FindPythonInterp)
>> -if( NOT PYTHONINTERP_FOUND )
>> -  message(FATAL_ERROR
>> -"Unable to find Python interpreter, required for builds and testing.
>> +if(CMAKE_VERSION VERSION_LESS 3.12)
>> +  include(FindPythonInterp)
>> +  if( NOT PYTHONINTERP_FOUND )
>> +    message(FATAL_ERROR
>> +  "Unable to find Python interpreter, required for builds and testing.
>>
>> -Please install Python or specify the PYTHON_EXECUTABLE CMake variable.")
>> -endif()
>> +  Please install Python or specify the PYTHON_EXECUTABLE CMake
>> variable.")
>> +  endif()
>> +
>> +  if( ${PYTHON_VERSION_STRING} VERSION_LESS 2.7 )
>> +    message(FATAL_ERROR "Python 2.7 or newer is required")
>> +  endif()
>>
>> -if( ${PYTHON_VERSION_STRING} VERSION_LESS 2.7 )
>> -  message(FATAL_ERROR "Python 2.7 or newer is required")
>> +  add_executable(Python3::Interpreter IMPORTED)
>> +  set_target_properties(Python3::Interpreter PROPERTIES
>> +    IMPORTED_LOCATION ${PYTHON_EXECUTABLE})
>> +  set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE})
>> +else()
>> +  find_package(Python3 COMPONENTS Interpreter)
>> +  if(NOT Python3_Interpreter_FOUND)
>> +    message(WARNING "Python3 not found, using python2 as a fallback")
>> +    find_package(Python2 COMPONENTS Interpreter REQUIRED)
>> +    if(Python2_VERSION VERSION_LESS 2.7)
>> +      message(SEND_ERROR "Python 2.7 or newer is required")
>> +    endif()
>> +
>> +    # Treat python2 as python3
>> +    add_executable(Python3::Interpreter IMPORTED)
>> +    set_target_properties(Python3::Interpreter PROPERTIES
>> +      IMPORTED_LOCATION ${Python2_EXECUTABLE})
>> +    set(Python3_EXECUTABLE ${Python2_EXECUTABLE})
>> +  endif()
>>  endif()
>>
>>  ######
>> @@ -716,7 +738,7 @@ endif (LLVM_USE_PERF)
>>
>>  message(STATUS "Constructing LLVMBuild project information")
>>  execute_process(
>> -  COMMAND ${PYTHON_EXECUTABLE} -B ${LLVMBUILDTOOL}
>> +  COMMAND "${Python3_EXECUTABLE}" -B ${LLVMBUILDTOOL}
>>              --native-target "${LLVM_NATIVE_ARCH}"
>>              --enable-targets "${LLVM_TARGETS_TO_BUILD}"
>>              --enable-optional-components "${LLVMOPTIONALCOMPONENTS}"
>>
>> diff  --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake
>> index d9624c42da66..777cfd628a84 100644
>> --- a/llvm/cmake/config-ix.cmake
>> +++ b/llvm/cmake/config-ix.cmake
>> @@ -639,7 +639,7 @@ function(find_python_module module)
>>      return()
>>    endif()
>>
>> -  execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c" "import ${module}"
>> +  execute_process(COMMAND "${Python3_EXECUTABLE}" "-c" "import ${module}"
>>      RESULT_VARIABLE status
>>      ERROR_QUIET)
>>
>>
>> diff  --git a/llvm/cmake/modules/AddLLVM.cmake
>> b/llvm/cmake/modules/AddLLVM.cmake
>> index b77b59240eb1..cc1c122dce3d 100644
>> --- a/llvm/cmake/modules/AddLLVM.cmake
>> +++ b/llvm/cmake/modules/AddLLVM.cmake
>> @@ -117,7 +117,7 @@ function(add_llvm_symbol_exports target_name
>> export_file)
>>      set(native_export_file "${target_name}.def")
>>
>>      add_custom_command(OUTPUT ${native_export_file}
>> -      COMMAND ${PYTHON_EXECUTABLE} -c "import
>> sys;print(''.join(['EXPORTS\\n']+sys.stdin.readlines(),))"
>> +      COMMAND "${Python3_EXECUTABLE}" -c "import
>> sys;print(''.join(['EXPORTS\\n']+sys.stdin.readlines(),))"
>>          < ${export_file} > ${native_export_file}
>>        DEPENDS ${export_file}
>>        VERBATIM
>> @@ -1052,7 +1052,7 @@ function(export_executable_symbols target)
>>        set(mangling itanium)
>>      endif()
>>      add_custom_command(OUTPUT ${exported_symbol_file}
>> -                       COMMAND ${PYTHON_EXECUTABLE}
>> ${LLVM_MAIN_SRC_DIR}/utils/extract_symbols.py --mangling=${mangling}
>> ${static_libs} -o ${exported_symbol_file}
>> +                       COMMAND "${Python3_EXECUTABLE}"
>> ${LLVM_MAIN_SRC_DIR}/utils/extract_symbols.py --mangling=${mangling}
>> ${static_libs} -o ${exported_symbol_file}
>>                         WORKING_DIRECTORY ${LLVM_LIBRARY_OUTPUT_INTDIR}
>>                         DEPENDS
>> ${LLVM_MAIN_SRC_DIR}/utils/extract_symbols.py ${static_libs}
>>                         VERBATIM
>> @@ -1453,7 +1453,7 @@ function(make_paths_relative out_pathlist basedir
>> pathlist)
>>    # empty list entries. So escape the ;s in the list and do the splitting
>>    # ourselves. cmake has no relpath function, so use Python for that.
>>    string(REPLACE ";" "\\;" pathlist_escaped "${pathlist}")
>> -  execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c" "\n
>> +  execute_process(COMMAND "${Python3_EXECUTABLE}" "-c" "\n
>>  import os, sys\n
>>  base = sys.argv[1]
>>  def haslink(p):\n
>> @@ -1528,7 +1528,6 @@ function(configure_lit_site_cfg site_in site_out)
>>    # SHLIBDIR points the build tree.
>>    string(REPLACE "${CMAKE_CFG_INTDIR}" "${LLVM_BUILD_MODE}" SHLIBDIR
>> "${LLVM_SHLIB_OUTPUT_INTDIR}")
>>
>> -  set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})
>>    # FIXME: "ENABLE_SHARED" doesn't make sense, since it is used just for
>>    # plugins. We may rename it.
>>    if(LLVM_ENABLE_PLUGINS)
>> @@ -1686,7 +1685,7 @@ function(add_lit_target target comment)
>>      ALLOW_EXTERNAL
>>      )
>>
>> -  set(LIT_COMMAND
>> "${PYTHON_EXECUTABLE};${lit_base_dir}/${lit_file_name}")
>> +  set(LIT_COMMAND
>> "${Python3_EXECUTABLE};${lit_base_dir}/${lit_file_name}")
>>    list(APPEND LIT_COMMAND ${LIT_ARGS})
>>    foreach(param ${ARG_PARAMS})
>>      list(APPEND LIT_COMMAND --param ${param})
>>
>> diff  --git a/llvm/test/lit.site.cfg.py.in b/llvm/test/lit.site.cfg.py.in
>> index ee9e5941a39e..3797830862f7 100644
>> --- a/llvm/test/lit.site.cfg.py.in
>> +++ b/llvm/test/lit.site.cfg.py.in
>> @@ -12,7 +12,7 @@ config.llvm_shlib_dir = path(r"@SHLIBDIR@")
>>  config.llvm_shlib_ext = "@SHLIBEXT@"
>>  config.llvm_exe_ext = "@EXEEXT@"
>>  config.lit_tools_dir = path(r"@LLVM_LIT_TOOLS_DIR@")
>> -config.python_executable = "@PYTHON_EXECUTABLE@"
>> +config.python_executable = "@Python3_EXECUTABLE@"
>>  config.gold_executable = "@GOLD_EXECUTABLE@"
>>  config.ld64_executable = "@LD64_EXECUTABLE@"
>>  config.ocamlfind_executable = "@OCAMLFIND@"
>>
>> diff  --git a/llvm/tools/llvm-shlib/CMakeLists.txt
>> b/llvm/tools/llvm-shlib/CMakeLists.txt
>> index eb42abfc1d40..563e4a100dc4 100644
>> --- a/llvm/tools/llvm-shlib/CMakeLists.txt
>> +++ b/llvm/tools/llvm-shlib/CMakeLists.txt
>> @@ -164,7 +164,7 @@ if(LLVM_BUILD_LLVM_C_DYLIB AND MSVC)
>>    endif()
>>
>>    add_custom_command(OUTPUT ${LLVM_EXPORTED_SYMBOL_FILE}
>> -    COMMAND ${PYTHON_EXECUTABLE} ${GEN_SCRIPT} --libsfile ${LIBSFILE}
>> ${GEN_UNDERSCORE} --nm "${llvm_nm}" -o ${LLVM_EXPORTED_SYMBOL_FILE}
>> +    COMMAND "${Python3_EXECUTABLE}" ${GEN_SCRIPT} --libsfile ${LIBSFILE}
>> ${GEN_UNDERSCORE} --nm "${llvm_nm}" -o ${LLVM_EXPORTED_SYMBOL_FILE}
>>      DEPENDS ${LIB_NAMES} ${llvm_nm_target}
>>      COMMENT "Generating export list for LLVM-C"
>>      VERBATIM )
>>
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200428/7d73652c/attachment-0001.html>


More information about the llvm-commits mailing list