diff options
author | Masahiro Yamada <masahiroy@kernel.org> | 2020-08-22 23:56:11 +0900 |
---|---|---|
committer | Masahiro Yamada <masahiroy@kernel.org> | 2020-08-27 00:44:33 +0900 |
commit | 6ca4c6d25949117dc5b4845612e290b6d89e70a8 (patch) | |
tree | a9f4640d6ba787fec387ac3f79543a56de72b58d /scripts/profile2linkerlist.pl | |
parent | ea6cedc5b8a4e666da41f1173ea19970fa60683f (diff) | |
download | linux-next-6ca4c6d25949117dc5b4845612e290b6d89e70a8.tar.gz |
gen_compile_commands: do not support .cmd files under tools/ directory
The tools/ directory uses a different build system, and the format of
.cmd files is different because the tools builds run in a different
work directory.
Supporting two formats compilicates the script.
The only loss by this change is objtool.
Also, rename the confusing variable 'relative_path' because it is
not necessarily a relative path. When the output directory is not
the direct child of the source tree (e.g. O=foo/bar), it is an
absolute path. Rename it to 'file_path'.
os.path.join(root_directory, file_path) works whether the file_path
is relative or not. If file_path is already absolute, it returns it
as-is.
I used os.path.abspath() to normalize file paths. If you run this
script against the kernel built with O=foo option, the file_path
contains '../' patterns. os.path.abspath() fixes up 'foo/bar/../baz'
into 'foo/baz', and produces a cleaner commands_database.json.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Diffstat (limited to 'scripts/profile2linkerlist.pl')
0 files changed, 0 insertions, 0 deletions