Skip to content

Commit bbe55c0

Browse files
gh-162243: Fix shared-memory library detection with LIBS
An existing -lrt in LIBS lets the shm_open probe succeed without recording librt for _posixshmem. The module is linked separately without LIBS, so its required library is missing on systems where libc does not provide it. Clear LIBS within the saved probe environment to determine the module's own requirements, following the curses fix in GH-156130. The actual module fails to import before the fix and shared-memory operations pass afterward. The full test suite passes, and configure is regenerated with the pinned Autoconf image.
1 parent f4c13c8 commit bbe55c0

3 files changed

Lines changed: 4 additions & 0 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix building Python's POSIX shared-memory module when ``LIBS`` contains
2+
``-lrt`` on systems that require ``librt`` for shared-memory functions.

‎configure‎

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎configure.ac‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8106,6 +8106,7 @@ AS_VAR_IF([ac_cv_func_getrandom], [yes], [
81068106
# shm_* may only be available if linking against librt
81078107
POSIXSHMEM_CFLAGS='-I$(srcdir)/Modules/_multiprocessing'
81088108
WITH_SAVE_ENV([
8109+
LIBS=""
81098110
AC_SEARCH_LIBS([shm_open], [rt])
81108111
AS_VAR_IF([ac_cv_search_shm_open], [-lrt], [POSIXSHMEM_LIBS="-lrt"])
81118112

0 commit comments

Comments
 (0)