export CC=$(brew --prefix llvm)/bin/clang
export CXX=$(brew --prefix llvm)/bin/clang++
$CC --version
Homebrew clang version 23.1.7
Target: arm64-apple-darwin27.2.0
Thread model: posix
InstalledDir: /opt/homebrew/Cellar/llvm/23.1.7/bin
Configuration file: /opt/homebrew/Cellar/llvm/23.1.7/etc/clang/arm64-apple-darwin27.cfg
make -C depends
<snip>
Building qt...
[11/1262] Building CXX object qtbase/src/corelib/CMakeFiles/Core.dir/global/qsimd.cpp.o
FAILED: [code=1] qtbase/src/corelib/CMakeFiles/Core.dir/global/qsimd.cpp.o
/opt/homebrew/opt/llvm/bin/clang++ -DGL_SILENCE_DEPRECATION -DPCRE2_CODE_UNIT_WIDTH=16 -DQT_ASCII_CAST_WARNINGS -DQT_BUILDING_QT -DQT_BUILD_CORE_LIB -DQT_DEPRECATED_WARNINGS -DQT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH -DQT_LEAN_HEADERS=1 -DQT_MOC_COMPAT -DQT_NO_CAST_TO_ASCII -DQT_NO_CONTEXTLESS_CONNECT -DQT_NO_DEBUG -DQT_NO_FOREACH -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_QASCONST -DQT_NO_QEXCHANGE -DQT_NO_QPAIR -DQT_NO_QSNPRINTF -DQT_NO_USING_NAMESPACE -DQT_TYPESAFE_FLAGS -DQT_USE_NODISCARD_FILE_OPEN -DQT_USE_QSTRINGBUILDER -DQT_ZLIB_LIB -D_DARWIN_C_SOURCE -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST
<snip>
/Users/bitcoin/depends/work/build/aarch64-apple-darwin27.2.0/qt/6.8.4-b86f2fcc9b0/qtbase/src/corelib/global/qsimd.cpp:574:25: error: use of undeclared identifier 'getenv'; did you mean 'qgetenv'?
macOS: Qt build broken with `brew` Clang #37101
issue fanquake opened this issue on December 4, 2026-
fanquake commented at 1:36 PM on December 4, 2026: member
- fanquake added the label GUI on Dec 4, 2026
- fanquake added the label macOS on Dec 4, 2026
-
hebasto commented at 1:57 PM on December 4, 2026: member
This is fixed upstream in https://github.com/qt/qtbase/commit/e72d6e46282e476290e657a434ceeeaea40625f7.
I'll submit a PR to apply this patch in our depends.