diff -pruN 6.3.20211021-3/debian/changelog 6.3.20211021-4/debian/changelog
--- 6.3.20211021-3/debian/changelog	2022-06-26 22:13:32.000000000 +0000
+++ 6.3.20211021-4/debian/changelog	2022-08-03 20:35:40.000000000 +0000
@@ -1,3 +1,10 @@
+libncursesada (6.3.20211021-4) unstable; urgency=medium
+
+  * Require a GCC major version instead of a full match. Closes: #1016341.
+  * Replace last usage of gnatgcc with gcc-MAJOR.
+
+ -- Nicolas Boulenguez <nicolas@debian.org>  Wed, 03 Aug 2022 20:35:40 +0000
+
 libncursesada (6.3.20211021-3) unstable; urgency=medium
 
   * Closes: #1013479. Explicitly select the same compiler for Ada and C
diff -pruN 6.3.20211021-3/debian/rules 6.3.20211021-4/debian/rules
--- 6.3.20211021-3/debian/rules	2022-06-26 22:08:44.000000000 +0000
+++ 6.3.20211021-4/debian/rules	2022-08-03 20:35:40.000000000 +0000
@@ -18,6 +18,8 @@ include /usr/share/dpkg/buildopts.mk
 include $(wildcard /usr/share/ada/debian_packaging.mk)
 # wildcard means: not during -indep builds.
 
+gnat_version != gnatmake --version | sed 's/.* \([0-9]\+\).*/\1/;q'
+
 %:
 	dh $@
 
@@ -45,7 +47,7 @@ override_dh_autoreconf-arch:
 override_dh_auto_configure-arch:
  # tests: samples/* will be installed into the -doc package, and used
  # by autopkgtest, but there is no point in compiling them now.
-	CC=gnatgcc \
+	CC=gcc-$(gnat_version) \
 	dh_auto_configure -- \
 	  --without-tests
 # --with-ada-sharedlib --with-ada-libname=libncursesada.so.$(SOVERSION)
@@ -71,10 +73,9 @@ override_dh_auto_build-arch:
 	gprbuild $(PROJECT) $(GPRBUILDFLAGS) -p \
 	  -XSOVERSION=$(SOVERSION) -XLDLIBS="$(LDLIBS)" -XNCURSES_CFLAGS="$(NCURSES_CFLAGS)"
 
-gnat_version != gnatmake --version | sed 's/.* //;q'
 override_dh_auto_build-arch: default.cgpr
 default.cgpr:
-	gprconfig --batch --config=Ada --config=C,$(gnat_version),,,gcc
+	gprconfig --batch --config=Ada --config=C,,,,gcc-$(gnat_version)
 
 # Upstream allows installation of explain.txt into any directory, and
 # consequently reformats the generated source in the 80-columns limit.
