This repository was archived by the owner on Apr 21, 2025. It is now read-only.
Enable LTO for Android#165
Merged
Merged
Conversation
goderbauer
commented
Sep 10, 2018
| cflags = [ "/O1" ] + common_optimize_on_cflags + [ "/Oi" ] | ||
| } else if (is_android || is_ios) { | ||
| } else if (is_ios) { | ||
| cflags = [ "-Os" ] + common_optimize_on_cflags # Favor size over speed. |
Contributor
Author
There was a problem hiding this comment.
Using -Oz on iOS builds actually increases size, even though clang doc says:
-Oz Like -Os (and thus -O2), but reduces code size further.
There was a problem hiding this comment.
This is not entirely surprising. LTO usually leads to size increase due to inlining and it currently doesn't currently take -Oz into account. We had some discussions about this in the past, but the conclusion is that it's not quite clear what LTO with -Oz should do since those are to some extent conflicting options.
Contributor
Author
There was a problem hiding this comment.
Thanks for the explanation!
Contributor
Author
cbracken
approved these changes
Sep 10, 2018
Contributor
|
Please keep an eye on the benchmarks after this rolls into the framework. |
Contributor
Contributor
Author
Will do! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Size reductions of libflutter.so:
Fixes flutter/flutter#16538.