[llvm-branch-commits] [llvm] release/19.x: Revert "[LLVM] Silence compiler-rt warning in runtimes build (#99525)" (PR #102475)
Peter Waller via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Aug 8 07:49:57 PDT 2024
peterwaller-arm wrote:
Bad case:
```
/home/ubuntu/llvm-project/compiler-rt/lib/builtins/CMakeLists.txt(29): load_llvm_config()
/home/ubuntu/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake(289): if(LLVM_CONFIG_PATH AND NOT LLVM_CMAKE_DIR )
/home/ubuntu/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake(303): get_compiler_rt_root_source_dir(COMPILER_RT_ROOT_SRC_PATH )
/home/ubuntu/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake(245): if(${ROOT_DIR_VAR} STREQUAL )
/home/ubuntu/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake(251): set(PATH_TO_COMPILER_RT_SOURCE_ROOT )
/home/ubuntu/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake(252): if(DEFINED CompilerRTBuiltins_SOURCE_DIR )
/home/ubuntu/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake(255): set(PATH_TO_COMPILER_RT_SOURCE_ROOT ${CompilerRTBuiltins_SOURCE_DIR}/../../ )
/home/ubuntu/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake(273): get_filename_component(ROOT_DIR ${PATH_TO_COMPILER_RT_SOURCE_ROOT} ABSOLUTE )
/home/ubuntu/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake(274): if(NOT EXISTS ${ROOT_DIR} )
/home/ubuntu/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake(280): set(PATH_TO_CURRENT_FILE ${ROOT_DIR}/cmake/Modules/CompilerRTUtils.cmake )
/home/ubuntu/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake(281): if(NOT EXISTS ${PATH_TO_CURRENT_FILE} )
/home/ubuntu/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake(285): set(${ROOT_DIR_VAR} ${ROOT_DIR} PARENT_SCOPE )
/home/ubuntu/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake(304): get_filename_component(LLVM_MAIN_SRC_DIR_DEFAULT ${COMPILER_RT_ROOT_SRC_PATH}/../llvm ABSOLUTE )
/home/ubuntu/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake(305): if(NOT EXISTS ${LLVM_MAIN_SRC_DIR_DEFAULT} )
/home/ubuntu/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake(312): find_package(LLVM HINTS ${LLVM_CMAKE_DIR} )
/usr/lib/llvm-14/cmake/LLVMConfigVersion.cmake(1): set(PACKAGE_VERSION 14.0.0 )
/usr/lib/llvm-14/cmake/LLVMConfigVersion.cmake(5): if(14.0 VERSION_EQUAL ${PACKAGE_FIND_VERSION_MAJOR}.${PACKAGE_FIND_VERSION_MINOR} AND NOT 0 VERSION_LESS ${PACKAGE_FIND_VERSION_PATCH} )
```
Good case:
```
/home/ubuntu/llvm-project/compiler-rt/lib/builtins/CMakeLists.txt(28): if(NOT LLVM_RUNTIMES_BUILD )
/home/ubuntu/llvm-project/compiler-rt/lib/builtins/CMakeLists.txt(29): load_llvm_config()
/home/ubuntu/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake(289): if(LLVM_CONFIG_PATH AND NOT LLVM_CMAKE_DIR )
/home/ubuntu/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake(290): message(WARNING LLVM_CONFIG_PATH is deprecated, please use LLVM_CMAKE_DIR instead )
CMake Warning at /home/ubuntu/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake:290 (message):
LLVM_CONFIG_PATH is deprecated, please use LLVM_CMAKE_DIR instead
Call Stack (most recent call first):
CMakeLists.txt:29 (load_llvm_config)
/home/ubuntu/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake(296): get_filename_component(LLVM_CMAKE_DIR ${LLVM_CONFIG_PATH} DIRECTORY )
/home/ubuntu/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake(297): get_filename_component(LLVM_CMAKE_DIR ${LLVM_CMAKE_DIR} DIRECTORY )
/home/ubuntu/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake(303): get_compiler_rt_root_source_dir(COMPILER_RT_ROOT_SRC_PATH )
/home/ubuntu/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake(245): if(${ROOT_DIR_VAR} STREQUAL )
/home/ubuntu/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake(251): set(PATH_TO_COMPILER_RT_SOURCE_ROOT )
/home/ubuntu/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake(252): if(DEFINED CompilerRTBuiltins_SOURCE_DIR )
/home/ubuntu/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake(255): set(PATH_TO_COMPILER_RT_SOURCE_ROOT ${CompilerRTBuiltins_SOURCE_DIR}/../../ )
/home/ubuntu/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake(273): get_filename_component(ROOT_DIR ${PATH_TO_COMPILER_RT_SOURCE_ROOT} ABSOLUTE )
/home/ubuntu/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake(274): if(NOT EXISTS ${ROOT_DIR} )
/home/ubuntu/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake(280): set(PATH_TO_CURRENT_FILE ${ROOT_DIR}/cmake/Modules/CompilerRTUtils.cmake )
/home/ubuntu/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake(281): if(NOT EXISTS ${PATH_TO_CURRENT_FILE} )
/home/ubuntu/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake(285): set(${ROOT_DIR_VAR} ${ROOT_DIR} PARENT_SCOPE )
/home/ubuntu/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake(304): get_filename_component(LLVM_MAIN_SRC_DIR_DEFAULT ${COMPILER_RT_ROOT_SRC_PATH}/../llvm ABSOLUTE )
/home/ubuntu/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake(305): if(NOT EXISTS ${LLVM_MAIN_SRC_DIR_DEFAULT} )
/home/ubuntu/llvm-project/compiler-rt/cmake/Modules/CompilerRTUtils.cmake(312): find_package(LLVM HINTS ${LLVM_CMAKE_DIR} )
/home/ubuntu/bld4/lib/cmake/llvm/LLVMConfigVersion.cmake(1): set(PACKAGE_VERSION 19.1.0-rc2 )
/home/ubuntu/bld4/lib/cmake/llvm/LLVMConfigVersion.cmake(5): if(19.1 VERSION_EQUAL ${PACKAGE_FIND_VERSION_MAJOR}.${PACKAGE_FIND_VERSION_MINOR} AND NOT 0 VERSION_LESS ${PACKAGE_FIND_VERSION_PATCH} )
```
It appears that in the bad case, `LLVM_CMAKE_DIR` during the `find_package` is set to `/home/ubuntu/llvm-project/llvm/cmake/modules`. In the good case, it's set to `/home/ubuntu/bld`.
https://github.com/llvm/llvm-project/pull/102475
More information about the llvm-branch-commits
mailing list