linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kbuild: use -fmacro-prefix-map for .S sources compilation
@ 2020-10-29 11:21 Denys Zagorui
  2020-11-02 11:16 ` Masahiro Yamada
  0 siblings, 1 reply; 2+ messages in thread
From: Denys Zagorui @ 2020-10-29 11:21 UTC (permalink / raw)
  To: masahiroy, michal.lkml, linux-kbuild; +Cc: dzagorui, linux-kernel

Follow-up to a73619a845d5 ("kbuild: use -fmacro-prefix-map to make
__FILE__ a relative path") commit. Assembler sources also use __FILE__
macro so this flag should be also apllied to that sources.

Signed-off-by: Denys Zagorui <dzagorui@cisco.com>
---
 Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Makefile b/Makefile
index ee2284a5cad2..26c4294f6e25 100644
--- a/Makefile
+++ b/Makefile
@@ -947,6 +947,7 @@ 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_AFLAGS	+= $(call cc-option,-fmacro-prefix-map=$(srctree)/=)
 
 # ensure -fcf-protection is disabled when using retpoline as it is
 # incompatible with -mindirect-branch=thunk-extern
-- 
2.19.0.dirty


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] kbuild: use -fmacro-prefix-map for .S sources compilation
  2020-10-29 11:21 [PATCH] kbuild: use -fmacro-prefix-map for .S sources compilation Denys Zagorui
@ 2020-11-02 11:16 ` Masahiro Yamada
  0 siblings, 0 replies; 2+ messages in thread
From: Masahiro Yamada @ 2020-11-02 11:16 UTC (permalink / raw)
  To: Denys Zagorui
  Cc: Michal Marek, Linux Kbuild mailing list, Linux Kernel Mailing List

On Thu, Oct 29, 2020 at 8:22 PM Denys Zagorui <dzagorui@cisco.com> wrote:
>
> Follow-up to a73619a845d5 ("kbuild: use -fmacro-prefix-map to make
> __FILE__ a relative path") commit. Assembler sources also use __FILE__
> macro so this flag should be also apllied to that sources.
>
> Signed-off-by: Denys Zagorui <dzagorui@cisco.com>
> ---
>  Makefile | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/Makefile b/Makefile
> index ee2284a5cad2..26c4294f6e25 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -947,6 +947,7 @@ 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_AFLAGS  += $(call cc-option,-fmacro-prefix-map=$(srctree)/=)



-fmacro-prefix-map is a preprocessor option.

https://gcc.gnu.org/onlinedocs/gcc-10.2.0/gcc/Preprocessor-Options.html#Preprocessor-Options



I think it makes more sense to replace

KBUILD_CFLAGS  += $(call cc-option,-fmacro-prefix-map=$(srctree)/=)

with

KBUILD_CPPFLAGS        += $(call cc-option,-fmacro-prefix-map=$(srctree)/=)


Then, this flag will be passed to .S files as well as .c files.








>  # ensure -fcf-protection is disabled when using retpoline as it is
>  # incompatible with -mindirect-branch=thunk-extern
> --
> 2.19.0.dirty
>


--
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-02 11:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-29 11:21 [PATCH] kbuild: use -fmacro-prefix-map for .S sources compilation Denys Zagorui
2020-11-02 11:16 ` Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).