From 8c1dbad36f44f332dadd9d08c8ffe3da7f6a20a6 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Fri, 26 Aug 2022 12:31:58 +0200 Subject: [PATCH] gh-96269: Fix build dependency on AIX (GH-96304) --- Makefile.pre.in | 2 ++ .../next/Build/2022-08-26-11-50-03.gh-issue-96269.x_J5h0.rst | 3 +++ Modules/makesetup | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Build/2022-08-26-11-50-03.gh-issue-96269.x_J5h0.rst diff --git a/Makefile.pre.in b/Makefile.pre.in index 3491e91f43a..af203705d38 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -2522,6 +2522,8 @@ Python/thread.o: @THREADHEADERS@ $(srcdir)/Python/condvar.h ########################################################################## # Module dependencies and platform-specific files +MODULE_DEPS=$(PYTHON_HEADERS) Modules/config.c $(EXPORTSYMS) + MODULE_CMATH_DEPS=$(srcdir)/Modules/_math.h MODULE_MATH_DEPS=$(srcdir)/Modules/_math.h MODULE_PYEXPAT_DEPS=$(LIBEXPAT_HEADERS) @LIBEXPAT_INTERNAL@ diff --git a/Misc/NEWS.d/next/Build/2022-08-26-11-50-03.gh-issue-96269.x_J5h0.rst b/Misc/NEWS.d/next/Build/2022-08-26-11-50-03.gh-issue-96269.x_J5h0.rst new file mode 100644 index 00000000000..adb605fede5 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2022-08-26-11-50-03.gh-issue-96269.x_J5h0.rst @@ -0,0 +1,3 @@ +Shared module targets now depend on new ``MODULE_DEPS`` variable, which +includes ``EXPORTSYMS``. This fixes a build order issue on unsupported AIX +platform. diff --git a/Modules/makesetup b/Modules/makesetup index 08303814c8c..5c275ac9a04 100755 --- a/Modules/makesetup +++ b/Modules/makesetup @@ -267,7 +267,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' | cc="$cc $cpps \$(PY_BUILTIN_MODULE_CFLAGS)";; esac # force rebuild when header file or module build flavor (static/shared) is changed - rule="$obj: $src \$(MODULE_${mods_upper}_DEPS) \$(PYTHON_HEADERS) Modules/config.c; $cc -c $src -o $obj" + rule="$obj: $src \$(MODULE_${mods_upper}_DEPS) \$(MODULE_DEPS); $cc -c $src -o $obj" echo "$rule" >>$rulesf done case $doconfig in