diff --git a/ChangeLog b/ChangeLog
index 96fd6a3e4bcfce8616192ce676c5d82e90711df4..b9f597a22adc03d3e725c48b909fd2e87f14f7a8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2017-09-12  Niels Möller  <nisse@lysator.liu.se>
+
+	* testsuite/testutils.h (mpn_zero_p): Avoid redefining mpn_zero_p
+	when building with mini-gmp. Since the mini-gmp update, this
+	function is defined by mini-gmp, causing link errors if nettle is
+	configured with --enable-mini-gmp --disable-shared. Reported by
+	Tim Rühsen.
+
 2017-09-09  Daiki Ueno  <dueno@redhat.com>
 
 	* testsuite/ecc-mul-g-test.c (test_main): Fixed mpn_cmp call.
diff --git a/testsuite/testutils.h b/testsuite/testutils.h
index 7c44772b7748d07397304c838c087897112f1cc9..caab4034bd5e35b79a25b42531eca51ede5b3a7b 100644
--- a/testsuite/testutils.h
+++ b/testsuite/testutils.h
@@ -163,13 +163,6 @@ test_armor(const struct nettle_armor *armor,
            const char *ascii);
 
 #if WITH_HOGWEED
-#ifndef mpn_zero_p
-int
-mpn_zero_p (mp_srcptr ap, mp_size_t n);
-#endif
-
-void
-mpn_out_str (FILE *f, int base, const mp_limb_t *xp, mp_size_t xn);
 
 #if NETTLE_USE_MINI_GMP
 typedef struct knuth_lfib_ctx gmp_randstate_t[1];
@@ -180,8 +173,20 @@ void mpz_urandomb (mpz_t r, struct knuth_lfib_ctx *ctx, mp_bitcnt_t bits);
 /* This is cheating */
 #define mpz_rrandomb mpz_urandomb
 
+/* mini-gmp defines this function (in the GMP library, it was added in
+   gmp in version 6.1.0). */
+#define mpn_zero_p mpn_zero_p
+
 #endif /* NETTLE_USE_MINI_GMP */
 
+#ifndef mpn_zero_p
+int
+mpn_zero_p (mp_srcptr ap, mp_size_t n);
+#endif
+
+void
+mpn_out_str (FILE *f, int base, const mp_limb_t *xp, mp_size_t xn);
+
 mp_limb_t *
 xalloc_limbs (mp_size_t n);