habemus-papadum / kernel-grok

grok the kernel via a cmake shim
181 stars 32 forks source link

Adding C files of tools directory without their paths. #1

Closed saeidscorp closed 5 years ago

saeidscorp commented 6 years ago

Hi, first off, thanks for this useful script ;-)

I tested it with Bear and fresh linux-4.14 sources, but it produced a CMakeLists.txt which included a bunch of files without their path prefixes. notably:

add_libraries
    ...
    orc_dump.c
    help.c
    ...
)

...
set_source_files_properties(orc_dump.c ...)
set_source_files_properties(help.c)
...

But CMake can't find these (as sources' root directory doesn't contain them). Looking at compile_commands.json shows they all belong to the tools/objtool directory.

I removed all of them from CMakeLists.txt and it successfully configured and compiled afterwards.

So maybe everything under that directory should be ignored. (or better yet, any path without relative address should be ignored)

Thanks again!

habemus-papadum commented 6 years ago

Thanks Saeid, I'm not sure why I did not encounter this issue. I'll look into it and see what's going on. The kernel makefiles build a few executables for the compile machine before building the kernel for the deploy machine; initially I was worried that these helper executables might be problematic, and had planned to remove them from the compile json, but since it worked for me i figured I would just leave them in.

best, nehal

On Sat, Aug 18, 2018 at 2:34 PM Saeid Akbari notifications@github.com wrote:

Hi, first off, thanks for this useful script ;-)

I tested it with Bear and fresh linux-4.14 sources, but it produced a CMakeLists.txt which included a bunch of files without their path prefixes. notably:

add_libraries ... orc_dump.c help.c ... )

... set_source_files_properties(orc_dump.c ...) set_source_files_properties(help.c) ...

But CMake can't find these (as sources' root directory doesn't contain them). Looking at compile_commands.json shows they all belong to the tools/objtool directory.

I removed all of them from CMakeLists.txt and it successfully configured and compiled afterwards.

So maybe everything under that directory should be ignored. (or better yet, any path without relative address should be ignored)

Thanks again!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/habemus-papadum/kernel-grok/issues/1, or mute the thread https://github.com/notifications/unsubscribe-auth/ABG5hKYABDq1PHRn6-tW0wKnk0Fbrh2Sks5uSF5BgaJpZM4WCrIC .

jerrinot commented 6 years ago

hi, I encounter the same issue. elf.c, fixdep,c etc. are added into CMakeLists.txt, but without a proper path.