Chromium Code Reviews| Index: pnacl/driver/pnacl-ld.py |
| diff --git a/pnacl/driver/pnacl-ld.py b/pnacl/driver/pnacl-ld.py |
| index f8e9e7a313723be88da82eff355b842378cf5b1c..509c178c44b007390bf825e85ce7000d210129c7 100755 |
| --- a/pnacl/driver/pnacl-ld.py |
| +++ b/pnacl/driver/pnacl-ld.py |
| @@ -40,7 +40,8 @@ EXTRA_ENV = { |
| 'OPT_LEVEL': '', # Default opt is 0, but we need to know if it's explicitly |
| # requested or not, since we don't want to propagate |
| # the value to TRANSLATE_FLAGS if it wasn't explicitly set. |
| - 'OPT_FLAGS': '-O${#OPT_LEVEL ? ${OPT_LEVEL} : 0} ${OPT_STRIP_%STRIP_MODE%} ' + |
| + 'OPT_LTO_FLAGS': '-std-link-opts -disable-internalize', |
|
jvoung - send to chromium...
2013/03/21 21:23:37
might also want to leave a comment on why -disable
|
| + 'OPT_FLAGS': '${#OPT_LEVEL && !OPT_LEVEL == 0 ? ${OPT_LTO_FLAGS}} ${OPT_STRIP_%STRIP_MODE%} ' + |
|
jvoung - send to chromium...
2013/03/21 21:17:05
80 cols
|
| '-inline-threshold=${OPT_INLINE_THRESHOLD} ' + |
| '--do-not-wrap', |
| 'OPT_STRIP_none': '', |
| @@ -331,7 +332,7 @@ def main(argv): |
| if env.getbool('STATIC') and len(native_objects) == 0: |
| chain.add(DoExpandCtorsAndTls, 'expand_ctors_and_tls.' + bitcode_type) |
| if env.getone('OPT_LEVEL') != '' and env.getone('OPT_LEVEL') != '0': |
| - chain.add(DoOPT, 'opt.' + bitcode_type) |
| + chain.add(DoLTO, 'opt.' + bitcode_type) |
| elif env.getone('STRIP_MODE') != 'none': |
| chain.add(DoStrip, 'stripped.' + bitcode_type) |
| else: |
| @@ -434,9 +435,10 @@ def CheckInputsArch(inputs): |
| def DoExpandCtorsAndTls(infile, outfile): |
| RunDriver('opt', ['-nacl-expand-ctors', |
| '-nacl-expand-tls', |
| + '--do-not-wrap', |
| infile, '-o', outfile]) |
| -def DoOPT(infile, outfile): |
| +def DoLTO(infile, outfile): |
| opt_flags = env.get('OPT_FLAGS') |
| RunDriver('opt', opt_flags + [ infile, '-o', outfile ]) |