Problem using gtags target
Hi,
I am trying to use GNU global for kernel source browsing but have run into a problem when using "gtags" target in Makefile. The index files(GTAGS, GSYMS, GPATH, GRTAGS) don't work and on further investigation turned out to be 16kb each in size. My command line is -
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j5 gtags
On some digging, I traced the relevant code to scripts/tags.sh which produces reasonably sized indices (modulo some missing environment variables) when run as -
./scripts/tags.sh gtags
I used the following patch
scripts/tags.sh +2 -1
@@ -143,7 +143,8 @@ docscope() dogtags() { - all_target_sources | gtags -i -f - + all_target_sources > gtags.files + gtags -i -f gtags.files } exuberant()
to check the file list being produced and it seems correct but the indices are still broken. Yet manually running
gtags -i -f gtags.files
does seem to do the right thing.
I was wondering if anybody has faced similar issues when using gtags and how to fix this.
Thanks,
Punit
ps: Please include me in the cc as I am not subscribed to the list.
Quoted 8 lines · Punit Agrawal
Hi,
I am trying to use GNU global for kernel source browsing but have run into a problem when using "gtags" target in
Makefile. The indexfiles(GTAGS, GSYMS, GPATH, GRTAGS)don't work and on further investigation turned out to be 16kb each in size. My command line is -make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j5 gtags
So you have a command that fails
Quoted 6 lines
On some digging, I traced the relevant code to
scripts/tags.shwhich produces reasonably sized indices (modulo some missing environment variables) when run as -
./scripts/tags.shgtags
...and a command that works. So you can start "bisecting" between these
two: Try removing -j5 or ARCH= or CROSS_COMPILE= from the make command line. Still failing? Add 'printenv >env.make' to the tags.sh script and run it via make tags. Compare the env.make file with printenv output from the shell. Try setting the variables from env.make in the shell and see when ./scripts/tags.sh gtags starts failing.
FWIW, both your commands seem to work for me and produce a GRTAGS that is 256MB big.
Michal