Skip to content

Changing -O2 parameter to -Os #2185

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

Merged
merged 1 commit into from
Jul 19, 2016
Merged

Changing -O2 parameter to -Os #2185

merged 1 commit into from
Jul 19, 2016

Conversation

yogpan01
Copy link
Contributor

This commit includes

  • Changing build option parameter from -O2 to -Os to reduce flash size of the
    final binary pacakge.
    The original parameter of -O2 is kept to circumvent the error
    http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46762 .
    But this error has been long fixed and released in latest 4.9.x GCC compiler.

    This change is necessary to reduce the generated binary size of mbed Client component to
    avoid problem of getting images over 512 kB which is causing application to crash because of
    Configuration Store problem https://github.com/ARMmbed/configuration-store/issues/21

This commit includes
- Changing build option parameter from -O2 to -Os to reduce flash size of the
  final binary pacakge.
  The original parameter of -O2 is kept to circumvent the error
  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46762 .
 But this error has been long fixed and released in latest 4.9.x GCC compiler.

 This change is necessary to reduce the generated binary size of mbed Client component to
avoid problem of getting images over 512 kB which is causing application to crash because of
Configuration Store problem https://github.com/ARMmbed/configuration-store/issues/21
@yogpan01
Copy link
Contributor Author

@sg- @0xc0170 This is MUST for getting mbed Client working on mbed OS.
Can you please approve and merge this PR ?

@yogpan01
Copy link
Contributor Author

@kjbracey-arm FYI

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 18, 2016

cc @screamerbg @adamgreen

This change is necessary to reduce the generated binary size of mbed Client component to
avoid problem of getting images over 512 kB which is causing application to crash because of
Configuration Store problem ARMmbed/configuration-store#21

How much we are away from 512 kB limit with this patch ?

@yogpan01
Copy link
Contributor Author

@0xc0170 Without this patch , mbed Client + Identity client (release build) is over 700 kB.
When we build mbed Client + Identity client (release build) with -Os parameter, the binary size is around 495 kB. So, we will just fit into 512 kB limit with this fix .

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 18, 2016

cc @bogdanm

Already few ppl expressed that Os should be used.

For me +1

@adamgreen
Copy link
Contributor

👍

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.

3 participants