[compiler-rt] [compiler-rt] Add version info to Windows runtime DLLs (PR #216408)

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 19 13:56:57 PDT 2026


================
@@ -24,6 +25,65 @@ function(set_target_output_directories target output_dir)
   endif()
 endfunction()
 
+function(add_compiler_rt_windows_version_resource_file OUT_VAR RESOURCE_VAR name)
+  set(sources ${ARGN})
+  if(MSVC AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
+    set(resource_file)
+    foreach(candidate_resource_file IN ITEMS
+        "${LLVM_SOURCE_DIR}/resources/windows_version_resource.rc"
+        "${LLVM_MAIN_SRC_DIR}/resources/windows_version_resource.rc"
+        "${LLVM_MAIN_SRC_DIR}/llvm/resources/windows_version_resource.rc")
----------------
rnk wrote:

I would go ahead and duplicate windows_version_resource.rc for compiler-rt instead of doing this, especially to get rid of the ambiguity of the probes.

Do we still support standalone builds? I recall that Fuchsia (cc @ilovepi @petrhosek ) would build compiler-rt, libcxx, and libc by themselves, without LLVM, for efficiency reasons. But, now we have llvm-project/cmake/modules.

Many downstream vendors copy compiler-rt. GCC repackages it as libsanitizer, although I'm sure they don't support Windows. Still, I think more self-contained is better.

https://github.com/llvm/llvm-project/pull/216408


More information about the llvm-commits mailing list