Index: src/runtime/exception.m ================================================================== --- src/runtime/exception.m +++ src/runtime/exception.m @@ -790,21 +790,25 @@ static seh_personality_fn __gxx_personality_seh0; OF_CONSTRUCTOR() { /* - * This only works if the application uses libstdc++-6.dll. - * There is unfortunately no other way, as Windows does not support - * proper weak linking. + * This only works if the application uses libc++.dll or + * libstdc++-6.dll. There is unfortunately no other way, as Windows + * does not support proper weak linking. */ HMODULE module; - if ((module = GetModuleHandle("libstdc++-6")) == NULL) - return; + + module = GetModuleHandle("libc++"); + + if (module == NULL) + module = GetModuleHandle("libstdc++-6"); - __gxx_personality_seh0 = (seh_personality_fn) - GetProcAddress(module, "__gxx_personality_seh0"); + if (module != NULL) + __gxx_personality_seh0 = (seh_personality_fn) + GetProcAddress(module, "__gxx_personality_seh0"); } EXCEPTION_DISPOSITION __gnu_objc_personality_seh0(PEXCEPTION_RECORD ms_exc, void *this_frame, PCONTEXT ms_orig_context, PDISPATCHER_CONTEXT ms_disp)