kbuild: use -fmacro-prefix-map for .S sources
authorDenys Zagorui <dzagorui@cisco.com>
Mon, 2 Nov 2020 12:08:53 +0000 (04:08 -0800)
committerMasahiro Yamada <masahiroy@kernel.org>
Tue, 24 Nov 2020 18:41:17 +0000 (03:41 +0900)
Follow-up to commit a73619a845d5 ("kbuild: use -fmacro-prefix-map to
make __FILE__ a relative path"). Assembler sources also use __FILE__
macro so this flag should be also applied to those sources.

Signed-off-by: Denys Zagorui <dzagorui@cisco.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Makefile

index ed081e3..87d659d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -946,7 +946,7 @@ KBUILD_CFLAGS   += $(call cc-option,-Werror=incompatible-pointer-types)
 KBUILD_CFLAGS   += $(call cc-option,-Werror=designated-init)
 
 # change __FILE__ to the relative path from the srctree
-KBUILD_CFLAGS  += $(call cc-option,-fmacro-prefix-map=$(srctree)/=)
+KBUILD_CPPFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=)
 
 # ensure -fcf-protection is disabled when using retpoline as it is
 # incompatible with -mindirect-branch=thunk-extern