[OE-core] [PATCH] Disable building libgcc with -O0
Phil Blundell
pb at pbcl.net
Tue Nov 12 23:58:55 UTC 2013
On Mon, 2013-11-11 at 12:30 +0800, Lei Liu wrote:
> +def get_optimization(d):
> + selected_optimization = d.getVar("SELECTED_OPTIMIZATION", True)
> + if base_contains("SELECTED_OPTIMIZATION", "-O0", "x", "", d) == "x":
> + bb.note("libgcc can't be built with -O0, -O2 will be used instead.")
> + return selected_optimization.replace("-O0", "-O2")
> + return selected_optimization
> +
> +SELECTED_OPTIMIZATION := "${@get_optimization(d)}"
Do we really need a Python function for this? It seems like a rather
heavyweight mechanism to detect what is basically just a distro
misconfiguration.
How about just patching the appropriate bit of libgcc to include:
#if __OPTIMIZE__ == 0
#error libgcc can't be built with -O0, please fix your distro to use at least -O1
#endif
or some such? Even this seems slightly dubious, since it will prevent
you from building an unoptimised libgcc even if you have no intention of
running valgrind with it, but at least this doesn't add extra overhead
within bitbake.
p.
More information about the Openembedded-core
mailing list