[libcxx-commits] [libcxx] [libc++] Add std::stacktrace (P0881R7) (PR #136528)
Steve O'Brien via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Nov 15 16:33:52 PST 2025
================
@@ -248,6 +254,11 @@ if (LIBCXX_ENABLE_SHARED)
list(APPEND LIBCXX_BUILD_TARGETS "cxx_shared")
endif()
+if(WIN32)
+ string(APPEND link_libraries " ${CMAKE_LINK_LIBRARY_FLAG}dbghelp")
+ string(APPEND link_libraries " ${CMAKE_LINK_LIBRARY_FLAG}psapi")
+endif()
+
----------------
elsteveogrande wrote:
TODO: this didn't seem to fix link issues:
```
FAILED: [code=1] lib/libc++.dll lib/libc++.dll.a
C:\Windows\system32\cmd.exe /C "cd . && C:\llvm-mingw\bin\c++.exe -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -ffunction-sections -fdata-sections -O2 -g -DNDEBUG -shared -o lib\libc++.dll -Wl,--out-implib,lib\libc++.dll.a -Wl,--major-image-version,1,--minor-image-version,0 libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/cxa_aux_runtime.cpp.obj libcxxabi/src/CMakeFiles/cxxabi_shared_objects.dir/cxa_default_handlers.cpp.obj
[ . . . ]
libcxx/src/CMakeFiles/cxx_shared.dir/filesystem/directory_iterator.cpp.obj libcxx/src/CMakeFiles/cxx_shared.dir/filesystem/operations.cpp.obj -nostdlib++ --unwindlib=none lib/libunwind.dll.a -lpthread -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
ld.lld: error: undefined symbol: __declspec(dllimport) SymInitialize
>>> referenced by D:/a/llvm-project/llvm-project/libcxx/src/stacktrace/windows_impl.cpp:35
>>> libcxx/src/CMakeFiles/cxx_shared.dir/stacktrace/windows_impl.cpp.obj:(std::__1::__stacktrace::_Trace::windows_impl(unsigned long long, unsigned long long))
```
https://github.com/llvm/llvm-project/pull/136528
More information about the libcxx-commits
mailing list