diff --git a/meta/classes-recipe/cpan.bbclass b/meta/classes-recipe/cpan.bbclass
index dbf44da9d2..0f7384786f 100644
--- a/meta/classes-recipe/cpan.bbclass
+++ b/meta/classes-recipe/cpan.bbclass
@@ -23,6 +23,10 @@ export PERLHOSTLIB = "${STAGING_LIBDIR_NATIVE}/perl5/${@get_perl_version(d)}/"
 export PERLHOSTARCHLIB = "${STAGING_LIBDIR_NATIVE}/perl5/${@get_perl_version(d)}/${@get_perl_hostarch(d)}/"
 
 cpan_do_configure () {
+	# A Makefile left behind by an earlier configure run would be used with the
+	# settings it was generated with, so start from the Makefile.PL every time.
+	rm -f Makefile
+
 	yes '' | perl ${EXTRA_PERLFLAGS} Makefile.PL INSTALLDIRS=vendor NO_PERLLOCAL=1 NO_PACKLIST=1 PERL=$(which perl) ${EXTRA_CPANFLAGS}
 
 	# Makefile.PLs can exit with success without generating a
@@ -57,12 +61,17 @@ do_configure:append:class-nativesdk() {
            -e 's:LD_RUN_PATH ?= ?"?[^"]*"?::g'
 }
 
+# ExtUtils::MakeMaker regenerates the Makefile when the staged perl has become
+# newer than it, and then exits asking for make to be rerun. Do that instead of
+# failing the task; a run that fails for any other reason fails again.
 cpan_do_compile () {
-	oe_runmake PASTHRU_INC="${CFLAGS}" LD="${CCLD}"
+	oe_runmake_call PASTHRU_INC="${CFLAGS}" LD="${CCLD}" || \
+		oe_runmake PASTHRU_INC="${CFLAGS}" LD="${CCLD}"
 }
 
 cpan_do_install () {
-	oe_runmake DESTDIR="${D}" install_vendor
+	oe_runmake_call DESTDIR="${D}" install_vendor || \
+		oe_runmake DESTDIR="${D}" install_vendor
 	for PERLSCRIPT in `grep -rIEl '#! *${bindir}/perl-native.*/perl' ${D}`; do
 		sed -i -e 's|${bindir}/perl-native.*/perl|/usr/bin/env nativeperl|' $PERLSCRIPT
 	done
