diff --git a/Makefile b/Makefile
index 143644c98759b6b0c6b89ce2587647e5ea47b566..316944c9d038762154fca2c49d127b0e511dd7c2 100644
--- a/Makefile
+++ b/Makefile
@@ -595,6 +595,9 @@ endif
 KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
 KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks)
 
+# change __FILE__ to the relative path from the srctree
+KBUILD_CFLAGS	+= $(call cc-option,-fmacro-prefix-map=$(srctree)/=)
+
 KBUILD_CFLAGS	+= -g
 # $(KBUILD_AFLAGS) sets -g, which causes gcc to pass a suitable -g<format>
 # option to the assembler.