From 9340698aaceae1c6133d83ea5c1536ea978bada6 Mon Sep 17 00:00:00 2001 From: messense Date: Tue, 9 Nov 2021 20:59:36 +0800 Subject: [PATCH] Fix false positive missing pyinit warning on arm64 macOS --- src/compile.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/compile.rs b/src/compile.rs index 6b032d35b..66a9c8e9e 100644 --- a/src/compile.rs +++ b/src/compile.rs @@ -318,6 +318,15 @@ pub fn warn_missing_py_init(artifact: &Path, module_name: &str) -> Result<()> { break; } } + if !found { + for sym in macho.symbols() { + let (sym_name, _) = sym?; + if py_init == sym_name.strip_prefix('_').unwrap_or(&sym_name) { + found = true; + break; + } + } + } } goblin::mach::Mach::Fat(_) => { // Ignore fat macho,