[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNARoL19wQo84AZAizZBzXJKkg3KciryQU+Sm5Uc4BDd9DA@mail.gmail.com>
Date: Mon, 15 Feb 2021 02:09:41 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: Stephen Zhang <stephenzhangzsd@...il.com>
Cc: Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Nathan Chancellor <natechancellor@...il.com>,
clang-built-linux <clang-built-linux@...glegroups.com>,
LKML <linux-kernel@...r.kernel.org>,
Tom Roeder <tmroeder@...gle.com>,
Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>
Subject: Re: [PATCH v1] clang_tools:gen_compile_commands: Change the default
source directory
On Sun, Feb 14, 2021 at 8:49 PM Stephen Zhang <stephenzhangzsd@...il.com> wrote:
>
> Masahiro Yamada <masahiroy@...nel.org> 于2021年2月13日周六 下午8:46写道:
> > This is the steps I tested.
> >
> >
> > masahiro@...ar:~/ref/linux$ make O=build defconfig all -j24
> > [ snip ]
> > masahiro@...ar:~/ref/linux$
> > ./scripts/clang-tools/gen_compile_commands.py -d build
> > masahiro@...ar:~/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
>
> Thanks. Nathan had a detailed description about this:
>
> > $ make O=build
> >
> > will work with '-d .' because the .cmd files are in '.' and the source
> > files will be placed relative to '.', which is correct. Your command
> > does not work for two reasons:
> >
> > 1. You are using a build directory that is not a subpath of the source
> > directory. In other words, this script would not work for
> >
> > $ make O=/tmp/build
> >
> > because '-d /tmp/build' needs to be used to find the .cmd files but then
> > the relative path of the source files is messed up, as you point out.
>
> This may help you reproduce the problem. So you shoud try:
>
> >masahiro@...ar:~/ref/linux$ make O=/tmp/build defconfig all -j24
>
> where the build directory is not a subpath of the source directory.
So, what is the problem?
--
Best Regards
Masahiro Yamada
Powered by blists - more mailing lists