See #121819 for background context
This may become a problem in the future, but for now it won't actually happen unless libunwind does switch to using -fexceptions to compile the whole library
To build a libunwind that reproduces this problem, we need to hack the build system:
-DLIBUNWIND_ENABLE_SHARED=OFF
-DCXX_SUPPORTS_FNO_EXCEPTIONS_FLAG=OFF
-DCMAKE_C_FLAGS=“-flto=thin”
-DCMAKE_CXX_FLAGS=“-flto=thin”
Then use -flto=thin to compile any source and link them with libunwind.a:
x86_64-w64-mingw32-clang -flto=thin test.c --static
lld-link: error: undefined symbol: __gxx_personality_seh0
>>> referenced by llvm-project/libunwind/src/libunwind.cpp
>>> libunwind.a(libunwind.cpp.obj)
report.zip (lld reproduce)