diff --git a/kernel/module/Kconfig b/kernel/module/Kconfig
index 4047b6d482557c9145ec9acf89c0c77016d82178..05a9a06a140c9d201dac884b4e8ef683cf602faa 100644
--- a/kernel/module/Kconfig
+++ b/kernel/module/Kconfig
@@ -160,6 +160,7 @@ config MODULE_UNLOAD_TAINT_TRACKING
 
 config MODVERSIONS
 	bool "Module versioning support"
+	depends on !COMPILE_TEST
 	help
 	  Usually, you have to use modules compiled with your kernel.
 	  Saying Y here makes it sometimes possible to use modules