diff -Nru mpich-5.0.2/debian/patches/mpl-isolate-ldflags.patch mpich-5.0.2/debian/patches/mpl-isolate-ldflags.patch
--- mpich-5.0.2/debian/patches/mpl-isolate-ldflags.patch	1970-01-01 01:00:00.000000000 +0100
+++ mpich-5.0.2/debian/patches/mpl-isolate-ldflags.patch	2026-11-06 10:02:49.000000000 +0100
@@ -0,0 +1,61 @@
+Description: Do not append build LDFLAGS to WRAPPER_LIBS in MPL localdefs.in
+Author: Viktor Pashaiev <w.paszajew@gmail.com>
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/mpich/+bug/2170321
+Bug-Debian: https://bugs.debian.org/1150548
+Last-Update: 2026-11-06
+
+--- a/src/mpl/localdefs.in
++++ b/src/mpl/localdefs.in
+@@ -6,7 +6,7 @@
+ GPU_SUPPORT="@GPU_SUPPORT@"
+ CPPFLAGS="@CPPFLAGS@"
+ MPL_CFLAGS="@MPL_CFLAGS@"
+-WRAPPER_LIBS="$WRAPPER_LIBS @LDFLAGS@ @LIBS@"
++WRAPPER_LIBS="$WRAPPER_LIBS @LIBS@"
+ RPATHS="$RPATHS @RPATHS@"
+ COMPILER_TLS="@COMPILER_TLS@"
+ MPL_SUMMARY_MESSAGE="@SUMMARY_MESSAGE@"
+--- a/src/pm/hydra/modules/mpl/localdefs.in
++++ b/src/pm/hydra/modules/mpl/localdefs.in
+@@ -6,7 +6,7 @@
+ GPU_SUPPORT="@GPU_SUPPORT@"
+ CPPFLAGS="@CPPFLAGS@"
+ MPL_CFLAGS="@MPL_CFLAGS@"
+-WRAPPER_LIBS="$WRAPPER_LIBS @LDFLAGS@ @LIBS@"
++WRAPPER_LIBS="$WRAPPER_LIBS @LIBS@"
+ RPATHS="$RPATHS @RPATHS@"
+ COMPILER_TLS="@COMPILER_TLS@"
+ MPL_SUMMARY_MESSAGE="@SUMMARY_MESSAGE@"
+--- a/src/mpi/romio/mpl/localdefs.in
++++ b/src/mpi/romio/mpl/localdefs.in
+@@ -6,7 +6,7 @@
+ GPU_SUPPORT="@GPU_SUPPORT@"
+ CPPFLAGS="@CPPFLAGS@"
+ MPL_CFLAGS="@MPL_CFLAGS@"
+-WRAPPER_LIBS="$WRAPPER_LIBS @LDFLAGS@ @LIBS@"
++WRAPPER_LIBS="$WRAPPER_LIBS @LIBS@"
+ RPATHS="$RPATHS @RPATHS@"
+ COMPILER_TLS="@COMPILER_TLS@"
+ MPL_SUMMARY_MESSAGE="@SUMMARY_MESSAGE@"
+--- a/src/pmi/mpl/localdefs.in
++++ b/src/pmi/mpl/localdefs.in
+@@ -6,7 +6,7 @@
+ GPU_SUPPORT="@GPU_SUPPORT@"
+ CPPFLAGS="@CPPFLAGS@"
+ MPL_CFLAGS="@MPL_CFLAGS@"
+-WRAPPER_LIBS="$WRAPPER_LIBS @LDFLAGS@ @LIBS@"
++WRAPPER_LIBS="$WRAPPER_LIBS @LIBS@"
+ RPATHS="$RPATHS @RPATHS@"
+ COMPILER_TLS="@COMPILER_TLS@"
+ MPL_SUMMARY_MESSAGE="@SUMMARY_MESSAGE@"
+--- a/src/pm/hydra/modules/pmi/mpl/localdefs.in
++++ b/src/pm/hydra/modules/pmi/mpl/localdefs.in
+@@ -6,7 +6,7 @@
+ GPU_SUPPORT="@GPU_SUPPORT@"
+ CPPFLAGS="@CPPFLAGS@"
+ MPL_CFLAGS="@MPL_CFLAGS@"
+-WRAPPER_LIBS="$WRAPPER_LIBS @LDFLAGS@ @LIBS@"
++WRAPPER_LIBS="$WRAPPER_LIBS @LIBS@"
+ RPATHS="$RPATHS @RPATHS@"
+ COMPILER_TLS="@COMPILER_TLS@"
+ MPL_SUMMARY_MESSAGE="@SUMMARY_MESSAGE@"
diff -Nru mpich-5.0.2/debian/patches/series mpich-5.0.2/debian/patches/series
--- mpich-5.0.2/debian/patches/series	2026-10-02 13:22:26.000000000 +0200
+++ mpich-5.0.2/debian/patches/series	2026-11-06 10:02:49.000000000 +0100
@@ -3,3 +3,4 @@
 add-fortran-bindings.patch
 # This change _after_ ./configure
 # mpich-disable-file.patch
+mpl-isolate-ldflags.patch
diff -Nru mpich-5.0.2/debian/rules mpich-5.0.2/debian/rules
--- mpich-5.0.2/debian/rules	2026-10-02 13:22:26.000000000 +0200
+++ mpich-5.0.2/debian/rules	2026-11-06 10:02:49.000000000 +0100
@@ -16,6 +16,7 @@
 export MPICHLIB_CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS)
 export MPICHLIB_FFLAGS:=$(shell dpkg-buildflags --get FFLAGS) $(GF_FLAGS)
 export MPICHLIB_FCFLAGS:=$(shell dpkg-buildflags --get FFLAGS) -cpp $(GF_FLAGS)
+export MPICHLIB_LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
 export FFLAGS:=$(shell dpkg-buildflags --get FFLAGS | sed -e 's/-g //') $(GF_FLAGS)
 export F77=f77
 export TZ=UTC+0
@@ -113,7 +114,7 @@
 	dh_autoreconf ./autogen.sh
 
 override_dh_auto_configure: $(AUTOGENERATED)
-	dh_auto_configure -- $(extra_flags) CPPFLAGS="" CFLAGS="" CXXFLAGS="" FFLAGS="$(FFLAGS)" FCFLAGS="$(FFLAGS)" BASH_SHELL=/bin/bash
+	dh_auto_configure -- $(extra_flags) CPPFLAGS="" CFLAGS="" CXXFLAGS="" LDFLAGS="" FFLAGS="$(GF_FLAGS)" FCFLAGS="$(GF_FLAGS)" BASH_SHELL=/bin/bash
 	dh_auto_configure --sourcedirectory src/pm/hydra -- --with-hwloc-prefix=/usr $(DEVICE) FFLAGS="$(FFLAGS)"
 	sed -r -i 's/ +-ffile-prefix-map=[^ ]+//g' src/env/mpifort.bash src/include/mpichinfo.h src/packaging/pkgconfig/mpich.pc src/pm/hydra/hydra_config.h
 	# for mpif
