Config.in: change default optimization level from -Os to -O2
Historically, Buildroot has defaulted to -Os as the gcc optimization
flags. However, this default is probably not the most appropriate
anymore, and this commit therefore changes the default to -O2.
Here are some arguments in favor of this change:
- Most Buildroot users use Buildroot for platforms that have a
reasonable amount of storage, and the difference between -Os and -O2
in terms of code size is no longer as significant compared to the
size of storage available on average embedded Linux devices
typically found these days.
- -Os can have a pretty bad performance impact, compared to -O2.
- -Os is much less widely tested than -O2. For example, with recent
versions of gcc, there are parts of Qt5 that segfault when compiled
with -Os and work perfectly fine with -O2. Yes, it's a compiler bug
that should be fixed, but in the mean time, having a default that's
more widely used/tested makes sense.
Signed-off-by: Thomas Petazzoni <[email protected]>
Acked-by: Yann E. MORIN <[email protected]>
Signed-off-by: Yann E. MORIN <[email protected]>