Skip to content

Add binary size regression tests #5

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

Open
v-thakkar opened this issue Jul 9, 2018 · 6 comments
Open

Add binary size regression tests #5

v-thakkar opened this issue Jul 9, 2018 · 6 comments

Comments

@v-thakkar
Copy link
Collaborator

The binary size of a program, compiled with opt-level=s, is tracked over time (per PR) and the CI fails if the binary size of the program regresses. The deadline for adding these tests is September 8, 2018.

@sekineh
Copy link
Collaborator

sekineh commented Jul 23, 2018

Of course GNU version is more easily accessible now:

sekineh@sekineh-VirtualBox:~/rustme5$ arm-none-eabi-size --version
GNU size (2.26-4ubuntu1+8) 2.26

@sekineh
Copy link
Collaborator

sekineh commented Jul 26, 2018

Library crates create .rlib file which is not easy to analyze because of the lack of tooling.
In addition, they are essentially compressed form of LLVM bitcodes. Not suitable for binary size checking!

So we must use 1) binary crates or 2) custom main for binary size regression tests.

@jamesmunns
Copy link
Owner

@sekineh you could also try building a staticlib, which would create a standard .a file. However, I am not sure how it behaves if you have not exposed the symbols (e.g. with #[no_mangle] and/or pub extern). It might be worth a check though :)

@sekineh
Copy link
Collaborator

sekineh commented Jul 26, 2018

@jamesmunns
staticlib might increase the visibility of codes in target arch.
In that case, we could edit Cargo.toml using sed, etc.

@sekineh
Copy link
Collaborator

sekineh commented Sep 3, 2018

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

3 participants