[libc-commits] [libc] [libc] Pass -c to compiler when detecting target (PR #197012)

Nico Weber via libc-commits libc-commits at lists.llvm.org
Mon May 11 11:49:13 PDT 2026


https://github.com/nico created https://github.com/llvm/llvm-project/pull/197012

Follow-up to #176680 where I claimed having done this, but apparantly didn't actually add it to the commit.

Hopefully no observable behavior change; will tell the compiler to omit linker info in its output, which we don't need for this detection step.

>From 10c39b71531b32ad4673b335b319b6687a032b2c Mon Sep 17 00:00:00 2001
From: Nico Weber <thakis at chromium.org>
Date: Mon, 11 May 2026 14:47:32 -0400
Subject: [PATCH] [libc] Pass -c to compiler when detecting target

Follow-up to #176680 where I claimed having done this, but apparantly
didn't actually add it to the commit.

Hopefully no observable behavior change; will tell the compiler to
omit linker info in its output, which we don't need for this detection
step.
---
 libc/cmake/modules/LLVMLibCArchitectures.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libc/cmake/modules/LLVMLibCArchitectures.cmake b/libc/cmake/modules/LLVMLibCArchitectures.cmake
index 8ada45dd07cec..095531c0f6bec 100644
--- a/libc/cmake/modules/LLVMLibCArchitectures.cmake
+++ b/libc/cmake/modules/LLVMLibCArchitectures.cmake
@@ -78,7 +78,7 @@ function(get_arch_and_system_from_triple triple arch_var sys_var)
   set(${sys_var} ${target_sys} PARENT_SCOPE)
 endfunction(get_arch_and_system_from_triple)
 
-execute_process(COMMAND ${CMAKE_CXX_COMPILER} -v
+execute_process(COMMAND ${CMAKE_CXX_COMPILER} -c -v
                 RESULT_VARIABLE libc_compiler_info_result
                 OUTPUT_VARIABLE libc_compiler_info
                 ERROR_VARIABLE libc_compiler_info)



More information about the libc-commits mailing list