From c88e1de7277a788976deecf68774f564acef86a2 Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Wed, 21 Oct 2026 22:13:44 -0700 Subject: [PATCH] [mypyc] hide internal symbols Codex claims this is about a 5% speed-up on self check on Linux Authored by Codex --- mypyc/build.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mypyc/build.py b/mypyc/build.py index e61c09a463ee..9050eef18d27 100644 --- a/mypyc/build.py +++ b/mypyc/build.py @@ -843,6 +843,9 @@ def get_cflags( cflags += [ f"-O{opt_level}", f"-g{debug_level}", + # Native groups exchange functions and data through export capsules. + # PyMODINIT_FUNC keeps Python module entry points publicly visible. + "-fvisibility=hidden", "-Werror", "-Wno-unused-function", "-Wno-unused-label",