@@ -153,24 +153,14 @@ int main(int argc, char** argv)
153153 errs ().flush ();
154154 }
155155
156- // FIX TEST: orc_rt.a statically links a partial libc++abi, so the add-on
157- // resolves the cxxabi RTTI vtables + __dynamic_cast to orc_rt's copies in the
158- // slab instead of the host libc++.dll. orc_rt's __vmi vtable is incomplete ->
159- // multiple-inheritance dynamic_cast crashes. Pin these to the host copies.
160- {
161- auto & ES = (*jit)->getExecutionSession ();
162- SymbolMap host;
163- for (const char * sym :
164- {" _ZTVN10__cxxabiv117__class_type_infoE" ,
165- " _ZTVN10__cxxabiv120__si_class_type_infoE" ,
166- " _ZTVN10__cxxabiv121__vmi_class_type_infoE" , " __dynamic_cast" })
167- {
168- if (void * a = sys::DynamicLibrary::SearchForAddressOfSymbol (sym))
169- host[ES .intern (sym)] = {ExecutorAddr::fromPtr (a), JITSymbolFlags::Exported};
170- }
171- if (auto E = JD .define (absoluteSymbols (std::move (host))))
172- fail (" pin cxxabi to host" , std::move (E));
173- }
156+ // FIX TEST: keep orc_rt's PlatformJD (which statically embeds a partial
157+ // libc++abi -- incomplete __vmi RTTI) out of the ADD-ON's link order. The
158+ // add-on's own code only needs the host libc++ + its own symbols; the platform
159+ // uses orc_rt internally (section registration / init), not via the add-on's
160+ // symbol resolution. So resolve the add-on against the host process only.
161+ JD .setLinkOrder (
162+ makeJITDylibSearchOrder (&JD , JITDylibLookupFlags::MatchAllSymbols),
163+ /* LinkAgainstThisJITDylibFirst=*/ false );
174164
175165 // x86_64-w64-windows-gnu always lowers thread_local through emulated TLS
176166 // (__emutls_get_address); compiler-rt provides it but the host exe doesn't
0 commit comments