<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/113790>113790</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
`check-libc` fails to compile on macOS
</td>
</tr>
<tr>
<th>Labels</th>
<td>
libc
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
duncpro
</td>
</tr>
</table>
<pre>
## Versions
- macOS 15.0.1 MacBook Pro M1
- llvm-project commit 0be1883c36fc19e4020fea12902481c3dd3436d2
## Steps to Reproduce
```sh
LLVM_BIN="$(brew --prefix llvm)/bin"
cd llvm-project
mkdir -p build
cd build
cmake ../runtimes \
-G Ninja \
-DCMAKE_CXX_FLAGS="-I$(xcrun --show-sdk-path)/usr/include -Wno-nullability-completeness" \
-DCMAKE_C_FLAGS="-I$(xcrun --show-sdk-path)/usr/include -Wno-nullability-completeness" \
-DLLVM_ENABLE_RUNTIMES="libc;compiler-rt" \
-DLLVM_LIBC_FULL_BUILD=ON \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_LIBC_INCLUDE_SCUDO=ON \
-DCOMPILER_RT_BUILD_SCUDO_STANDALONE_WITH_LLVM_LIBC=ON \
-DCOMPILER_RT_BUILD_GWP_ASAN=OFF\
-DCOMPILER_RT_SCUDO_STANDALONE_BUILD_SHARED=OFF \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DLLVM_ENABLE_SPHINX=OFF -DLIBC_INCLUDE_DOCS=OFF \
-DLIBC_CMAKE_VERBOSE_LOGGING=ON \
-DCMAKE_C_COMPILER=$LLVM_BIN/clang \
-DCMAKE_CXX_COMPILER=$LLVM_BIN/clang++ \
# Build files have been written to: /Users/duncanproctor/llvm-project/build
ninja libc
# [125/125] Linking CXX static library libc/lib/libc.a
ninja check-libc
# ...
# 15 errors generated.
# [53/1548] Building CXX object libc/test/UnitTest/CMakeFiles/LibcTest.unit.dir/LibcTest.cpp.o
# ninja: build stopped: subcommand failed.
```
## Full Error
```
In file included from /Users/duncanproctor/llvm-project/libc/src/fenv/feraiseexcept.cpp:10:
In file included from /Users/duncanproctor/llvm-project/libc/src/__support/FPUtil/FEnvImpl.h:22:
/Users/duncanproctor/llvm-project/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h:37:7: error: static assertion failed due to requirement 'sizeof(fenv_t) == sizeof(__llvm_libc_20_0_0_git::fputil::FEnv::FPState)': Internal floating point state does not match the public fenv_t type.
37 | sizeof(fenv_t) == sizeof(FPState),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/duncanproctor/llvm-project/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h:37:22: note: expression evaluates to '8 == 16'
37 | sizeof(fenv_t) == sizeof(FPState),
| ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/Users/duncanproctor/llvm-project/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h:72:23: error: use of undeclared identifier 'FE_FLUSHTOZERO'; did you mean 'EX_FLUSHTOZERO'?
72 | ((status & FE_FLUSHTOZERO) ? EX_FLUSHTOZERO : 0);
| ^~~~~~~~~~~~~~
| EX_FLUSHTOZERO
/Users/duncanproctor/llvm-project/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h:56:29: note: 'EX_FLUSHTOZERO' declared here
56 | static constexpr uint32_t EX_FLUSHTOZERO = 0x20;
| ^
/Users/duncanproctor/llvm-project/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h:76:24: error: use of undeclared identifier '__fpcr_trap_invalid'
76 | return ((control & __fpcr_trap_invalid) ? EX_INVALID : 0) |
| ^
/Users/duncanproctor/llvm-project/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h:77:24: error: use of undeclared identifier '__fpcr_trap_divbyzero'
77 | ((control & __fpcr_trap_divbyzero) ? EX_DIVBYZERO : 0) |
| ^
/Users/duncanproctor/llvm-project/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h:78:24: error: use of undeclared identifier '__fpcr_trap_overflow'
78 | ((control & __fpcr_trap_overflow) ? EX_OVERFLOW : 0) |
| ^
/Users/duncanproctor/llvm-project/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h:79:24: error: use of undeclared identifier '__fpcr_trap_underflow'
79 | ((control & __fpcr_trap_underflow) ? EX_UNDERFLOW : 0) |
| ^
/Users/duncanproctor/llvm-project/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h:80:24: error: use of undeclared identifier '__fpcr_trap_inexact'
80 | ((control & __fpcr_trap_inexact) ? EX_INEXACT : 0) |
| ^
/Users/duncanproctor/llvm-project/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h:81:24: error: use of undeclared identifier '__fpcr_flush_to_zero'
81 | ((control & __fpcr_flush_to_zero) ? EX_FLUSHTOZERO : 0);
| ^
/Users/duncanproctor/llvm-project/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h:90:42: error: use of undeclared identifier 'FE_FLUSHTOZERO'; did you mean 'EX_FLUSHTOZERO'?
90 | ((excepts & EX_FLUSHTOZERO) ? FE_FLUSHTOZERO : 0);
| ^~~~~~~~~~~~~~
| EX_FLUSHTOZERO
/Users/duncanproctor/llvm-project/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h:56:29: note: 'EX_FLUSHTOZERO' declared here
56 | static constexpr uint32_t EX_FLUSHTOZERO = 0x20;
| ^
/Users/duncanproctor/llvm-project/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h:94:38: error: use of undeclared identifier '__fpcr_trap_invalid'
94 | return ((excepts & EX_INVALID) ? __fpcr_trap_invalid : 0) |
| ^
/Users/duncanproctor/llvm-project/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h:95:40: error: use of undeclared identifier '__fpcr_trap_divbyzero'
95 | ((excepts & EX_DIVBYZERO) ? __fpcr_trap_divbyzero : 0) |
| ^
/Users/duncanproctor/llvm-project/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h:96:39: error: use of undeclared identifier '__fpcr_trap_overflow'
96 | ((excepts & EX_OVERFLOW) ? __fpcr_trap_overflow : 0) |
| ^
/Users/duncanproctor/llvm-project/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h:97:40: error: use of undeclared identifier '__fpcr_trap_underflow'
97 | ((excepts & EX_UNDERFLOW) ? __fpcr_trap_underflow : 0) |
| ^
/Users/duncanproctor/llvm-project/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h:98:38: error: use of undeclared identifier '__fpcr_trap_inexact'
98 | ((excepts & EX_INEXACT) ? __fpcr_trap_inexact : 0) |
| ^
/Users/duncanproctor/llvm-project/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h:99:42: error: use of undeclared identifier '__fpcr_flush_to_zero'
99 | ((excepts & EX_FLUSHTOZERO) ? __fpcr_flush_to_zero : 0);
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsmV13oroaxz9NvMnCBUEULrxQgY7rWO3S2nGfG1aEULOLCScJfdkX57OfFaDUF7qnczqn48VxZhAhz0t--efxGcFS0ntGyBA4Y-D4HVyoHRfDpGBxLnhny5OXIUA2QDa8I0JSziQwfWCODLjH8WIFLadrdi14jeMx5w_wRnB4bb0OybLHvZEL_ieJFYz5fk8VNLfEcl07tvtpbHmkZyIzJdhCnol6rhXbSWL37H6CKh_1scpgpUguoeJwSXLBkyIm9e2-Wf2Vu-rCbHZ3HY2nc2D7ACGAegC5W0GeoGHkgqT0ucwMIA-gcEuZHnMQLU6OEq8u7h8SKqCRw21Bs6QZePCpvrbHDwR2uwCFomCK7omEwJlUN6FxBeeU_YkPLkEIDX9yPfpHEE02myicja5WVd7GtMr8ORYFg4Yhd_zJkMmDkWO1q5IvpAAopCzOioRA4zvjBiuyDG9pRtWLEfN9nhFFGJESIPRO1K-KafjlugTz0XgWRMv1_HZ6HdRxM7qNgT3WxjQjwhCq1XY2HU-icD2bReP1dOYD21_M22dV3o9u_7gJgO0vSUawJO_4m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