aboutsummaryrefslogtreecommitdiff
path: root/tools/shared.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-01-30 10:41:55 -0800
committerAlon Zakai <alonzakai@gmail.com>2012-01-30 10:41:55 -0800
commit764e81bd041395d4e3bd78c9c53b0676e34ef377 (patch)
treeab4a01e7388f4403fcec2a7cb312c06437be13e9 /tools/shared.py
parent7caf985807c372e609425d45f7630ea0407c9abb (diff)
do not do -Ox or LTO when building a linkable module
Diffstat (limited to 'tools/shared.py')
-rw-r--r--tools/shared.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/shared.py b/tools/shared.py
index e43ac8ab..2b87aaf4 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -540,13 +540,17 @@ class Building:
llvm-as < /dev/null | opt -std-compile-opts -disable-output -debug-pass=Arguments
'''
assert 0 <= optimization_level <= 3
- safe = Settings.USE_TYPED_ARRAYS != 2 or Settings.BUILD_AS_SHARED_LIB or Settings.LINKABLE
+ safe = Settings.USE_TYPED_ARRAYS != 2
opts = []
if optimization_level > 0:
if not safe:
opts.append('-disable-inlining') # we prefer to let closure compiler do our inlining, to avoid overly aggressive inlining
- opts.append('-O%d' % optimization_level)
- #opts.append('-std-compile-opts')
+ # -Ox opts do -globaldce, which removes stuff that is needed for libraries and linkables
+ if not Settings.BUILD_AS_SHARED_LIB and not Settings.LINKABLE:
+ opts.append('-O%d' % optimization_level)
+ else:
+ opts.append('-std-compile-opts')
+ print '[unsafe: %s]' % ','.join(opts)
else:
allow_nonportable = not safe
optimize_size = True