Skip to content

Commit 4a4f0ff

Browse files
authored
Fixed cmake config in case of LLVM_ENABLE_RPMALLOC=ON and non MSVC compiler (#139770)
This patch fixes the following error in case of LLVM_ENABLE_RPMALLOC=ON and clang or other non MSVC compiler: ``` CMake Error at cmake/modules/AddLLVM.cmake:644 (add_library): Target "LLVMSupport" links to item " -INCLUDE:malloc" which has leading or trailing whitespace. This is now an error according to policy CMP0004. Call Stack (most recent call first): cmake/modules/AddLLVM.cmake:944 (llvm_add_library) cmake/modules/AddLLVM.cmake:917 (add_llvm_library) lib/Support/CMakeLists.txt:139 (add_llvm_component_library) ``` Note `delayload_flags` is empty before this line is case of non MSVC compiler. The behavior is the same with CMake 3.25.3 and 4.0.2.
1 parent 3def997 commit 4a4f0ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Support/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ if(LLVM_INTEGRATED_CRT_ALLOC)
112112
if((LLVM_INTEGRATED_CRT_ALLOC MATCHES "rpmalloc$") OR LLVM_ENABLE_RPMALLOC)
113113
add_compile_definitions(ENABLE_OVERRIDE ENABLE_PRELOAD)
114114
set(ALLOCATOR_FILES "${LLVM_INTEGRATED_CRT_ALLOC}/rpmalloc/rpmalloc.c")
115-
set(delayload_flags "${delayload_flags} ${WL}-INCLUDE:malloc")
115+
list(APPEND delayload_flags "${WL}-INCLUDE:malloc")
116116
elseif(LLVM_INTEGRATED_CRT_ALLOC MATCHES "snmalloc$")
117117
set(ALLOCATOR_FILES "${LLVM_INTEGRATED_CRT_ALLOC}/src/snmalloc/override/new.cc")
118118
set(system_libs ${system_libs} "mincore.lib" "${WL}-INCLUDE:malloc")

0 commit comments

Comments
 (0)