Skip to content

Enable os.memfd_create through runtime weak linking#1164

Merged
jjhelmus merged 5 commits into
mainfrom
jjh/weak_sym_memfd_create
Jul 10, 2026
Merged

Enable os.memfd_create through runtime weak linking#1164
jjhelmus merged 5 commits into
mainfrom
jjh/weak_sym_memfd_create

Conversation

@jjhelmus

Copy link
Copy Markdown
Contributor

Always build CPython with os.memfd_create but remove the Python function from the namespace at runtime when glibc does not provide the an implementation.

This is accomplished using a weak memfd_create symbol which is evaluated at runtime.

This requires the modern kernel UAPI headers from #1163 to define the MFD_* constants.

@jjhelmus jjhelmus added platform:linux Specific to the Linux platform arch:all Select all architectures labels Jun 24, 2026
@zanieb

zanieb commented Jun 24, 2026

Copy link
Copy Markdown
Member

We should definitely try to upstream any weak linking implementations

@jjhelmus jjhelmus force-pushed the jjh/weak_sym_memfd_create branch from 6f97a40 to 42a149a Compare July 9, 2026 21:08
@jjhelmus

jjhelmus commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Rebased on top of merged #1163

@jjhelmus jjhelmus added libc:gnu build:all python:all Select all Python versions labels Jul 10, 2026
@jjhelmus jjhelmus merged commit 89de021 into main Jul 10, 2026
241 checks passed
@jjhelmus jjhelmus deleted the jjh/weak_sym_memfd_create branch July 10, 2026 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arch:all Select all architectures build:all libc:gnu platform:linux Specific to the Linux platform python:all Select all Python versions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants