mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-01 18:53:30 +00:00
kbuild: support -fmacro-prefix-map for external modules
This commit makes -fmacro-prefix-map work for external modules built in
a separate output directory. It improves the reproducibility of external
modules and provides the benefits described in commit a73619a845
("kbuild: use -fmacro-prefix-map to make __FILE__ a relative path").
When building_out_of_srctree is not defined (e.g., when the kernel or
external module is built in the source directory), this option is
unnecessary.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
This commit is contained in:
parent
11b3d5175e
commit
1d3730f001
6
Makefile
6
Makefile
@ -1041,8 +1041,10 @@ ifdef CONFIG_CC_IS_GCC
|
|||||||
KBUILD_CFLAGS += -fconserve-stack
|
KBUILD_CFLAGS += -fconserve-stack
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# change __FILE__ to the relative path from the srctree
|
# change __FILE__ to the relative path to the source directory
|
||||||
KBUILD_CPPFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=)
|
ifdef building_out_of_srctree
|
||||||
|
KBUILD_CPPFLAGS += $(call cc-option,-fmacro-prefix-map=$(srcroot)/=)
|
||||||
|
endif
|
||||||
|
|
||||||
# include additional Makefiles when needed
|
# include additional Makefiles when needed
|
||||||
include-y := scripts/Makefile.extrawarn
|
include-y := scripts/Makefile.extrawarn
|
||||||
|
Loading…
Reference in New Issue
Block a user