diff --git a/debian/rules.d/control.mk b/debian/rules.d/control.mk
index 412192f..58385bb 100644
--- a/debian/rules.d/control.mk
+++ b/debian/rules.d/control.mk
@@ -5,6 +5,7 @@ libc6_archs := amd64 arm64 armel armhf hppa i386 m68k mips mipsel mipsn32 mips
libc6_1_archs := alpha
control_deps := $(wildcard debian/control.in/*) $(addprefix debian/control.in/, $(libc_packages))
+triggers := binutils, linux-libc-dev [linux-any], $(BASE_CC)$(DEB_GCC_VERSION)
$(patsubst %,debian/control.in/%,$(libc_packages)) :: debian/control.in/% : debian/control.in/libc debian/rules.d/control.mk
sed -e "s%@libc@%$*%g" \
@@ -12,8 +13,10 @@ $(patsubst %,debian/control.in/%,$(libc_packages)) :: debian/control.in/% : debi
-e "s%@libc-dev-conflict@%$(foreach arch,$(filter-out $*,$(libc_packages)),$(arch)-dev,)%g" \
< $< > $@
+
+
debian/control: $(stamp)control
-$(stamp)control: debian/rules.d/control.mk $(control_deps)
+$(stamp)control: debian/rules.d/control.mk $(control_deps) debian/tests/control.in
# Check that all files end with a new line
set -e ; for i in debian/control.in/* ; do \
@@ -42,4 +45,7 @@ $(stamp)control: debian/rules.d/control.mk $(control_deps)
cat debian/control.in/opt >> $@T
sed -e 's%@libc@%$(libc)%g' -e 's%@GLIBC_VERSION@%$(GLIBC_VERSION)%g' < $@T > debian/control
rm $@T
+
+ # And generate the tests control file with the current GCC
+ sed -e 's%@triggers@%$(triggers)%g' debian/tests/control.in > debian/tests/control
touch $@
diff --git a/debian/tests/control b/debian/tests/control
index 072702e..fe692c3 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,3 +1,3 @@
Tests: rebuild
-Depends: @builddeps@, fakeroot
+Depends: @builddeps@, fakeroot, binutils, linux-libc-dev [linux-any], gcc-6
Restrictions: allow-stderr
diff --git a/debian/tests/control.in b/debian/tests/control.in
new file mode 100644
index 0000000..20ac0b5
--- /dev/null
+++ b/debian/tests/control.in
@@ -0,0 +1,3 @@
+Tests: rebuild
+Depends: @builddeps@, fakeroot, @triggers@
+Restrictions: allow-stderr