diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index dbf94a7d25a8a1c7be60d62f29680e69e1261f1b..a48abeac753f39ef520fbe1bc5243cb494c47621 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -119,7 +119,7 @@ menu "Compile-time checks and compiler options"
 
 config DEBUG_INFO
 	bool "Compile the kernel with debug info"
-	depends on DEBUG_KERNEL
+	depends on DEBUG_KERNEL && !COMPILE_TEST
 	help
           If you say Y here the resulting kernel image will include
 	  debugging info resulting in a larger kernel image.