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 index 000000000000000..1d7d4fad886c56f --- /dev/null +++ b/Misc/NEWS.d/next/Build/2026-07-11-07-26-16.gh-issue-126877.Zt7Kq2.rst @@ -0,0 +1,2 @@ +Fix the :program:`configure` check for Tcl/Tk which could wrongly succeed +with optimizing compilers when the libraries are missing. diff --git a/configure b/configure index 90f026976d0e54c..08a7c663ce0a9c2 100755 --- a/configure +++ b/configure @@ -17800,8 +17800,8 @@ int main (void) { - void *x1 = Tcl_Init; - void *x2 = Tk_Init; + Tcl_Init(NULL); + Tk_Init(NULL); ; return 0; diff --git a/configure.ac b/configure.ac index bdb94d6d2803383..ead82d6da0b5450 100644 --- a/configure.ac +++ b/configure.ac @@ -4643,8 +4643,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