lkml.org 
[lkml]   [2021]   [Feb]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v1] clang_tools:gen_compile_commands: Change the default source directory
On Fri, Feb 12, 2021 at 8:20 PM Stephen Zhang <stephenzhangzsd@gmail.com> wrote:
>
> Masahiro Yamada <masahiroy@kernel.org> 于2021年2月11日周四 下午10:16写道:
> > Please stop.
> >
> >
> > Commit 6ca4c6d25949117dc5b4845612e290b6d89e70a8
> > removed the tools/ support.
> >
> >
> > There exist two build systems in the Linux source tree.
> > Kbuild covers the entire tree except tools/.
> > The tools/ directory adopts a different build system.
> >
> > It is a pity that the tools/ directory
> > went in a wrong direction, and people
> > try to fix problems in a wrong layer.
> >
> >
> > You are not the first person to send to
> > tweak obj/source trees of this script.
> >
> > You can not do this correctly
> > without terribly messing up the code.
> >
> > Please do not try to support tools/.
> >
> >
> >
> > --
> > Best Regards
> > Masahiro Yamada
>
> Thanks for the suggestion.But what we try to support is scripts/
> instead of tools/. 'tools/' here is to help explaining the problem.
> Or am I just misunderstanding your words?



You took 'tools/perf' as an example,
so I just thought you were trying to fix the tools/.



I can get scripts/ entries without any problem.

If you do O= build, you can pass that directory
to the -d option of gen_compile_commands.py

-d DIRECTORY, --directory DIRECTORY
specify the output directory used for the
kernel build (defaults to the working
directory)


This is the steps I tested.


masahiro@oscar:~/ref/linux$ make O=build defconfig all -j24
[ snip ]
masahiro@oscar:~/ref/linux$
./scripts/clang-tools/gen_compile_commands.py -d build
masahiro@oscar:~/ref/linux$ grep '"file":' compile_commands.json |
grep scripts/ | head -n5
"file": "/home/masahiro/ref/linux/scripts/mod/empty.c"
"file": "/home/masahiro/ref/linux/scripts/mod/sumversion.c"
"file": "/home/masahiro/ref/linux/scripts/mod/file2alias.c"
"file": "/home/masahiro/ref/linux/scripts/mod/modpost.c"
"file": "/home/masahiro/ref/linux/build/scripts/kconfig/parser.tab.c"








--
Best Regards
Masahiro Yamada

\
 
 \ /
  Last update: 2021-02-13 13:47    [W:0.093 / U:1.744 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site