lkml.org 
[lkml]   [2018]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v4 1/9] Makefile: Prepare for using macros for inline asm
Date
Thanks for your comment! I am certainly Makefile-challenged, so your help is
highly appreciated.

Please see my responses/questions inline.

at 10:43 AM, Masahiro Yamada <yamada.masahiro@socionext.com> wrote:

> 2018-06-12 20:50 GMT+09:00 Nadav Amit <namit@vmware.com>:
>> Using macros for inline assembly improves both readability and
>> compilation decisions that are distorted by big assembly blocks that use
>> alternative sections. Compile macros.S and use it to assemble all C
>> files. Currently, only x86 will use it.
>>
>> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
>> Cc: Michal Marek <michal.lkml@markovi.net>
>> Cc: Thomas Gleixner <tglx@linutronix.de>
>> Cc: Ingo Molnar <mingo@redhat.com>
>> Cc: "H. Peter Anvin" <hpa@zytor.com>
>> Cc: x86@kernel.org
>> Cc: linux-kbuild@vger.kernel.org
>>
>> Signed-off-by: Nadav Amit <namit@vmware.com>
>
>
> I have not fully understood this series yet.
>
> I do not have enough skill in x86 architecture,
> but just some comments from the build system point of view.
>
>
>
> I guess this will probably break the parallel building.
>
> Kbuild can build 'prepare' and 'scripts' simultaneously.
>
>
> I locally modified the following line:
>
>
> diff --git a/Makefile b/Makefile
> index 2dea909440..6ad484a 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1030,7 +1030,7 @@ $(sort $(vmlinux-deps)): $(vmlinux-dirs) ;
> # Error messages still appears in the original language
>
> PHONY += $(vmlinux-dirs)
> -$(vmlinux-dirs): prepare scripts
> +$(vmlinux-dirs): scripts prepare
> $(Q)$(MAKE) $(build)=$@ need-builtin=1
>
> define filechk_kernel.release
>
>
>
> masahiro@grover:~/workspace/linux-kbuild$ make defconfig
> HOSTCC scripts/basic/fixdep
> HOSTCC scripts/kconfig/conf.o
> YACC scripts/kconfig/zconf.tab.c
> LEX scripts/kconfig/zconf.lex.c
> HOSTCC scripts/kconfig/zconf.tab.o
> HOSTLD scripts/kconfig/conf
> *** Default configuration is based on 'x86_64_defconfig'
> #
> # configuration written to .config
> #
> masahiro@grover:~/workspace/linux-kbuild$ make all
> scripts/kconfig/conf --syncconfig Kconfig
> WRAP arch/x86/include/generated/uapi/asm/bpf_perf_event.h
> WRAP arch/x86/include/generated/uapi/asm/poll.h
> WRAP arch/x86/include/generated/asm/dma-contiguous.h
> WRAP arch/x86/include/generated/asm/early_ioremap.h
> WRAP arch/x86/include/generated/asm/mcs_spinlock.h
> WRAP arch/x86/include/generated/asm/mm-arch-hooks.h
> CC scripts/mod/empty.o
> Assembler messages:
> Error: can't open arch/x86/kernel/macros.s for reading: No such file
> or directory
> make[2]: *** [scripts/Makefile.build:318: scripts/mod/empty.o] Error 1
> make[1]: *** [scripts/Makefile.build:558: scripts/mod] Error 2
> make: *** [Makefile:1050: scripts] Error 2

You are right. I tried to filter out the use of the switch (exported as
ASM_MACRO_FLAGS) for empty.o. Any suggestions on how to do it properly?

> Are you planning to support for all architectures, or x86-specific?

Not right now. But I think that other architectures will also prefer to
separate the inline assembly chunks in a similar manner, for better
compilation, easier readability, and better code maintainability.

Thanks again,
Nadav

\
 
 \ /
  Last update: 2018-06-14 00:20    [W:0.048 / U:3.328 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site