diff --git a/meta/recipes-devtools/perl/perl-ptest.inc b/meta/recipes-devtools/perl/perl-ptest.inc
index 4b4756118c..49d322a848 100644
--- a/meta/recipes-devtools/perl/perl-ptest.inc
+++ b/meta/recipes-devtools/perl/perl-ptest.inc
@@ -20,6 +20,11 @@ do_install_ptest () {
 
 	ln -sf ${bindir}/perl ${D}${PTEST_PATH}/t/perl
 
+	# xconfig.h contains references to build host architecture, and yet is included from various other places.
+	# To make it reproducible let's make it a copy of config.h patch that is specific to the target architecture.
+	# It is believed that the original header is the product of building miniperl (a helper executable built with host compiler).
+	cp ${D}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/CORE/config.h ${D}${PTEST_PATH}/xconfig.h
+
 	# Remove build host references from various scattered files...
 	find "${D}${PTEST_PATH}" \
 	     \( -name '*.PL' -o -name 'myconfig' -o -name 'cflags' -o -name '*.pl' -o -name '*.sh' -o -name '*.pm' \
@@ -44,7 +49,7 @@ do_install_ptest () {
 	 sed -i -e '/Autogenerated starting on/d' ${D}${PTEST_PATH}/lib/unicore/mktables.lst
 
 	 # Remove files with host-specific configuration for building native binaries
-	 rm ${D}${PTEST_PATH}/Makefile.config ${D}${PTEST_PATH}/xconfig.h ${D}${PTEST_PATH}/xconfig.sh
+	 rm ${D}${PTEST_PATH}/Makefile.config ${D}${PTEST_PATH}/xconfig.sh
 
          # create an empty file that is checked for existence by makerel test
          touch ${D}${PTEST_PATH}/win32/Makefile
