]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-126877: Fix the configure check for Tcl/Tk with optimizing compilers (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 11 Jul 2026 10:08:13 +0000 (12:08 +0200)
committerGitHub <noreply@github.com>
Sat, 11 Jul 2026 10:08:13 +0000 (10:08 +0000)
The check assigned the addresses of Tcl_Init() and Tk_Init() to unused
variables, which optimizing compilers can eliminate, so it linked even
when the libraries were missing.  Call the functions instead.
(cherry picked from commit ff0a9ae269fa38c21f01bdea1a7ff5d439c4f681)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Misc/NEWS.d/next/Build/2026-07-11-07-26-16.gh-issue-126877.Zt7Kq2.rst [new file with mode: 0644]
configure
configure.ac

diff --git a/Misc/NEWS.d/next/Build/2026-07-11-07-26-16.gh-issue-126877.Zt7Kq2.rst b/Misc/NEWS.d/next/Build/2026-07-11-07-26-16.gh-issue-126877.Zt7Kq2.rst
new file mode 100644 (file)
index 0000000..1d7d4fa
--- /dev/null
@@ -0,0 +1,2 @@
+Fix the :program:`configure` check for Tcl/Tk which could wrongly succeed
+with optimizing compilers when the libraries are missing.
index 8c6bf8b3cfe4a9b4ef1f74cd1075c6829ab4720c..717a2079124129a4ba7c86346eb71c1f9f4e99fe 100755 (executable)
--- a/configure
+++ b/configure
@@ -17322,8 +17322,8 @@ int
 main (void)
 {
 
-      void *x1 = Tcl_Init;
-      void *x2 = Tk_Init;
+      Tcl_Init(NULL);
+      Tk_Init(NULL);
 
   ;
   return 0;
index a65c16a05b1580594eaa00abd3b7ea68dcda55d2..cac2f931c91aa17460e1a6d9747d8d46c4a3990a 100644 (file)
@@ -4544,8 +4544,8 @@ WITH_SAVE_ENV([
       #  error "Tk older than 8.5.12 not supported"
       #endif
     ], [
-      void *x1 = Tcl_Init;
-      void *x2 = Tk_Init;
+      Tcl_Init(NULL);
+      Tk_Init(NULL);
     ])
   ], [
     have_tcltk=yes