Skip to content

Implement code size count from makefile.#23

Open
diagprov wants to merge 1 commit into
developfrom
av/codesize
Open

Implement code size count from makefile.#23
diagprov wants to merge 1 commit into
developfrom
av/codesize

Conversation

@diagprov

Copy link
Copy Markdown
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
Copy Markdown
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