diff --git a/scripts/Makefile.autoconf b/scripts/Makefile.autoconf
index f054081c98959ccbfd0cbd3acbd660fd2b40637c..36bfa17b47e66a15a26f08dfd8e3997a89cba53a 100644
--- a/scripts/Makefile.autoconf
+++ b/scripts/Makefile.autoconf
@@ -58,7 +58,8 @@ quiet_cmd_autoconf = GEN     $@
 	$(CPP) $(c_flags) $2 -DDO_DEPS_ONLY -dM $(srctree)/include/common.h > $@.tmp && { \
 		sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp |		\
 		while read line; do							\
-			if ! grep -q "$${line%=*}=" include/config/auto.conf; then	\
+			if [ -n "${KCONFIG_IGNORE_DUPLICATES}" ] ||			\
+			   ! grep -q "$${line%=*}=" include/config/auto.conf; then	\
 				echo "$$line";						\
 			fi								\
 		done > $@;								\
diff --git a/tools/moveconfig.py b/tools/moveconfig.py
index 24fc281b09329895296e0d92ac324c5fba4b374b..87ced5cd8959a3c3eceb3a5983c102ac94e98c65 100755
--- a/tools/moveconfig.py
+++ b/tools/moveconfig.py
@@ -628,6 +628,7 @@ class Slot:
         cmd = list(self.make_cmd)
         if cross_compile:
             cmd.append('CROSS_COMPILE=%s' % cross_compile)
+        cmd.append('KCONFIG_IGNORE_DUPLICATES=1')
         cmd.append('include/config/auto.conf')
         self.ps = subprocess.Popen(cmd, stdout=self.devnull)
         self.state = STATE_AUTOCONF