[clang] d893692 - [CMake] Pass through CMAKE_READELF to subbuilds

Petr Hosek via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 24 18:20:59 PDT 2021


Author: Petr Hosek
Date: 2021-09-24T18:20:30-07:00
New Revision: d893692024b8f05c63329f9a4e5f2432380be27c

URL: https://github.com/llvm/llvm-project/commit/d893692024b8f05c63329f9a4e5f2432380be27c
DIFF: https://github.com/llvm/llvm-project/commit/d893692024b8f05c63329f9a4e5f2432380be27c.diff

LOG: [CMake] Pass through CMAKE_READELF to subbuilds

This matches handling of other CMake variables.

Differential Revision: https://reviews.llvm.org/D110463

Added: 
    

Modified: 
    clang/CMakeLists.txt
    compiler-rt/cmake/Modules/AddCompilerRT.cmake
    llvm/cmake/modules/LLVMExternalProjectUtils.cmake

Removed: 
    


################################################################################
diff  --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index 6e18e74c6294c..f562c73af3fef 100644
--- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt
@@ -759,6 +759,7 @@ if (CLANG_ENABLE_BOOTSTRAP)
       add_dependencies(clang-bootstrap-deps llvm-objcopy llvm-strip)
       set(${CLANG_STAGE}_OBJCOPY -DCMAKE_OBJCOPY=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-objcopy)
       set(${CLANG_STAGE}_STRIP -DCMAKE_STRIP=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-strip)
+      set(${CLANG_STAGE}_READELF -DCMAKE_READELF=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-readelf)
     endif()
   endif()
 

diff  --git a/compiler-rt/cmake/Modules/AddCompilerRT.cmake b/compiler-rt/cmake/Modules/AddCompilerRT.cmake
index 97d898f394b9f..8b620786730b5 100644
--- a/compiler-rt/cmake/Modules/AddCompilerRT.cmake
+++ b/compiler-rt/cmake/Modules/AddCompilerRT.cmake
@@ -598,6 +598,7 @@ macro(add_custom_libcxx name prefix)
     CMAKE_OBJCOPY
     CMAKE_OBJDUMP
     CMAKE_STRIP
+    CMAKE_READELF
     CMAKE_SYSROOT
     LIBCXX_HAS_MUSL_LIBC
     PYTHON_EXECUTABLE

diff  --git a/llvm/cmake/modules/LLVMExternalProjectUtils.cmake b/llvm/cmake/modules/LLVMExternalProjectUtils.cmake
index 61f351c98ea44..5f19098614db7 100644
--- a/llvm/cmake/modules/LLVMExternalProjectUtils.cmake
+++ b/llvm/cmake/modules/LLVMExternalProjectUtils.cmake
@@ -244,7 +244,8 @@ function(llvm_ExternalProject_Add name source_dir)
                       -DCMAKE_NM=${CMAKE_NM}
                       -DCMAKE_OBJCOPY=${CMAKE_OBJCOPY}
                       -DCMAKE_OBJDUMP=${CMAKE_OBJDUMP}
-                      -DCMAKE_STRIP=${CMAKE_STRIP})
+                      -DCMAKE_STRIP=${CMAKE_STRIP}
+                      -DCMAKE_READELF=${CMAKE_READELF})
     set(llvm_config_path ${LLVM_CONFIG_PATH})
 
     if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")


        


More information about the cfe-commits mailing list