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

Implement code size count from makefile. #23

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Conversation

diagprov
Copy link
Member

This commit uses the portable POSIX solution for counting the size of
the output library (.a), namely wc -c.
The output is specifically produced in the successful "end of make"
message.
Alternatively, one can now explicitly "make codesize".

We should specifically note that: code size will depend on target
architecture (x86_64 has 8-byte pointers, for example) and does not
account for the extraction of the various elf-objects. That is, this
code currently gives an upper bound estimate of the size INCLUDING ELF
metadata and symbols for each and every file in the archive. A release
image would strip all this information.

This commit uses the portable POSIX solution for counting the size of
the output library (.a), namely wc -c.
The output is specifically produced in the successful "end of make"
message.
Alternatively, one can now explicitly "make codesize".

We should specifically note that: code size will depend on target
architecture (x86_64 has 8-byte pointers, for example) and does not
account for the extraction of the various elf-objects. That is, this
code currently gives an upper bound estimate of the size INCLUDING **ELF**
metadata and symbols for each and every file in the archive. A release
image would strip all this information.
@diagprov diagprov added C-Enhancement New feature or request O-None No Operating System (free standing code) P-LOW Low priority issue B-build Related to the build system. labels Feb 26, 2020
@diagprov
Copy link
Member Author

@veorq this is a pretty minor change. If you like it, feel free to hit merge directly. I will seek to improve this, but this gives us an easy way to estimate the code size when talking to customers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-build Related to the build system. C-Enhancement New feature or request O-None No Operating System (free standing code) P-LOW Low priority issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants