+ if let Some((body, instance)) = self.eval_context_mut().lookup_exported_symbol(link_name)? {
+ // If compiler-builtins is providing the symbol, then don't treat it as a clash.
+ // We'll use our built-in implementation in `emulate_foreign_item_by_name` for increased
+ // performance. Note that this means we won't catch any undefined behavior in
+ // compiler-builtins when running other crates, but Miri can still be run on
+ // compiler-builtins itself (or any crate that uses it as a normal dependency)
+ if self.eval_context_ref().tcx.is_compiler_builtins(instance.def_id().krate) {
+ return Ok(());
+ }
+