| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
_localemodule.c calls libintl_* (bindtextdomain, dcgettext, ...) when HAVE_LIBINTL_H is defined. HAVE_LIBINTL (the intl library) was added only to CMAKE_REQUIRED_LIBRARIES for configure checks, never to the libpython link libraries. On platforms where libintl is a separate library (e.g. macOS gettext), every target linking libpython -- including the _freeze_importlib bootstrap tool -- then fails with undefined _libintl_* symbols. glibc keeps these functions in libc, so HAVE_LIBINTL is unset there and this is a no-op. Append HAVE_LIBINTL to LIBPYTHON_TARGET_LIBRARIES when found, mirroring the existing HAVE_LIBDL handling and CPython configure's `LIBS += -lintl`.
|
@thewtex This fix was needed to get Slicer built on mac using a pixi environment set of compilers. |
Sorry, something went wrong.
There was a problem hiding this comment.
This looks good to me
Sorry, something went wrong.
|
ping @jamesobutler Do you have merge capabilities here? |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
On macOS, every target linking libpython (including the _freeze_importlib bootstrap tool) fails with undefined _libintl_bindtextdomain / _libintl_dcgettext / _libintl_bind_textdomain_codeset symbols when a separate libintl (gettext) is present.
_localemodule.c calls the libintl_* functions whenever HAVE_LIBINTL_H is defined, but HAVE_LIBINTL (the found intl library) was only added to CMAKE_REQUIRED_LIBRARIES for configure checks — never to the libpython link libraries. This mirrors CPython's own configure, which appends -lintl to LIBS. On glibc the gettext functions live in libc, so HAVE_LIBINTL is unset and this is a no-op.
Fix: append HAVE_LIBINTL to LIBPYTHON_TARGET_LIBRARIES when found, mirroring the adjacent HAVE_LIBDL handling.
Reproduction / validationSurfaced building CPython 3.12.10 on arm64 macOS with a conda-forge gettext on the prefix path (via 3D Slicer's SuperBuild). Before: _freeze_importlib link fails with the undefined _libintl_* symbols. After: _freeze_importlib, libpython3.12.dylib, and the python executable all link and build to completion (397/397).