From 88bac5d5044e577825db1f9367af908dc9a3ad82 Mon Sep 17 00:00:00 2001 From: Ayappan Perumal Date: Mon, 23 Oct 2023 02:28:52 +0530 Subject: [PATCH] gh-110828: AIX 32bit build needs -latomic for _testcapi module (#110962) --- .../Build/2023-10-17-03-10-40.gh-issue-110828.31vQ9B.rst | 1 + configure | 3 ++- configure.ac | 8 ++++++-- 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 Misc/NEWS.d/next/Build/2023-10-17-03-10-40.gh-issue-110828.31vQ9B.rst diff --git a/Misc/NEWS.d/next/Build/2023-10-17-03-10-40.gh-issue-110828.31vQ9B.rst b/Misc/NEWS.d/next/Build/2023-10-17-03-10-40.gh-issue-110828.31vQ9B.rst new file mode 100644 index 00000000000..13647fee058 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2023-10-17-03-10-40.gh-issue-110828.31vQ9B.rst @@ -0,0 +1 @@ +AIX 32bit needs ``-latomic`` to build the :mod:`!_testcapi` extension module. diff --git a/configure b/configure index 3bf92ddb8fc..8b90c1306f8 100755 --- a/configure +++ b/configure @@ -27931,6 +27931,7 @@ printf "%s\n" "$ac_cv_libatomic_needed" >&6; } if test "x$ac_cv_libatomic_needed" = xyes then : LIBS="${LIBS} -latomic" + LIBATOMIC=${LIBATOMIC-"-latomic"} fi CPPFLAGS=$save_CPPFLAGS @@ -30084,7 +30085,7 @@ fi then : - + as_fn_append MODULE_BLOCK "MODULE__TESTCAPI_LDFLAGS=$LIBATOMIC$as_nl" fi if test "$py_cv_module__testcapi" = yes; then diff --git a/configure.ac b/configure.ac index daa59b2737b..a4ac5898227 100644 --- a/configure.ac +++ b/configure.ac @@ -7056,7 +7056,8 @@ int main() ]) AS_VAR_IF([ac_cv_libatomic_needed], [yes], - [LIBS="${LIBS} -latomic"]) + [LIBS="${LIBS} -latomic" + LIBATOMIC=${LIBATOMIC-"-latomic"}]) _RESTORE_VAR([CPPFLAGS]) @@ -7328,7 +7329,10 @@ PY_STDLIB_MOD([_hashlib], [], [test "$ac_cv_working_openssl_hashlib" = yes], [$OPENSSL_INCLUDES], [$OPENSSL_LDFLAGS $OPENSSL_LDFLAGS_RPATH $LIBCRYPTO_LIBS]) dnl test modules -PY_STDLIB_MOD([_testcapi], [test "$TEST_MODULES" = yes]) +PY_STDLIB_MOD([_testcapi], + [test "$TEST_MODULES" = yes], + dnl Modules/_testcapi needs -latomic for 32bit AIX build + [], [], [$LIBATOMIC]) PY_STDLIB_MOD([_testclinic], [test "$TEST_MODULES" = yes]) PY_STDLIB_MOD([_testclinic_limited], [test "$TEST_MODULES" = yes]) PY_STDLIB_MOD([_testinternalcapi], [test "$TEST_MODULES" = yes])