diff options
author | Andrea Pappacoda <andrea@pappacoda.it> | 2021-09-21 16:31:07 +0200 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2021-09-21 09:58:48 -0700 |
commit | 68eca11cc641cb02c7755f1e44fa3301863eacfd (patch) | |
tree | 566bc9df0a1bbeeab1427ad0eb6249ca3acc76eb | |
parent | ca866bcfc715fb39255e649a30a7fc02ad6ca8e2 (diff) | |
download | meson-68eca11cc641cb02c7755f1e44fa3301863eacfd.zip meson-68eca11cc641cb02c7755f1e44fa3301863eacfd.tar.gz meson-68eca11cc641cb02c7755f1e44fa3301863eacfd.tar.bz2 |
Use -Oz when optimization=s in Clang
-Oz is the appropriate flag to use when you want to produce the smallest
possible binary, and is one would expect when setting optimization to s
or using the minsize build type.
-rw-r--r-- | mesonbuild/compilers/mixins/clang.py | 2 | ||||
-rw-r--r-- | mesonbuild/interpreter/interpreter.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/mesonbuild/compilers/mixins/clang.py b/mesonbuild/compilers/mixins/clang.py index f7e9492..133ce96 100644 --- a/mesonbuild/compilers/mixins/clang.py +++ b/mesonbuild/compilers/mixins/clang.py @@ -40,7 +40,7 @@ clang_optimization_args = { '1': ['-O1'], '2': ['-O2'], '3': ['-O3'], - 's': ['-Os'], + 's': ['-Oz'], } # type: T.Dict[str, T.List[str]] class ClangCompiler(GnuLikeCompiler): diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index 1268e3e..4d4e5da 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -2322,7 +2322,7 @@ This will become a hard error in the future.''' % kwargs['input'], location=self # https://github.com/mesonbuild/meson/issues/3275#issuecomment-641354956 # https://github.com/mesonbuild/meson/issues/3742 warnargs = ('/W1', '/W2', '/W3', '/W4', '/Wall', '-Wall', '-Wextra') - optargs = ('-O0', '-O2', '-O3', '-Os', '/O1', '/O2', '/Os') + optargs = ('-O0', '-O2', '-O3', '-Os', '-Oz', '/O1', '/O2', '/Os') for arg in args: if arg in warnargs: mlog.warning(f'Consider using the built-in warning_level option instead of using "{arg}".', |