Skip to content

Commit f3a1485

Browse files
committed
fix(compat.opencv): --no-default-config on macOS — end libc++ header/dylib skew
xim:llvm's macOS clang++.cfg supplies LLVM-20 libc++ HEADERS but links the SDK's Apple system libc++ DYLIB. OpenCV's unordered_map<string,…> code emits the LLVM-20 out-of-line std::__1::__hash_memory, absent in the runner's older Apple libc++ -> undefined symbol at consumer link. --no-default-config drops xim's cfg so OpenCV builds against the SDK's own libc++ headers (matching the dylib everything links); SDKROOT still supplies the sysroot.
1 parent 6d28130 commit f3a1485

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

pkgs/c/compat.opencv.lua

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,19 @@ local function _install_impl()
232232
-- bake in a default sysroot the way Xcode's /usr/bin/clang does. Point it at
233233
-- the active SDK so <stdio.h>/frameworks resolve. xcrun is present on the
234234
-- runner; the command substitution runs inside the build's bash.
235-
libenv = "export SDKROOT=\"$(xcrun --show-sdk-path)\" && "
235+
--
236+
-- --no-default-config resolves a libc++ header/dylib SKEW: xim:llvm's
237+
-- clang++.cfg wires ITS OWN LLVM-20 libc++ headers (-isystem <llvm>/include/
238+
-- c++/v1) but links against the SDK's Apple system libc++ dylib. OpenCV's
239+
-- unordered_map<string,…> code (persistence.cpp/logtagmanager.cpp) then
240+
-- emits the LLVM-20 out-of-line std::__1::__hash_memory, which the runner's
241+
-- older Apple libc++ doesn't export -> undefined symbol at the consumer link.
242+
-- Dropping the default config makes clang build OpenCV against the SDK's own
243+
-- (Apple) libc++ headers — matching the dylib everything links — so no
244+
-- newer-than-dylib symbol is emitted. SDKROOT (exported here) still supplies
245+
-- the sysroot, so headers/frameworks resolve without the cfg.
246+
libenv = "export SDKROOT=\"$(xcrun --show-sdk-path)\" "
247+
.. "CFLAGS='--no-default-config' CXXFLAGS='--no-default-config' && "
236248
else
237249
local glibc_bd = pkginfo.build_dep("glibc")
238250
local gcc_bd = pkginfo.build_dep("gcc")

0 commit comments

Comments
 (0)