Skip to content

macOS: -undefined dynamic_lookup for extension modules - #15

Merged
PhilipDeegan merged 1 commit into
masterfrom
macos_dynamic_lookup
Nov 7, 2026
Merged

PhilipDeegan merged 1 commit into
masterfrom
macos_dynamic_lookup

Conversation

@PhilipDeegan

Copy link
Copy Markdown
Member

On macOS, a shared (non embed) build gets -undefined dynamic_lookup, so an extension module resolves the Python C API from the interpreter that loads it rather than linking libpython, the usual way to build extension modules there.

#if defined(__APPLE__)
  if (!embed && a.state().buildMode != mkn::mod::Mode::STAT)
    a.compilerState().add(mkn::mod::LinkPrefixInput{"-undefined dynamic_lookup"});
#endif

No change on other platforms. Built with -W 9 on Linux; macOS CI is the check.

@PhilipDeegan
PhilipDeegan merged commit 9923e9d into master Nov 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant