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

Update toolchain, improve linker script, and reduce binary size. #20

Merged
merged 7 commits into from
Nov 6, 2019

Conversation

josephlr
Copy link
Contributor

@josephlr josephlr commented Nov 5, 2019

See the individual commits for more details (be sure to "merge/rebase" not "squash").

Signed-off-by: Joe Richey [email protected]

The current toolchain is 5 months old, and we want a new toolcahin for:
  - "efiapi" ABI
  - Using `Self` with enum implementations
  - Misc cargo improvements

Signed-off-by: Joe Richey <[email protected]>
This also gets rid of some warnings

Signed-off-by: Joe Richey <[email protected]>
- &Trait -> &dyn Trait
- Remove unneeded parens

Signed-off-by: Joe Richey <[email protected]>
- Move image fetching out of main script
- Move installation actions to "install"
- Set warning configs via environment variables
- Reorder sections to increase readablity

Signed-off-by: Joe Richey <[email protected]>
- Makes the binary smaller
- Prevents size regression when updating to new toolchain
- Avoids bugs like: rust-lang/rust#62785

Signed-off-by: Joe Richey <[email protected]>
To allow for future flat BIOS builds, we reorder the sections to put
the .text at the end (as that will contain the reset vector).

We also remove the alignment requirements for the sections, as they are
not necessary. This makes the binary about 10% smaller.

Signed-off-by: Joe Richey <[email protected]>
This maps the file headers into readonly data, while preventing any
other sections from being generated. It also makes the file 8% smaller.

We also replace the marker symbols for {begin|end}_of_{text|data} with
symbols denoting the begining/end of the file itself.

Finally, we make an explict DISCARD section (based off of EDK2's
GccBase.lds to prevent any additional data from entering our binary).

Signed-off-by: Joe Richey <[email protected]>
Copy link
Member

@rbradford rbradford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you!

@rbradford rbradford merged commit 5c1cb64 into cloud-hypervisor:master Nov 6, 2019
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

Successfully merging this pull request may close these issues.

2 participants