chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
// Zig's std.debug stack-trace symbolication (pulled in by the embed lib's
|
||||
// panic path) references `_dyld_get_image_header_containing_address`, which
|
||||
// the iOS SDK marks __API_UNAVAILABLE(ios). Provide the documented
|
||||
// replacement (dladdr) under the old symbol so the static lib links; it
|
||||
// only runs while formatting a panic trace. Mirrors the same shim in the
|
||||
// mobile-canvas example's ObjC host (examples/mobile-canvas/ios/main.m).
|
||||
|
||||
#include <dlfcn.h>
|
||||
#include <mach-o/dyld.h>
|
||||
#include <stddef.h>
|
||||
|
||||
const struct mach_header *_dyld_get_image_header_containing_address(const void *address) {
|
||||
Dl_info info;
|
||||
if (dladdr(address, &info) != 0 && info.dli_fbase != NULL) {
|
||||
return (const struct mach_header *)info.dli_fbase;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
Reference in New Issue
Block a user