<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/88780>88780</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
-mmacosx-version-min breaks arch detection for compiler-rt
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
jfgoog
</td>
</tr>
</table>
<pre>
I'm filing this bug as requested by @cjappl in https://github.com/llvm/llvm-project/pull/74394.
As noted in https://github.com/rust-lang/rust/pull/122504#issuecomment-2035091552, passing `-mmacosx-version-min` as a command line seems to break arch detection for compiler-rt.
In compiler-rt/cmake/config-ix.cmake we have:
```cmake
set(DARWIN_osx_MIN_VER_FLAG "-mmacosx-version-min")
string(REGEX MATCH "${DARWIN_osx_MIN_VER_FLAG}=([.0-9]+)"
MACOSX_VERSION_MIN_FLAG "${CMAKE_CXX_FLAGS}")
```
and then, later:
```cmake
if(NOT MACOSX_VERSION_MIN_FLAG)
darwin_test_archs(osx
DARWIN_osx_ARCHS
${toolchain_arches})
message(STATUS "OSX supported arches: ${DARWIN_osx_ARCHS}")
```
So, specifying `-mmacosx-version-min` on Darwin results in no architectures being detected for compiler-rt, and the build therefore fails.
This seems incorrect, and is currently preventing the Rust compiler from updating a key dependency -- the `cc` crate for compiling C and C++ code.
@yln @vitalybuka and @petrhosek: can any of you shed some light here on whether this is expected behavior?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVUFzozgT_TXypQuXEGDjAwdixzOp70tSFWd3c3MJaEATIbGScOJ_vyWRzDi7MzuzqZShJPXrfq9bD26t6BRiQbIrku0WfHK9NsWXttO6W1S6ORc3hK0HaIUUqgPXCwvV1AG3YPDPCa3DBqozkJTWX_g4ShAKeudGS5KSsD1h-064fqqWtR4I20t5en9Eo9FfsHaE7cdJSsL26zTZpEtCd4SW829pQWmf4t9RzWRdJLnq3t6_QcaMZTQlL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