Bug 1605537 - override optimization settings for wasm compilation; r=firefox-build-system-reviewers,rstewart

The optimization flags that may have been chosen for our target compiler
are not necessarily appropriate for our wasm compiler.

Differential Revision: https://phabricator.services.mozilla.com/D58070

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Nathan Froyd 2019-12-23 16:49:32 +00:00
Родитель 393e8a2296
Коммит 6005490cac
1 изменённых файлов: 10 добавлений и 0 удалений

Просмотреть файл

@ -611,6 +611,16 @@ class WasmFlags(TargetCompileFlags):
TargetCompileFlags.__init__(self, context)
def _optimize_flags(self):
if not self._context.config.substs.get('MOZ_OPTIMIZE'):
return []
# We don't want `MOZ_{PGO_,}OPTIMIZE_FLAGS here because they may contain
# optimization flags that aren't suitable for wasm (e.g. -freorder-blocks).
# Just optimize for size in all cases; we may want to make this
# configurable.
return ['-Os']
class FinalTargetValue(ContextDerivedValue, six.text_type):
def __new__(cls, context, value=""):