-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Fixed cmake config in case of LLVM_ENABLE_RPMALLOC=ON and non MSVC compiler #139770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-llvm-support Author: Dmitry Vasilyev (slydiman) ChangesThis patch fixes the following error in case of LLVM_ENABLE_RPMALLOC=ON and clang or other non MSVC compiler:
Note Full diff: https://github.com/llvm/llvm-project/pull/139770.diff 1 Files Affected:
diff --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt
index df1e65f3a588c..a4c6dde6a57ff 100644
--- a/llvm/lib/Support/CMakeLists.txt
+++ b/llvm/lib/Support/CMakeLists.txt
@@ -113,6 +113,7 @@ if(LLVM_INTEGRATED_CRT_ALLOC)
add_compile_definitions(ENABLE_OVERRIDE ENABLE_PRELOAD)
set(ALLOCATOR_FILES "${LLVM_INTEGRATED_CRT_ALLOC}/rpmalloc/rpmalloc.c")
set(delayload_flags "${delayload_flags} ${WL}-INCLUDE:malloc")
+ string(STRIP ${delayload_flags} delayload_flags)
elseif(LLVM_INTEGRATED_CRT_ALLOC MATCHES "snmalloc$")
set(ALLOCATOR_FILES "${LLVM_INTEGRATED_CRT_ALLOC}/src/snmalloc/override/new.cc")
set(system_libs ${system_libs} "mincore.lib" "${WL}-INCLUDE:malloc")
|
…mpiler 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) ``` The behavior is the same with CMake 3.25.3 and 4.0.2
cdcb1b7
to
ab24e01
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Assuming you've verified that this works, because I did not. Also please wait for pre-commit to finish before landing.
Thanks. I will complete tests with LLVM_ENABLE_RPMALLOC before commit. No rush. |
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/136/builds/3932 Here is the relevant piece of the build log for the reference
|
It seems the DNS resolver failed on this buildbot. This fail is not related to this patch. |
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/146/builds/2937 Here is the relevant piece of the build log for the reference
|
lld-x86_64-win seems flaky. This fail is not related to this patch. |
…mpiler (llvm#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.
This patch fixes the following error in case of LLVM_ENABLE_RPMALLOC=ON and clang or other non MSVC compiler:
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.