--- matplotlib-3.5.1/debian/rules	2022-01-03 05:42:00.000000000 +0800
+++ matplotlib-3.5.1-new/debian/rules	2022-01-22 17:01:03.592888294 +0800
@@ -14,6 +14,12 @@
 DPKG_EXPORT_BUILDFLAGS = 1
 include /usr/share/dpkg/buildflags.mk
 
+# https://bugs.debian.org/1000435
+# it is due to a bug of gcc-11
+ifeq ($(DEB_HOST_ARCH), mips64el)
+  OPT_CFLAGS = CFLAGS="-O3" CXXFLAGS="-O3"
+endif
+
 # build
 build: build-arch build-indep
 
@@ -34,7 +40,7 @@
 
 	set -e; \
 	for v in $(PY3VERS); do \
-		python$$v ./setup.py build $(PY_BUILD_FLAGS) ; \
+		$(OPT_CFLAGS) python$$v ./setup.py build $(PY_BUILD_FLAGS) ; \
 	done
 
 ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
