Skip to content

Comments

gh-144942: Fix macOS dylib build by adding $(MODLIBS) and removing -undefined dy…#145186

Open
gourijain029-del wants to merge 1 commit intopython:mainfrom
gourijain029-del:fix-macos-dylib-missing-modlibs
Open

gh-144942: Fix macOS dylib build by adding $(MODLIBS) and removing -undefined dy…#145186
gourijain029-del wants to merge 1 commit intopython:mainfrom
gourijain029-del:fix-macos-dylib-missing-modlibs

Conversation

@gourijain029-del
Copy link

PR Title
gh-144942: Add $(MODLIBS) to macOS dylib build and remove -undefined dynamic_lookup

PR Description
Summary
This PR fixes an issue where the macOS libpython.dylib was missing $(MODLIBS) in its link command. This caused modules built statically (e.g., via

Modules/Setup.local
) to have their symbols omitted from the dynamic library, leading to runtime failures.

Additionally, this PR removes -undefined dynamic_lookup from the dylib link command. This ensures that any missing symbols are caught at build-time rather than resulting in null pointer dereferences or silent failures at runtime.

Changes
Updated

Makefile.pre.in
to include $(MODLIBS) when linking libpython$(LDVERSION).dylib.
Removed -undefined dynamic_lookup from the same link command to enforce symbol resolution at build-time.

@bedevere-app
Copy link

bedevere-app bot commented Feb 24, 2026

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@StanFromIreland StanFromIreland changed the title Fix macOS dylib build by adding $(MODLIBS) and removing -undefined dy… gh-144942: Fix macOS dylib build by adding $(MODLIBS) and removing -undefined dy… Feb 24, 2026
@bedevere-app
Copy link

bedevere-app bot commented Feb 25, 2026

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@python-cla-bot
Copy link

python-cla-bot bot commented Feb 25, 2026

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app
Copy link

bedevere-app bot commented Feb 25, 2026

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@gourijain029-del gourijain029-del force-pushed the fix-macos-dylib-missing-modlibs branch 2 times, most recently from eeb5f4f to 10eb5ad Compare February 25, 2026 06:35
@gourijain029-del gourijain029-del force-pushed the fix-macos-dylib-missing-modlibs branch from 10eb5ad to b76620c Compare February 25, 2026 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant