[libc-commits] [libc] [libc] Generate a stub for libpthread.a (PR #200908)

Roland McGrath via libc-commits libc-commits at lists.llvm.org
Mon Jun 1 12:55:15 PDT 2026


================
@@ -56,6 +56,29 @@ foreach(archive IN ZIP_LISTS
   endif()
 endforeach()
 
+# Add empty archive libraries for compatibility with systems expecting certain
+# bits of libc to be located in separate files (e.g. libpthread).
+if(LLVM_LIBC_FULL_BUILD)
+  set(dummy_source "${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp")
----------------
frobtech wrote:

@petrhosek may have advice on how to get cmake to just let us define a static library with no members.  If it's indeed not possible, then this may be the thing to do.  The pattern of writing a file in the build directory only if it doesn't exist at all seems a bit dubious to me (as opposed to something that ensures it exists with the exact intended contents), but I defer to @petrhosek on normal best practice for such cases in cmake.

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


More information about the libc-commits mailing list