Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filepath case is not preserved #26

Open
maruncz opened this issue Apr 9, 2024 · 7 comments
Open

filepath case is not preserved #26

maruncz opened this issue Apr 9, 2024 · 7 comments

Comments

@maruncz
Copy link

maruncz commented Apr 9, 2024

Hi
i just noticed, that in some cases filepath case is not preserved and output is confusing.
For example i have both BatteryReader.cpp and batteryreader.hpp one section has some functions and other as the rest.
see this output:
out.txt

im using windows 10 machine and msp430-gcc in version 9.3.1

@jedrzejboczar
Copy link
Owner

I am not sure where the path case could be changed. Can you try using nm --portability --line-numbers file.elf to see if the paths are correct there?

May this be related to the fact that on Windows filesystem paths are not case-sensitive? Can you try to reproduce the issue on Linux/MacOs?

Or maybe you could try on Windows in a folder with case-sensitive paths enabled (it seems it is possible to enable this in NTFS on per-folder basis). But I'd say that it could be specific to the Windows gcc toolchain, as it may assume that the filesystem is case-insensitive.

@maruncz
Copy link
Author

maruncz commented Apr 12, 2024

Hi

out.txt
here is output of nm, it is broken here as well. But it is all over the place, there are even / and \ mixed together.

I don't think that copying that output elf file to linux machine and testing it would yield different results, and i don't have much time now setting up whole develompent on linux machine.

I'm not sure how well you know gcc toolchain in general, but you can look into that particular toolchain source codes here https://www.ti.com/tool/MSP430-GCC-OPENSOURCE (it is the MSP430 variant, not to be confused with MSP432 which is just arm toolchain)

I did quick search and i was wondering, if this might be issue with build system?

@jedrzejboczar
Copy link
Owner

I don't think I would be able to easily spot the problem in the toolchain itself, and even then it probably wouldn't be easy to solve. You could try checking the build system, maybe it is the root ause of the problem. You can check if the case of paths is consistent in all the build system files.

I think that the easiest solution from the perspective of elf-size-analyze would be to just add a switch that makes all the file paths lowercase, this way you would loose the PascalCase naming but at least it would be consistent. What do you think?

@jedrzejboczar
Copy link
Owner

You could check with this version https://github.com/jedrzejboczar/elf-size-analyze/tree/jb/lowercase-filename passing the --lowercase-paths argument (I haven't tested this though).

@maruncz
Copy link
Author

maruncz commented Apr 17, 2024

Hi, thanks for this workaround.
I was not able to run that development version.
I'm not able to create venv, and running it directly links to old version of argparser

@jedrzejboczar
Copy link
Owner

Hmm, I'm not sure how venv setup on Windows works and if it's problematic. I don't know how else you could test this. You can probably just clone this git repo, checkout the branch, enter the directory and use python -m elf_size_analyze -h (or python3).

@maruncz
Copy link
Author

maruncz commented Apr 25, 2024

Hi, thanks for the tip on how to run development version.
I was able to test it and it is less confusing with all paths lowercase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants